/* Snorkelling map explorer (snorkel-locations.php) — moved from the page's
   <style> block 2026-09-15. */
/* ════════════════════════════════════════════════════════════
   SNORKELLING MAP EXPLORER
════════════════════════════════════════════════════════════ */

/* ── LAYOUT SHELL ── */
.snk-explorer {
    display: flex;
    height: calc(100vh - 59px);
    margin-top: 59px;
    overflow: hidden;
    position: relative;
}

/* ── SIDEBAR ── */
.snk-sidebar {
    width: 360px;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-right: 1px solid var(--rule);
    transition: width .35s cubic-bezier(.4,0,.2,1), min-width .35s cubic-bezier(.4,0,.2,1);
    z-index: 10;
    position: relative;
    overflow: hidden;
}
.snk-sidebar.collapsed {
    width: 0;
    min-width: 0;
}

.snk-sidebar__head {
    padding: 1rem 1.1rem .75rem;
    border-bottom: 1px solid var(--rule);
    flex-shrink: 0;
    background: var(--bg-3);
}
.snk-sidebar__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-top: 0;
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}
.snk-sidebar__title i { color: #3eb8c8; }

.snk-search-wrap { position: relative; margin-bottom: .6rem; }
.snk-search-wrap i {
    position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    color: var(--ink-3); font-size: .75rem; pointer-events: none;
}
.snk-search {
    width: 100%; background: var(--bg-card); border: 1px solid var(--rule);
    border-radius: var(--radius); color: var(--ink); font-family: var(--font-body);
    font-size: .82rem; padding: .5rem .75rem .5rem 2rem; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.snk-search:focus { border-color: rgba(62,184,200,.5); box-shadow: 0 0 0 2px rgba(62,184,200,.1); }
.snk-search::placeholder { color: var(--ink-3); }

.snk-filter-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.snk-fpill {
    font-family: var(--font-mono); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .27rem .6rem .13rem; border-radius: 100px; border: 0;
    color: var(--ink-3); cursor: pointer; background: var(--parchment-dim);
    transition: color .2s, background .2s; white-space: nowrap;
}
.snk-fpill:hover { color: #3eb8c8; background: rgba(62,184,200,.12); }
.snk-fpill.active { color: #3eb8c8; background: rgba(62,184,200,.18); }
.snk-fpill--beginner.active     { color: #5ac85a; background: rgba(90,200,90,.18); }
.snk-fpill--intermediate.active { color: #c8a032; background: rgba(200,160,50,.18); }
.snk-fpill--advanced.active     { color: #ec8a8a; background: rgba(200,80,80,.18); }

.snk-result-count {
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em;
    color: var(--ink-3); padding: .5rem 1.1rem; border-bottom: 1px solid var(--rule);
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    white-space: nowrap;
}
.snk-result-count span { color: #3eb8c8; font-weight: 700; }

.snk-list {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.snk-list::-webkit-scrollbar { width: 4px; }
.snk-list::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

.snk-item {
    display: flex; gap: .75rem; align-items: center;
    padding: .75rem 1.1rem; border-bottom: 1px solid var(--rule);
    cursor: pointer; transition: background .15s; text-decoration: none; position: relative;
    border-left: 3px solid transparent;
}
.snk-item:hover { background: var(--bg-3); }
.snk-item.active { background: rgba(62,184,200,.08); border-left-color: #3eb8c8; }
.snk-item * { pointer-events: none; }
.snk-item.hidden { display: none; }

.snk-item__thumb {
    width: 52px; height: 52px; border-radius: var(--radius); overflow: hidden;
    flex-shrink: 0; background: var(--bg-3);
    display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: .9rem;
}
.snk-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.snk-item__body { flex: 1; min-width: 0; }
.snk-item__title {
    font-family: var(--font-display); font-size: .85rem; font-weight: 700; color: var(--ink);
    line-height: 1.2; margin-top: 0; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snk-item__title a { color: inherit; text-decoration: none; }
.snk-item__title a:hover { text-decoration: underline; }
.snk-item.active .snk-item__title { color: #3eb8c8; }
.snk-item__meta {
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .06em;
    color: var(--ink-3); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.snk-item__diff {
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .18rem .45rem .06rem; border-radius: 100px;
}
.snk-item__diff--beginner     { background: rgba(90,200,90,.12);  color: #5ac85a; }
.snk-item__diff--intermediate { background: rgba(200,160,50,.12); color: #c8a032; }
.snk-item__diff--advanced     { background: rgba(200,80,80,.12);  color: #ec8a8a; }

.snk-item__vis {
    width: 6px; height: 6px; border-radius: 50%; background: #3eb8c8;
    flex-shrink: 0; opacity: 0; transition: opacity .2s;
}
.snk-item.in-view .snk-item__vis { opacity: 1; }

.snk-list-empty {
    padding: 2.5rem 1.1rem; text-align: center; color: var(--ink-3); font-size: .82rem; display: none;
}
.snk-list-empty i { font-size: 1.5rem; margin-bottom: .75rem; display: block; }

/* ── TOGGLE BUTTON ──
   Lives in the explorer container, not inside the sidebar,
   so it is never clipped by overflow:hidden on collapse.
── */
.snk-toggle {
    position: absolute;
    top: 50%;
    left: 360px;
    transform: translateY(-50%) translateX(-1px);
    width: 20px;
    height: 52px;
    background: var(--bg-card);
    border: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,.18);
    border-radius: 0 var(--radius) var(--radius) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: var(--ink-3);
    font-size: .6rem;
    transition: left .35s cubic-bezier(.4,0,.2,1), background .2s, color .2s,
                border-radius .2s;
}
.snk-toggle:hover { background: var(--bg-3); color: #3eb8c8; }
.snk-explorer.sidebar-collapsed .snk-toggle {
    left: 0;
    border-radius: var(--radius);
    transform: translateY(-50%);
}

/* ── MAP PANE ── */
.snk-map-pane { flex: 1; position: relative; z-index: 0; }

/* Map fills the space above the bottom bar */
#snorkel-map {
    position: absolute;
    top: 0;
    bottom: 36px;
    left: 0;
    right: 0;
    width: auto;
    height: auto;
}

/* ── POPUP PANEL ── */
.snk-popup-panel {
    position: absolute;
    bottom: 36px;
    left: 0; right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.5rem 1.75rem;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 600; max-height: 55%; overflow-y: auto;
    box-shadow: 0 -12px 40px rgba(0,0,0,.5);
    visibility: hidden;
}
.snk-popup-panel.open { transform: translateY(0); visibility: visible; }
.snk-popup-panel__drag {
    width: 36px; height: 4px; background: var(--rule); border-radius: 2px; margin: 0 auto .85rem;
}
.snk-popup-panel__close {
    position: absolute; top: 1.1rem; right: 1.25rem;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-3); border: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink-3); font-size: .7rem;
    transition: background .2s, color .2s;
}
.snk-popup-panel__close:hover { background: rgba(62,184,200,.16); color: #3eb8c8; }
.snk-popup-panel__inner {
    display: grid; grid-template-columns: 140px 1fr; gap: 1.25rem; align-items: start;
}
.snk-popup-panel__img {
    width: 140px; height: 100px; border-radius: var(--radius-lg); overflow: hidden;
    flex-shrink: 0;
}
.snk-popup-panel__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.snk-popup-panel__img-placeholder {
    width: 100%; height: 100%; background: var(--bg-3);
    display: flex; align-items: center; justify-content: center; color: #3eb8c8; font-size: 1.5rem;
}
.snk-popup-panel__region {
    font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
    color: #3eb8c8; margin-bottom: .3rem; display: flex; align-items: center; gap: .35rem;
}
.snk-popup-panel__title {
    font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
    color: var(--ink); line-height: 1.1; letter-spacing: -.02em; margin-bottom: .5rem;
}
.snk-popup-panel__summary {
    font-size: .82rem; color: var(--ink-2); line-height: 1.7; margin-bottom: .85rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.snk-popup-panel__pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.snk-ppill {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .29rem .6rem .11rem; border-radius: 100px; background: var(--parchment-dim); color: var(--ink-3);
}
.snk-ppill--beginner     { color: #5ac85a; background: rgba(90,200,90,.12); }
.snk-ppill--intermediate { color: #c8a032; background: rgba(200,160,50,.12); }
.snk-ppill--advanced     { color: #ec8a8a; background: rgba(200,80,80,.12); }
.snk-popup-panel__cta {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
    background: #3eb8c8; color: #0a1012; font-weight: 700;
    padding: .6rem 1.2rem .5rem; border-radius: var(--radius); text-decoration: none; transition: opacity .2s;
}
.snk-popup-panel__cta:hover { opacity: .85; color: #0a1012; }

/* ── MAP CONTROLS ── */
.snk-map-controls {
    /* Above Leaflet's own furniture. Leaflet stacks its map pane at 400, its
       zoom control at 800 and its control container at 1000, so the z-index of
       10 this had put the whole cluster UNDERNEATH the map — the buttons were
       rendered and sized correctly but painted behind the tiles. */
    position: absolute; top: 1rem; right: 1rem; z-index: 1100;
    display: flex; flex-direction: column; gap: .5rem;
}
.snk-map-btn {
    width: 36px; height: 36px; background: var(--bg-card) !important; border: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.28);
    border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink-3); font-size: 1.1rem;
    transition: color .2s, background .2s;
}
/* The base background is !important, so the state fills must be too — with no
   edge, the fill is what shows hover and the satellite button's on state. */
.snk-map-btn:hover { color: #3eb8c8; background: var(--bg-3) !important; }
.snk-map-btn.active { color: #3eb8c8; background: color-mix(in srgb, #3eb8c8 20%, var(--bg-card)) !important; }

/* Over aerial imagery the markers sit on a busy, high-contrast photo
   rather than flat grey. A slight scrim under the map furniture keeps the
   labels and cluster bubbles readable without dimming the imagery. */
#snorkel-map.is-satellite .marker-cluster-small div,
#snorkel-map.is-satellite .marker-cluster-medium div,
#snorkel-map.is-satellite .marker-cluster-large div {
    box-shadow: 0 0 0 2px rgba(8,12,14,.55);
}
#snorkel-map.is-satellite .leaflet-control-attribution {
    background: rgba(8,12,14,.72); color: #e8e4da;
}

.snk-viewport-label {
    position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
    background: rgba(8,12,14,.85); backdrop-filter: blur(8px);
    border-radius: 100px;
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-3); padding: .39rem .85rem .21rem; z-index: 1050; pointer-events: none; white-space: nowrap;
}
.snk-viewport-label span { color: #3eb8c8; font-weight: 700; }

/* ── MAP BOTTOM BAR ── */
.snk-map-bottombar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: rgba(8,12,14,.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 500;
    gap: 1rem;
}
.snk-map-bottombar__left {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-family: var(--font-mono);
    font-size: .58rem;
    letter-spacing: .08em;
    color: var(--ink-3);
}
.snk-map-bottombar__left a {
    color: var(--ink-3);
    text-decoration: none;
    transition: color .15s;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.snk-map-bottombar__left a:hover { color: #3eb8c8; }
.snk-map-bottombar__left a.snk-map-bottombar__home {
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
}
.snk-map-bottombar__sep { color: var(--ink-3); font-size: .6rem; }
.snk-map-bottombar__current {
    color: var(--ink-2); font-family: var(--font-mono); font-size: .58rem;
    letter-spacing: .1em; text-transform: uppercase;
}
.snk-map-bottombar__link { color: var(--ink-3); text-decoration: none; transition: color .15s; }
.snk-map-bottombar__link:hover { color: #3eb8c8; }
/* Shown and hidden by the page script through style.display. */
.snk-viewport-note { display: none; color: var(--ink-3); font-size: .55rem; }
.snk-map-bottombar__right {
    font-family: var(--font-mono);
    font-size: .56rem;
    letter-spacing: .08em;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.snk-map-bottombar__right span { color: #3eb8c8; }

/* ── LEAFLET DARK ── */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border-radius: var(--radius-lg) !important; box-shadow: 0 8px 32px rgba(0,0,0,.6) !important; color: var(--ink) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; box-shadow: none !important; }
.leaflet-popup-content { margin: .75rem .9rem; }
.leaflet-popup-close-button { color: var(--ink-3) !important; top: .4rem !important; right: .4rem !important; }
.leaflet-popup-close-button:hover { color: #3eb8c8 !important; background: transparent !important; }
.leaflet-control-zoom a { background: var(--bg-card) !important; border-color: var(--rule) !important; color: var(--ink-2) !important; }
.leaflet-control-zoom a:hover { color: #3eb8c8 !important; }
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background-color: rgba(62,184,200,.2) !important; }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(62,184,200,.85) !important; color: #0a1012 !important;
    font-family: var(--font-mono); font-size: .65rem; font-weight: 700;
}

/* ── MARKERS ── Leaflet divIcons; the ring is part of the pin. */
.snk-marker {
    width: 14px; height: 14px; background: #3eb8c8;
    border: 2px solid rgba(62,184,200,.5); border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(62,184,200,.15); cursor: pointer;
}
.snk-marker--active {
    width: 20px; height: 20px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 5px rgba(62,184,200,.4);
}

/* ── MOBILE ── */
@media (max-width: 767px) {
    .snk-explorer { flex-direction: column; height: auto; }
    .snk-sidebar { width: 100% !important; min-width: 100% !important; max-height: 320px; border-right: none; border-bottom: 1px solid var(--rule); overflow: hidden; transition: max-height .35s cubic-bezier(.4,0,.2,1); }
    .snk-sidebar.collapsed { max-height: 52px; }
    .snk-map-pane { height: 60vh; }
    .snk-toggle { display: none; }
    .snk-popup-panel__inner { grid-template-columns: 1fr; }
    .snk-popup-panel__img { width: 100%; height: 160px; }
}

/* ── LIGHT THEME ──
   The explorer's accent colours (#3eb8c8 teal and the green / amber / red
   difficulty set) are bright tones picked for the dark ground; on ivory they
   fell to 1.5–2:1. Light mode uses deeper tones of the same hues. The map's
   bottom bar and viewport label were fixed near-black glass while their text
   follows the theme ink, so in light mode they become light glass instead. */
html[data-theme="light"] .snk-sidebar__title i,
html[data-theme="light"] .snk-result-count span,
html[data-theme="light"] .snk-fpill:hover,
html[data-theme="light"] .snk-fpill.active,
html[data-theme="light"] .snk-item.active .snk-item__title,
html[data-theme="light"] .snk-toggle:hover,
html[data-theme="light"] .snk-popup-panel__close:hover,
html[data-theme="light"] .snk-popup-panel__img-placeholder,
html[data-theme="light"] .snk-popup-panel__region,
html[data-theme="light"] .snk-map-btn:hover,
html[data-theme="light"] .snk-map-btn.active,
html[data-theme="light"] .snk-viewport-label span,
html[data-theme="light"] .snk-map-bottombar__left a:hover,
html[data-theme="light"] .snk-map-bottombar__link:hover,
html[data-theme="light"] .snk-map-bottombar__right span,
html[data-theme="light"] .leaflet-popup-close-button:hover,
html[data-theme="light"] .leaflet-control-zoom a:hover {
    color: #17626c !important;
}
html[data-theme="light"] .snk-item.active { border-left-color: #17626c; }
html[data-theme="light"] .snk-item__vis { background: #17626c; }

/* The filter row sits on the tan header (--bg-3), so pills lift to a pale fill;
   the state fills are opaque tints of the text colour over white. */
html[data-theme="light"] .snk-fpill { background: rgba(255,255,255,.6); }
html[data-theme="light"] .snk-fpill:not(.active) { color: var(--ink-2); }
html[data-theme="light"] .snk-fpill:hover,
html[data-theme="light"] .snk-fpill.active { background: color-mix(in srgb, #17626c 14%, #fff); }
html[data-theme="light"] .snk-fpill--beginner.active     { background: color-mix(in srgb, #245a24 14%, #fff); }
html[data-theme="light"] .snk-fpill--intermediate.active { background: color-mix(in srgb, #6a4a06 14%, #fff); }
html[data-theme="light"] .snk-fpill--advanced.active     { background: color-mix(in srgb, #8a2a2a 14%, #fff); }

html[data-theme="light"] .snk-map-btn,
html[data-theme="light"] .snk-popup-panel__close,
html[data-theme="light"] .snk-ppill:not([class*="snk-ppill--"]),
html[data-theme="light"] .snk-map-bottombar__left a { color: var(--ink-2); }

/* The bottom bar's link was given the same --ink-2 as the sentence it sits
   in, so nothing but the cursor said it was a link. It takes the bar's own
   teal, which is what its hover and the counts beside it already use. */
html[data-theme="light"] .snk-map-bottombar__link {
    color: #17626c;
    text-decoration: underline;
    text-underline-offset: .18em;
}

/* A light-theme link colour was overriding the button's dark text on teal. */
html[data-theme="light"] .snk-popup-panel__cta,
html[data-theme="light"] .snk-popup-panel__cta:hover {
    background: #17626c;
    color: #fff !important;
}

html[data-theme="light"] .snk-fpill--beginner.active,
html[data-theme="light"] .snk-item__diff--beginner,
html[data-theme="light"] .snk-ppill--beginner     { color: #245a24 !important; }
html[data-theme="light"] .snk-fpill--intermediate.active,
html[data-theme="light"] .snk-item__diff--intermediate,
html[data-theme="light"] .snk-ppill--intermediate { color: #6a4a06 !important; }
html[data-theme="light"] .snk-fpill--advanced.active,
html[data-theme="light"] .snk-item__diff--advanced,
html[data-theme="light"] .snk-ppill--advanced     { color: #8a2a2a !important; }

html[data-theme="light"] .snk-viewport-label,
html[data-theme="light"] .snk-map-bottombar {
    background: rgba(247,242,232,.92);
    color: var(--ink-2);
}
html[data-theme="light"] .snk-map-bottombar__left,
html[data-theme="light"] .snk-map-bottombar__right { color: var(--ink-3); }

/* Secondary text in light mode sits on --bg-card and on the tan --bg-3 row
   hover, where --ink-3 fell just under AA. */
html[data-theme="light"] .snk-result-count,
html[data-theme="light"] .snk-item__meta,
html[data-theme="light"] .snk-map-bottombar__left,
html[data-theme="light"] .snk-map-bottombar__right { color: var(--ink-2); }
