/**
 * Cornwall beaches explorer — coast-specific sidebar + pins.
 *
 * @package The_Duchy
 */

/* ---------- choose: search + list ---------- */

.beaches-explorer-search {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.beaches-explorer-search__field {
	position: relative;
	display: flex;
	align-items: center;
}

.beaches-explorer-search__icon {
	position: absolute;
	left: 0.7rem;
	pointer-events: none;
	font-size: 0.85rem;
	opacity: 0.55;
}

.beaches-explorer-search__input {
	width: 100%;
	padding: 0.65rem 2.1rem 0.65rem 2.1rem;
	border: 1px solid #cfd8dc;
	border-radius: 8px;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.9rem;
	font-weight: 500;
	color: #202124;
	background: #fff;
	box-sizing: border-box;
}

.beaches-explorer-search__input:focus {
	outline: 2px solid #00695c;
	outline-offset: 1px;
	border-color: #00695c;
}

.beaches-explorer-search__clear {
	position: absolute;
	right: 0.35rem;
	border: 0;
	background: transparent;
	font-size: 1.2rem;
	line-height: 1;
	color: #78909c;
	cursor: pointer;
	padding: 0.25rem 0.4rem;
}

.beaches-explorer-scilly {
	align-self: flex-start;
	border: 1px solid #b0bec5;
	background: #fff;
	color: #00695c;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-weight: 700;
	font-size: 0.78rem;
	text-transform: none;
	letter-spacing: normal;
	padding: 0.45rem 0.75rem;
	border-radius: 6px;
	cursor: pointer;
}

.beaches-explorer-scilly:hover,
.beaches-explorer-scilly:focus-visible {
	border-color: #00695c;
	background: #e0f2f1;
}

.beaches-explorer-stats--compact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.85rem;
	margin-bottom: 0.75rem;
	padding: 0.45rem 0;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.78rem;
	color: #546e7a;
}

.beaches-explorer-stats--compact strong {
	font-weight: 700;
	color: #00695c;
}

.beaches-explorer-results-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0.75rem 0 0.5rem;
}

.beaches-explorer-results-count {
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.78rem;
	font-weight: 700;
	color: #37474f;
	text-transform: none;
	letter-spacing: normal;
}

.beaches-explorer-results-hint {
	font-size: 0.72rem;
	font-weight: 500;
	color: #90a4ae;
}

.beaches-explorer-results {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 0.85rem;
	max-height: min(42vh, 420px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 2px;
}

.beaches-explorer-empty {
	padding: 0.85rem;
	border: 1px dashed #b0bec5;
	border-radius: 8px;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 500;
	color: #607d8b;
	text-align: center;
}

.beaches-result {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 0.65rem 0.7rem;
	cursor: pointer;
	transition: border-color 0.12s ease, background 0.12s ease;
	font: inherit;
	color: inherit;
	box-sizing: border-box;
}

.beaches-result:hover {
	border-color: #00695c;
	background: #f1faf9;
}

.beaches-result.is-active {
	border-color: #00695c;
	background: #e0f2f1;
	box-shadow: inset 3px 0 0 #00695c;
}

.beaches-result.is-hover:not(.is-active) {
	border-color: #ff3db6;
	background: #fff5fa;
	box-shadow: inset 3px 0 0 #ff3db6;
}

.beaches-result__num {
	flex: 0 0 auto;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-weight: 700;
	font-size: 0.78rem;
	background: #e0f2f1;
	color: #00695c;
}

.beaches-result__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.beaches-result__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.45rem;
}

.beaches-result__name {
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-weight: 700;
	font-size: 0.92rem;
	line-height: 1.25;
	text-transform: none;
	letter-spacing: normal;
	color: #12343b;
}

.beaches-result__wq {
	flex: 0 0 auto;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: none;
	letter-spacing: normal;
	color: var(--wq, #546e7a);
	white-space: nowrap;
}

.beaches-result__meta {
	font-size: 0.72rem;
	font-weight: 500;
	color: #78909c;
}

.beaches-result__cta {
	display: none;
	margin-top: 0.35rem;
	font-size: 0.72rem;
	font-weight: 700;
	color: #00695c;
	pointer-events: none;
}

.beaches-result:hover .beaches-result__cta,
.beaches-result.is-active .beaches-result__cta {
	display: block;
}

/* Primary detail CTA — same pink as the selected map pin */
.beaches-explorer-guide-cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	box-sizing: border-box;
	margin: 0.75rem 0 0.65rem;
	padding: 0.85rem 0.95rem;
	border: 2px solid #ff3db6;
	border-radius: 8px;
	background: #ff3db6;
	color: #fff;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	text-decoration: none;
	text-align: left;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
	box-shadow: 0 0 0 3px rgba(255, 61, 182, 0.25);
}

