/**
 * Local Beaches — frontend styles (map, popups, cards, single beach).
 */

.lb-map-wrap {
	/* Το ύψος του shortcode είναι ο στόχος, όχι εντολή: σε χαμηλή οθόνη ο
	   χάρτης μαζεύεται, ώστε να μη χρειάζεται κύλιση για να τον δεις όλον.
	   Το --lb-map-vh αλλάζει με το γνώρισμα max_vh. */
	--lb-map-vh: 85;
	--lb-map-h: min( var( --lb-map-height, 640px ), calc( var( --lb-map-vh ) * 1vh ) );

	--lb-accent: #0d7ea8;
	--lb-radius: 14px;
	--lb-border: rgba( 15, 33, 45, 0.12 );
	--lb-shadow: 0 6px 24px rgba( 15, 33, 45, 0.1 );
	--lb-muted: #5a6b76;
	--lb-bg: #fff;

	position: relative;
	margin: 0 0 2rem;
	font-size: 15px;
	line-height: 1.45;
	color: #16242e;
}

.lb-map-wrap *,
.lb-map-wrap *::before,
.lb-map-wrap *::after {
	box-sizing: border-box;
}

@supports ( height: 1dvh ) {

	.lb-map-wrap {
		--lb-map-h: min( var( --lb-map-height, 640px ), calc( var( --lb-map-vh ) * 1dvh ) );
	}
}

/* ------------------------------------------------------------------ tabs */

.lb-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 12px;
}

.lb-tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	border: 1px solid var( --lb-border );
	border-radius: 999px;
	background: var( --lb-bg );
	font: inherit;
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.lb-tab__icon {
	display: inline-flex;
	color: var( --lb-cat, var( --lb-accent ) );
}

.lb-tab__count {
	padding: 1px 7px;
	border-radius: 999px;
	background: rgba( 15, 33, 45, 0.07 );
	color: var( --lb-muted );
	font-size: 0.82em;
}

.lb-tab:hover {
	border-color: var( --lb-cat, var( --lb-accent ) );
}

.lb-tab.is-on {
	background: var( --lb-cat, var( --lb-accent ) );
	border-color: var( --lb-cat, var( --lb-accent ) );
	color: #fff;
}

.lb-tab.is-on .lb-tab__icon {
	color: #fff;
}

.lb-tab.is-on .lb-tab__count {
	background: rgba( 255, 255, 255, 0.24 );
	color: #fff;
}

.lb-tab.is-empty:not( .is-on ) {
	opacity: 0.55;
}

.lb-tab:focus-visible {
	outline: 2px solid var( --lb-cat, var( --lb-accent ) );
	outline-offset: 2px;
}

@media ( max-width: 600px ) {

	.lb-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.lb-tabs::-webkit-scrollbar {
		display: none;
	}

	.lb-tab {
		flex: 0 0 auto;
	}
}

/* ------------------------------------------------------------------- bar */

.lb-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.lb-bar__search {
	flex: 1 1 240px;
	min-width: 200px;
}

.lb-search {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var( --lb-border );
	border-radius: 999px;
	background: var( --lb-bg );
	font: inherit;
	color: inherit;
}

.lb-search:focus {
	outline: 2px solid var( --lb-accent );
	outline-offset: 1px;
}

.lb-bar__count {
	color: var( --lb-muted );
	font-size: 0.9em;
	margin-left: auto;
}

.lb-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var( --lb-accent );
	color: #fff;
	font: inherit;
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

.lb-btn:hover,
.lb-btn:focus {
	filter: brightness( 0.93 );
	color: #fff;
	text-decoration: none;
}

.lb-btn[hidden] {
	display: none;
}

.lb-btn--ghost {
	background: var( --lb-bg );
	border-color: var( --lb-border );
	color: #16242e;
}

.lb-btn--ghost:hover,
.lb-btn--ghost:focus {
	color: #16242e;
	background: #f3f6f8;
}

.lb-btn--link {
	background: none;
	border: 0;
	padding: 6px 4px;
	color: var( --lb-accent );
	text-decoration: underline;
	font-weight: 500;
}

/* Leaflet styles every <a> inside the map, which would make the popup
   buttons blue-on-blue. These selectors are specific enough to win. */
.leaflet-container a.lb-btn {
	color: #fff;
	text-decoration: none;
}

