/* ═══════════════════════════════════════════════════════════
   SKYRISE ATOLL DISTANCES — speedboat times from Malé
   Loaded only by pages/atoll-distances.php

   The whole page is one list: atoll name (+ Dhivehi name) and the
   approximate one-way speedboat time from Malé. The atoll code chips
   that link into these rows are styled by assets/css/atoll-code.css
   on the stay cards, not here.
   ═══════════════════════════════════════════════════════════ */

.atoll-hero {
    position: relative;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

.atoll-hero__intro .section-label {
    margin-bottom: 0.5rem;
}

/* ─── Hero stats ────────────────────────────────────────────── */
.atoll-hero__stats {
    margin-top: 1.75rem;
}

.atoll-stat {
    min-width: 160px;
    max-width: 240px;
    padding: 0.9rem 1.25rem;
    border-radius: var(--card-radius);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.atoll-stat__num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent-dark, #005f6b);
}

.atoll-stat__label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Explorer: filters ─────────────────────────────────────── */
.atoll-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.atoll-chip:hover {
    border-color: var(--accent, #0d9488);
}

.atoll-chip.is-active {
    background: var(--accent, #0d9488);
    border-color: var(--accent, #0d9488);
    color: #fff;
}

.atoll-chip__count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-dark, #005f6b);
}

.atoll-chip.is-active .atoll-chip__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ─── Explorer: map + detail grid ───────────────────────────── */
.atoll-explorer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

.atoll-map-card {
    padding: 0.9rem;
    border-radius: var(--card-radius);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.atoll-map {
    display: block;
    width: 100%;
    height: auto;
    max-height: 72vh;
}

.atoll-map__grid line {
    stroke: rgba(var(--accent-rgb), 0.12);
    stroke-width: 1;
    stroke-dasharray: 2 6;
}

.atoll-map__route {
    stroke: var(--accent, #0d9488);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 1 7;
}

.atoll-dot {
    cursor: pointer;
    outline: none;
}

.atoll-dot__halo {
    fill: transparent;
    transition: fill 0.2s ease;
}

.atoll-dot__core {
    fill: #fff;
    stroke: var(--accent, #0d9488);
    stroke-width: 2.5;
    transition: fill 0.2s ease, r 0.2s ease;
}

.atoll-dot:hover .atoll-dot__core,
.atoll-dot:focus-visible .atoll-dot__core {
    fill: rgba(var(--accent-rgb), 0.25);
}

.atoll-dot.is-selected .atoll-dot__core {
    fill: var(--accent, #0d9488);
}

.atoll-dot.is-selected .atoll-dot__halo {
    fill: rgba(var(--accent-rgb), 0.12);
}

.atoll-dot--male .atoll-dot__core {
    stroke: var(--accent-coral, #e11d48);
}

.atoll-dot--male.is-selected .atoll-dot__core {
    fill: var(--accent-coral, #e11d48);
}

.atoll-dot__label {
    font-size: 11px;
    font-weight: 600;
    fill: var(--text-muted);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.atoll-dot:hover .atoll-dot__label,
.atoll-dot:focus-visible .atoll-dot__label,
.atoll-dot.is-selected .atoll-dot__label {
    opacity: 1;
}

.atoll-dot__male-label {
    font-size: 11px;
    font-weight: 700;
    fill: var(--accent-coral, #e11d48);
    pointer-events: none;
}

.atoll-dot.is-dimmed {
    opacity: 0.18;
    pointer-events: none;
}

.atoll-map__boat {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.atoll-map__boat.is-visible {
    opacity: 1;
}

.atoll-map__boat-pulse {
    fill: rgba(var(--accent-rgb), 0.2);
    animation: atoll-boat-pulse 1.6s ease-out infinite;
}

.atoll-map__boat-core {
    fill: #fff;
    stroke: var(--accent, #0d9488);
    stroke-width: 2.5;
}

@keyframes atoll-boat-pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}

.atoll-map-card__note {
    padding: 0.75rem 0.35rem 0.15rem;
}

/* ─── Explorer: detail panel ────────────────────────────────── */
.atoll-detail {
    padding: 1.5rem;
    border-radius: var(--card-radius);
    border: 1px solid var(--bg-glass-border);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.atoll-detail__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.atoll-detail__name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.atoll-detail__local {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.atoll-detail__tier {
    flex-shrink: 0;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-dark, #005f6b);
}

.atoll-detail__tier--remote {
    background: rgba(225, 29, 72, 0.1);
    color: #be123c;
}

.atoll-detail__tier--long {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.atoll-detail__tier--easy {
    background: rgba(13, 148, 136, 0.12);
    color: var(--accent-dark, #005f6b);
}

.atoll-detail__tier--short {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.atoll-detail__time {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-rgb), 0.04));
    margin-bottom: 1.1rem;
}

.atoll-detail__minutes {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--accent-dark, #005f6b);
}

.atoll-detail__time-label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.atoll-detail__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
    margin-bottom: 1.1rem;
}

.atoll-detail__facts dt {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.atoll-detail__facts dd {
    margin: 0.15rem 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.atoll-detail__hint {
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.atoll-detail__link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent, #0d9488);
    text-decoration: none;
}

.atoll-detail__link:hover {
    text-decoration: underline;
}

/* Code value in the detail panel facts. */
#atollDetailCode {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent-dark, #005f6b);
}

/* ─── The code guide ────────────────────────────────────────── */
.atoll-codeguide__panel {
    padding: 2rem 1.5rem;
    border-radius: var(--card-radius);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.atoll-codeguide__panel .section-label {
    margin-bottom: 0.5rem;
}

.atoll-codeguide__examples {
    margin-top: 1.25rem;
}

.atoll-codeguide__example {
    display: grid;
    gap: 0.15rem;
    min-width: 180px;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border-light);
    text-align: left;
}

.atoll-codeguide__code {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent-dark, #005f6b);
}

.atoll-codeguide__atoll {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.atoll-codeguide__reading {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Code chip inside the list rows ────────────────────────── */
.atoll-table__code {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.1);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--accent-dark, #005f6b);
}

/* Wide fact row (gateway island) spans both columns on mobile. */
@media (max-width: 767.98px) {
    .atoll-detail__facts-wide {
        grid-column: 1 / -1;
    }
}

/* ─── The list ──────────────────────────────────────────────── */
.atoll-list {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.04) 0%, rgba(255, 255, 255, 0) 100%);
}

.atoll-table-wrap {
    border-radius: var(--card-radius);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.atoll-table {
    margin-bottom: 0;
}

.atoll-table thead th {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(var(--accent-rgb), 0.05);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.atoll-table tbody tr {
    scroll-margin-top: 110px;
    transition: background 0.2s ease;
}

.atoll-table tbody tr:not(.atoll-table__group):hover {
    background: rgba(var(--accent-rgb), 0.04);
}

.atoll-table tbody th,
.atoll-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Quiet region divider — the three regions of the single table.
   Scoped through `.atoll-table` so it outranks the shared
   `.atoll-table tbody th` cell padding. */
.atoll-table .atoll-table__group th {
    padding: 0.7rem 1.25rem;
    background: rgba(var(--accent-rgb), 0.06);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--accent-dark, #005f6b);
    scroll-margin-top: 110px;
}

/* No stray rule under the final row of each region */
.atoll-table tbody tr:last-child th,
.atoll-table tbody tr:last-child td {
    border-bottom: 0;
}

.atoll-table__atoll {
    min-width: 210px;
}

.atoll-table__name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.atoll-table__local {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.atoll-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--accent-dark, #005f6b);
    white-space: nowrap;
}

/* Journey-band dot in front of the time — same colours as the filter
   chips and the map dots. */
.atoll-tierdot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.atoll-tierdot--short  { background: #2563eb; }
.atoll-tierdot--easy   { background: #0d9488; }
.atoll-tierdot--long   { background: #d97706; }
.atoll-tierdot--remote { background: #e11d48; }

/* Rows double as map selectors — same hand cursor as the dots. */
.atoll-table tbody tr[data-slug] {
    cursor: pointer;
}

/* Highlighted when selected from the map (and still when reached from a
   stay card: /atoll-distances#<atoll>). */
.atoll-table tbody tr.is-selected,
.atoll-table tbody tr:target {
    background: rgba(var(--accent-rgb), 0.1);
}

/* Rows outside the active journey-band filter. */
.atoll-table tbody tr.is-dimmed {
    opacity: 0.3;
}

/* ─── Closing CTA ───────────────────────────────────────────── */
.atoll-cta__panel {
    background: linear-gradient(135deg, #0d9488 0%, #0369a1 60%, #0ea5e9 100%);
    box-shadow: 0 18px 42px rgba(0, 60, 100, 0.22);
}

.atoll-cta__panel .section-label {
    margin-bottom: 0.75rem;
}

.atoll-cta__panel .text-white-75 {
    color: rgba(255, 255, 255, 0.82);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (min-width: 992px) {
    .atoll-explorer__grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }

    .atoll-map {
        max-height: none;
    }

    /* Room for names on wide screens — the whole chain is visible. */
    .atoll-dot__label {
        opacity: 1;
    }
}

@media (max-width: 991.98px) {
    .atoll-table__atoll {
        min-width: 170px;
    }
}

@media (max-width: 767.98px) {
    .atoll-table thead th {
        padding: 0.7rem 0.85rem;
    }

    .atoll-table tbody th,
    .atoll-table tbody td {
        padding: 0.85rem;
    }

    .atoll-table__atoll {
        min-width: 150px;
    }

    .atoll-time {
        font-size: 1rem;
    }

    .atoll-cta__panel {
        padding: 2rem 1.25rem !important;
    }

    .atoll-stat {
        min-width: calc(50% - 0.75rem);
        flex: 1 1 calc(50% - 0.75rem);
        padding: 0.75rem 1rem;
    }

    .atoll-detail {
        padding: 1.15rem;
    }

    .atoll-detail__facts {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atoll-table tbody tr {
        transition: none;
    }

    .atoll-chip,
    .atoll-dot__core,
    .atoll-dot__halo,
    .atoll-dot__label,
    .atoll-map__boat {
        transition: none;
    }

    .atoll-map__boat-pulse {
        animation: none;
    }
}