.beaches-explorer-guide-cta__label {
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	color: #fff;
}

.beaches-explorer-guide-cta__hint {
	font-weight: 500;
	font-size: 0.78rem;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.92);
	text-transform: none;
	letter-spacing: normal;
}

.beaches-explorer-guide-cta[hidden] {
	display: none !important;
}

.beaches-explorer-guide-cta:hover,
.beaches-explorer-guide-cta:focus-visible {
	background: #e0159a;
	border-color: #e0159a;
	color: #fff;
	outline: 2px solid #ffb3df;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(255, 61, 182, 0.35);
}

/* Quiet back — must not compete with the guide CTA */
.beaches-explorer-back--quiet {
	display: inline-block;
	margin: 0.15rem 0 0.5rem;
	padding: 0.35rem 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 600;
	color: #546e7a;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
}

.beaches-explorer-back--quiet:hover,
.beaches-explorer-back--quiet:focus-visible {
	color: #00695c;
	background: none;
	outline: none;
}

.beaches-explorer-stats,
.settlements-map-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
}

.beaches-explorer-stat,
.settlements-map-stat {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 0.5rem 0.6rem;
	text-align: center;
}

.beaches-explorer-stat__n,
.settlements-map-stat__n {
	font-size: 1.35rem;
	font-weight: 700;
	color: #00695c;
	line-height: 1.1;
}

.duchy-explorer--settlements .settlements-map-stat__n {
	color: #1a237e;
}

.beaches-explorer-stat__l,
.settlements-map-stat__l {
	font-size: 0.72rem;
	color: #666;
}

.beaches-explorer-legend,
.settlements-map-legend {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 0.65rem 0.75rem;
	margin-bottom: 0.65rem;
}

.beaches-explorer-legend h3,
.settlements-map-legend h3 {
	margin: 0 0 0.45rem;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #999;
}

.beaches-explorer-legend__row,
.settlements-map-legend__row {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-bottom: 0.35rem;
	font-size: 0.8rem;
	color: #333;
}

/* Water quality — plain sentence-case text (not pill/bubble chips). */
.beaches-explorer-wq {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	border-radius: 0;
	appearance: none;
	-webkit-appearance: none;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.35;
	color: #334155;
	cursor: pointer;
	text-align: left;
}

.beaches-explorer-wq:hover,
.beaches-explorer-wq:focus-visible {
	color: #00695c;
	text-decoration: underline;
	outline: none;
}

.beaches-explorer-wq.is-on {
	color: #00695c;
	font-weight: 700;
	text-decoration: underline;
}

.beaches-explorer-wq--static {
	cursor: default;
	font-weight: 500;
}

.beaches-explorer-wq--static:hover {
	color: #334155;
	text-decoration: none;
}

.beaches-explorer-legend__swatch,
.settlements-map-legend__swatch {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
}

.beaches-explorer-legend__swatch--dot {
	width: 9px;
	height: 9px;
	margin: 0 2px;
}

.beaches-explorer-legend__note {
	margin: 0.55rem 0 0;
	font-size: 0.72rem;
	line-height: 1.45;
	color: #6b7280;
}

.beaches-explorer-filter,
.settlements-map-filter {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.78rem;
	color: #555;
	margin: 0.5rem 0 0.35rem;
}

.beaches-explorer-filter input,
.settlements-map-filter input {
	accent-color: #00695c;
}

/* ---------- coast pins: small coloured circles (no clusters) ---------- */

.beaches-explorer-beach-pin,
.settlements-map-beach-pin {
	background: transparent;
	border: none;
}