.leaflet-container a.lb-btn:hover,
.leaflet-container a.lb-btn:focus {
	color: #fff;
}

.leaflet-container a.lb-btn--ghost,
.leaflet-container a.lb-btn--ghost:hover,
.leaflet-container a.lb-btn--ghost:focus {
	color: #16242e;
}

.lb-filters-toggle .lb-i {
	opacity: 0.7;
}

/* Σημείωση πάνω από τον χάρτη, π.χ. ότι η καρτέλα δείχνει μόνο επιλεγμένες. */

.lb-note {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 12px;
	padding: 9px 13px;
	border: 1px solid var( --lb-border );
	border-left: 3px solid var( --lb-cat, var( --lb-accent ) );
	border-radius: 10px;
	background: var( --lb-bg );
	color: var( --lb-muted );
	font-size: 0.88em;
	line-height: 1.35;
}

.lb-note .lb-i {
	flex: 0 0 auto;
	color: var( --lb-cat, var( --lb-accent ) );
}

/* --------------------------------------------------------------- filters */

.lb-filters {
	display: none;
	gap: 18px;
	flex-wrap: wrap;
	padding: 16px;
	margin-bottom: 12px;
	border: 1px solid var( --lb-border );
	border-radius: var( --lb-radius );
	background: var( --lb-bg );
}

.lb-filters.is-open {
	display: flex;
}

.lb-filters__group {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 160px;
}

.lb-filters__legend {
	padding: 0 0 6px;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --lb-muted );
}

.lb-filters__options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lb-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border: 1px solid var( --lb-border );
	border-radius: 999px;
	font-size: 0.86em;
	cursor: pointer;
	user-select: none;
	background: #fff;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lb-chip:hover {
	border-color: var( --lb-accent );
}

.lb-chip input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.lb-chip.is-on {
	background: var( --lb-accent );
	border-color: var( --lb-accent );
	color: #fff;
}

.lb-chip input:focus-visible + span {
	outline: 2px solid var( --lb-accent );
	outline-offset: 3px;
	border-radius: 3px;
}

.lb-filters__select {
	padding: 7px 10px;
	border: 1px solid var( --lb-border );
	border-radius: 8px;
	background: #fff;
	font: inherit;
	font-size: 0.88em;
}

/* ------------------------------------------------------------ map + list */

.lb-map__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.lb-map-wrap--with-list .lb-map__body {
	grid-template-columns: minmax( 0, 1fr ) 320px;
}

.lb-map__canvas {
	height: var( --lb-map-h, 640px );
	min-height: 320px;
	border-radius: var( --lb-radius );
	overflow: hidden;
	border: 1px solid var( --lb-border );
	background: #dfe9ee;
	z-index: 0;
}

.lb-map__list {
	height: var( --lb-map-h, 640px );
	overflow-y: auto;
	padding-right: 4px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	scrollbar-width: thin;
}

.lb-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 8px;
	border: 1px solid var( --lb-border );
	border-radius: 12px;
	background: var( --lb-bg );
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.lb-item:hover,
.lb-item:focus-visible {
	border-color: var( --lb-cat, var( --lb-accent ) );
	transform: translateY( -1px );
}

.lb-item__thumb {
	width: 64px;
	height: 52px;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 8px;
	background: #e3ebef;
}

.lb-item__thumb--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var( --lb-cat, var( --lb-accent ) );
}

.lb-item__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.lb-item__title {
	font-weight: 600;
	line-height: 1.25;
}

.lb-item__meta {
	font-size: 0.82em;
	color: var( --lb-muted );
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --------------------------------------------------------------- markers */

.lb-pin {
	position: relative;
	display: block;
	width: 30px;
	height: 40px;
	filter: drop-shadow( 0 2px 3px rgba( 0, 0, 0, 0.3 ) );
}

/* Ομάδα πινέζων: ίδιο ύφος με τα κουμπιά του χάρτη, όχι το πράσινο του
   markercluster που δεν έχει σχέση με τα χρώματα των κατηγοριών. */
.lb-cluster {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var( --lb-accent, #0d7ea8 );
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 0 0 4px rgba( 255, 255, 255, 0.55 ), 0 2px 6px rgba( 0, 0, 0, 0.3 );
}

.lb-pin__glyph {
	position: absolute;
	top: 5px;
	left: 0;
	width: 30px;
	display: flex;
	justify-content: center;
	color: var( --pin, #333 );
}

.lb-pin__rating {
	position: absolute;
	top: -3px;
	right: -5px;
	min-width: 16px;
	height: 16px;
	padding: 0 3px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.35 );
	text-align: center;
	font-size: 10px;
	font-weight: 700;
	font-style: normal;
	line-height: 16px;
	color: var( --pin, #333 );
}

.leaflet-marker-icon:focus .lb-pin {
	outline: 2px solid #fff;
	outline-offset: 2px;
	border-radius: 50%;
}

.lb-legend {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 8px 10px;
	background: rgba( 255, 255, 255, 0.94 );
	border-radius: 10px;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.2 );
	font-size: 12px;
	line-height: 1.35;
}

.lb-legend strong {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #5a6b76;
}

.lb-legend__row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.lb-legend__dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	flex: 0 0 auto;
	color: #fff;
}

.lb-legend[hidden] {
	display: none;
}

.lb-locate {
	background: #fff;
	border-radius: 6px;
	overflow: hidden;
}

.lb-locate__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	background: #fff;
	color: #16242e;
	cursor: pointer;
}

.lb-locate__btn.is-busy {
	opacity: 0.5;
}

/* ---------------------------------------------------------------- popups */

.lb-popup .leaflet-popup-content-wrapper {
	padding: 0;
	border-radius: var( --lb-radius );
	overflow: hidden;
	box-shadow: var( --lb-shadow );
}

.lb-popup .leaflet-popup-content {
	margin: 0;
	width: 320px !important;
	font-size: 14px;
	line-height: 1.4;
	color: #16242e;
}

.lb-popup .leaflet-popup-close-button {
	width: 26px;
	height: 26px;
	top: 6px;
	right: 6px;
	color: #16242e;
	background: rgba( 255, 255, 255, 0.85 );
	border-radius: 50%;
	font-size: 18px;
	line-height: 24px;
}

.lb-pop__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	padding: 12px 14px 0;
}

.lb-pop__cat {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex: 1 0 100%;
	color: var( --lb-cat, var( --lb-accent ) );
	font-size: 0.76em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.lb-pop__title {
	margin: 0;
	font-size: 1.08em;
	font-weight: 700;
	line-height: 1.2;
}

.lb-pop__summary {
	margin: 6px 0 0;
	padding: 0 14px;
	color: var( --lb-muted );
	font-size: 0.9em;
}

.lb-pop__rows {
	list-style: none;
	margin: 10px 0 0;
	padding: 0 14px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.lb-pop__row {
	display: grid;
	grid-template-columns: 18px auto 1fr;
	align-items: start;
	gap: 6px;
	font-size: 0.88em;
}

.lb-pop__icon {
	color: var( --lb-accent );
	display: flex;
	padding-top: 2px;
}

.lb-pop__label {
	color: var( --lb-muted );
}

.lb-pop__label::after {
	content: ":";
}

.lb-pop__value {
	font-weight: 500;
}

.lb-pop__actions {
	display: flex;
	gap: 8px;
	padding: 12px 14px 14px;
}

.lb-pop__actions .lb-btn {
	padding: 7px 12px;
	font-size: 0.85em;
}

/* --------------------------------------------------------------- slider */

.lb-slider {
	position: relative;
	overflow: hidden;
	background: #dfe9ee;
}

.lb-slider__track {
	display: flex;
	transition: transform 0.35s ease;
}

.lb-slider__img {
	flex: 0 0 100%;
	width: 100%;
	height: 190px;
	object-fit: cover;
	display: block;
}

.lb-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.9 );
	color: #16242e;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.25 );
}

.lb-slider__nav--prev {
	left: 8px;
}

.lb-slider__nav--next {
	right: 8px;
}

.lb-slider__nav:hover {
	background: #fff;
}

/* Πάνω δεξιά, ώστε να μην πέφτει πάνω στις τελείες του slider. */
.lb-slider__credit {
	position: absolute;
	top: 0;
	right: 0;
	max-width: 85%;
	padding: 3px 7px;
	font-size: 10px;
	line-height: 1.3;
	color: #fff;
	background: rgba( 0, 0, 0, 0.55 );
	border-radius: 0 0 0 8px;
	text-align: right;
	pointer-events: none;
}

.lb-slider__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	display: flex;
	justify-content: center;
	gap: 5px;
}