.duchy-beach-dot {
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	opacity: 0.95;
	box-sizing: border-box;
	transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.beaches-explorer-beach-pin--dot.is-hover .duchy-beach-dot {
	transform: scale(1.35);
	box-shadow: 0 0 0 4px rgba(255, 61, 182, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.beaches-explorer-beach-pin--dot.is-selected .duchy-beach-dot {
	border-width: 3px;
	background: #ff3db6 !important;
	box-shadow: 0 0 0 5px rgba(255, 61, 182, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- pin labels + hover tooltips ---------- */

.leaflet-tooltip.duchy-beach-label,
.leaflet-tooltip.duchy-beach-tip {
	pointer-events: none !important;
}

.leaflet-tooltip.duchy-beach-label {
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(0, 105, 92, 0.35);
	border-radius: 5px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
	padding: 2px 7px;
	color: #12343b;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: normal;
	white-space: nowrap;
}

.leaflet-tooltip.duchy-beach-label::before {
	display: none;
}

.leaflet-tooltip.duchy-beach-tip {
	background: #12343b;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
	padding: 5px 9px;
	color: #fff;
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	letter-spacing: normal;
}

.leaflet-tooltip.duchy-beach-tip::before {
	border-top-color: #12343b;
}

.duchy-beach-tip__name {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
}

.duchy-beach-tip__sub {
	display: block;
	font-size: 0.68rem;
	font-weight: 500;
	opacity: 0.8;
}

.beaches-explorer-legend__swatch--wq-excellent,
.settlements-map-legend__swatch--wq-excellent { background: #00796b; }
.beaches-explorer-legend__swatch--wq-good,
.settlements-map-legend__swatch--wq-good { background: #43a047; }
.beaches-explorer-legend__swatch--wq-sufficient,
.settlements-map-legend__swatch--wq-sufficient { background: #fb8c00; }
.beaches-explorer-legend__swatch--wq-unknown,
.settlements-map-legend__swatch--wq-unknown { background: #546e7a; }

.beaches-explorer-beach-detail {
	padding: 0 1rem 1rem;
	overflow: visible;
}

/* ---------- phones: beach card docks over the map ---------- */

.beaches-explorer-detail--sheet {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 22px; /* clears the Leaflet attribution strip */
	z-index: 620;
	max-height: min(62%, 340px);
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 2px solid #00695c;
	border-radius: 14px;
	box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.22);
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-card {
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0.15rem 0.85rem 0.55rem;
}

/* Grab bar — tap to minimise the card down to name + water quality. */
.beaches-explorer-sheet-handle {
	display: none;
}

.beaches-explorer-detail--sheet .beaches-explorer-sheet-handle {
	display: block;
	width: 100%;
	padding: 9px 0 5px;
	border: 0;
	background: none;
	cursor: pointer;
}

/* Site-wide buttons carry a pink :focus outline — after a tap that reads as a
   stray line across the card, so keep the ring for keyboard focus only. */
.beaches-explorer-detail--sheet .beaches-explorer-sheet-handle:focus:not(:focus-visible) {
	outline: none;
}

.beaches-explorer-sheet-handle__grip {
	display: block;
	width: 40px;
	height: 4px;
	margin: 0 auto;
	border-radius: 999px;
	background: #b0bec5;
}

.beaches-explorer-sheet-handle:hover .beaches-explorer-sheet-handle__grip,
.beaches-explorer-sheet-handle:focus-visible .beaches-explorer-sheet-handle__grip {
	background: #00695c;
}

.beaches-explorer-detail--sheet.is-collapsed {
	max-height: none;
	overflow: hidden;
}

.beaches-explorer-detail--sheet.is-collapsed .beaches-explorer-beach-attrs,
.beaches-explorer-detail--sheet.is-collapsed .beaches-explorer-beach-note,
.beaches-explorer-detail--sheet.is-collapsed .beaches-explorer-beach-links {
	display: none;
}

/* Keep the Open beach page CTA visible even when the sheet is minimised. */
.beaches-explorer-detail--sheet.is-collapsed .beaches-explorer-guide-cta {
	display: flex;
}

.beaches-explorer-detail--sheet.is-collapsed .beaches-explorer-beach-badge {
	margin-bottom: 0.15rem;
}

/* Every row tightens up so the card leaves as much map visible as possible. */
.beaches-explorer-detail--sheet .beaches-explorer-beach-card__eyebrow {
	display: none;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-name {
	font-size: 1.1rem;
	margin-bottom: 0.35rem;
	padding-right: 2rem;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-badge {
	margin-bottom: 0.5rem;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-attrs {
	gap: 5px;
	margin-bottom: 0.5rem;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-attr {
	padding: 5px 7px;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-note {
	margin-bottom: 0.5rem;
	font-size: 0.74rem;
}

.beaches-explorer-detail--sheet .beaches-explorer-beach-links {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px 14px;
}

/* Keep the Layers tile and zoom stack reachable above the docked card. */
.beaches-explorer-canvas.has-beach-sheet .duchy-map-chrome-layers,
.beaches-explorer-canvas.has-beach-sheet .hub-explorer-layers-btn,
.beaches-explorer-canvas.has-beach-sheet .duchy-map-chrome-stack,
.beaches-explorer-canvas.has-beach-sheet .hub-explorer-gmaps-stack {
	bottom: calc(var(--duchy-beach-sheet-h, 0px) + 32px);
}

/* Back button becomes a round close control in the card's top corner. */
.beaches-explorer-detail--sheet button.beaches-explorer-back {
	position: absolute;
	top: 14px;
	right: 8px;
	width: 30px;
	height: 30px;
	padding: 0;
	overflow: hidden;
	text-indent: -999px;
	border-radius: 50%;
	background: #eceff1;
	border: 1px solid #cfd8dc;
}

.beaches-explorer-detail--sheet button.beaches-explorer-back::after {
	content: '×';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-indent: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1;
	color: #37474f;
}

.beaches-explorer-beach-card,
.settlements-map-beach-card {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 0.85rem 0.9rem;
	margin-bottom: 0.65rem;
}

.beaches-explorer-beach-card__eyebrow,
.settlements-map-beach-card__eyebrow {
	margin: 0 0 0.2rem;
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #00838f;
}

.beaches-explorer-beach-name,
.settlements-map-beach-name {
	font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
	font-size: 1.15rem;
	font-weight: 800;
	color: #12343b;
	margin-bottom: 0.45rem;
	text-transform: none;
	letter-spacing: normal;
}

.beaches-explorer-beach-badge,
.settlements-map-beach-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 800;
	margin-bottom: 0.65rem;
}

.beaches-explorer-beach-attrs,
.settlements-map-beach-attrs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-bottom: 0.65rem;
}

.beaches-explorer-beach-attr,
.settlements-map-beach-attr {
	background: #f8f9fa;
	border: 1px solid #e8eaed;
	border-radius: 6px;
	padding: 6px 8px;
	font-size: 0.74rem;
}

.beaches-explorer-beach-attr__k,
.settlements-map-beach-attr__k {
	display: block;
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #80868b;
	margin-bottom: 2px;
}

.beaches-explorer-beach-attr__v,
.settlements-map-beach-attr__v {
	font-weight: 700;
	color: #202124;
}

.beaches-explorer-beach-note,
.settlements-map-beach-note {
	margin: 0 0 0.65rem;
	font-size: 0.78rem;
	line-height: 1.45;
	color: #5f6368;
}

.beaches-explorer-beach-links,
.settlements-map-beach-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.beaches-explorer-beach-link,
.settlements-map-beach-link {
	font-size: 0.78rem;
	font-weight: 700;
	color: #1565c0;
	text-decoration: none;
}

.beaches-explorer-beach-link--site,
.settlements-map-beach-link--site {
	color: #00695c;
}

.beaches-explorer-beach-link:hover,
.settlements-map-beach-link:hover {
	text-decoration: underline;
}

.hub-explorer-teaser {
	max-width: 72rem;
	margin: 0 auto 0.75rem;
	padding: 0 1rem;
	font-size: 0.9rem;
}

.hub-explorer-teaser a {
	font-weight: 700;
	color: #00695c;
}

.atlas-parish-panel {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 600;
	width: min(280px, calc(100% - 24px));
	background: rgba(248, 249, 250, 0.96);
	border: 2px solid #1a237e;
	border-radius: 8px;
	padding: 0.75rem 0.85rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	font-size: 0.82rem;
	line-height: 1.45;
}

.atlas-parish-panel[hidden] {
	display: none !important;
}

.atlas-parish-panel__title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 800;
	color: #1a237e;
}

.atlas-parish-panel__meta {
	margin: 0 0 0.5rem;
	color: #5f6368;
	font-size: 0.78rem;
}

.atlas-parish-panel__link {
	display: inline-block;
	margin-top: 0.35rem;
	font-weight: 700;
	color: #1565c0;
	text-decoration: none;
}

.atlas-parish-panel__link:hover {
	text-decoration: underline;
}