.lb-slider__dot {
	width: 7px;
	height: 7px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.6 );
	cursor: pointer;
}

.lb-slider__dot.is-on {
	background: #fff;
	transform: scale( 1.25 );
}

/* ---------------------------------------------------------------- stars */

.lb-stars {
	font-size: 0.95em;
	letter-spacing: 1px;
	color: #f0a500;
	white-space: nowrap;
}

.lb-stars__off {
	color: #d8dee2;
}

/* ---------------------------------------------------------------- cards */

.lb-cards {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	margin: 0 0 2rem;
}

.lb-cards--cols-2 {
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
}

.lb-cards--cols-3 {
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

.lb-cards--cols-4 {
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
}

.lb-card {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba( 15, 33, 45, 0.12 );
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lb-card:hover {
	transform: translateY( -2px );
	box-shadow: 0 6px 24px rgba( 15, 33, 45, 0.1 );
}

.lb-card__media {
	display: block;
	aspect-ratio: 3 / 2;
	background: #dfe9ee;
}

.lb-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lb-card__body {
	padding: 12px 14px 16px;
}

.lb-card__cat {
	margin: 0 0 4px;
	color: var( --lb-cat, #0d7ea8 );
	font-size: 0.74em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.lb-card__title {
	margin: 0 0 4px;
	font-size: 1.05em;
	line-height: 1.25;
}

.lb-card__rating {
	margin: 0 0 6px;
}

.lb-card__summary {
	margin: 0 0 8px;
	font-size: 0.9em;
	color: #5a6b76;
}

.lb-card__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.85em;
	color: #5a6b76;
}

.lb-card__meta li + li {
	margin-top: 2px;
}

/* --------------------------------------------------------- single place */

.lb-single {
	margin: 2rem 0 0;
}

.lb-single__cat {
	display: inline-block;
	margin: 0 0 0.4rem;
	padding: 3px 10px;
	border-radius: 999px;
	background: var( --lb-cat, #0d7ea8 );
	color: #fff;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.lb-single__rating {
	font-size: 1.3em;
	margin: 0 0 1rem;
}

.lb-single__gallery {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
	gap: 10px;
	margin: 0 0 1.5rem;
}

.lb-single__figure {
	margin: 0;
}

.lb-single__figure img {
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 12px;
	display: block;
}

.lb-single__credit {
	font-size: 0.78em;
	line-height: 1.4;
	opacity: 0.75;
	margin: 4px 0 1rem;
}

.lb-single__credit a {
	color: inherit;
}

.lb-single__heading {
	margin: 1.6rem 0 0.6rem;
	font-size: 1.25em;
}

.lb-single__table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1rem;
}

.lb-single__table th,
.lb-single__table td {
	padding: 9px 10px;
	border-bottom: 1px solid rgba( 15, 33, 45, 0.1 );
	text-align: left;
	vertical-align: top;
	font-size: 0.95em;
}

.lb-single__table th {
	width: 34%;
	font-weight: 600;
	color: #5a6b76;
}

.lb-single__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 1rem 0 0;
}

.lb-empty {
	padding: 1rem;
	border: 1px dashed rgba( 15, 33, 45, 0.2 );
	border-radius: 12px;
	color: #5a6b76;
}

/* ----------------------------------------------------------- responsive */

@media ( max-width: 860px ) {
	.lb-map-wrap--with-list .lb-map__body {
		grid-template-columns: 1fr;
	}

	.lb-map__list {
		height: auto;
		max-height: 320px;
		/* Without this the row of cards widens the grid track and the whole
		   page scrolls sideways instead of just the list. */
		min-width: 0;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		padding-bottom: 6px;
	}

	.lb-item {
		flex: 0 0 230px;
	}

	.lb-cards--cols-3,
	.lb-cards--cols-4 {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 540px ) {
	.lb-map-wrap {
		--lb-map-vh: 70;
	}

	.lb-popup .leaflet-popup-content {
		width: 250px !important;
	}

	.lb-slider__img {
		height: 150px;
	}

	.lb-cards--cols-2,
	.lb-cards--cols-3,
	.lb-cards--cols-4 {
		grid-template-columns: 1fr;
	}

	.lb-single__table th {
		width: 45%;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.lb-slider__track,
	.lb-card,
	.lb-item {
		transition: none;
	}
}
