/* ── Dive Sites page ─────────────────────────────────────────── */

/* Intro / section body text */
.ba-ds-intro .ba-section__body,
.ba-ds-map .ba-section__body,
.ba-ds-explore .ba-section__body {
    max-width: 62ch;
    line-height: 1.75;
    color: var(--color-text-muted);
}

/* ── Map ─────────────────────────────────────────────────────── */
.ba-ds-map {
    background: var(--gradient-ocean);
}

.ba-ds-map .ba-section__body {
    color: var(--color-text-light);
}

.ba-ds-map__frame {
    position: relative;
    max-width: 900px;
    margin: 2rem auto 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.ba-ds-map__img {
    display: block;
    width: 100%;
    height: auto;
}

/* Diver-down red for the map flags */
.ba-ds-map {
    --ba-ds-flag-red: #EE1C25;
}

/* ── Clickable dive flags ────────────────────────────────────────────────── */

/* Positioned by the inline left/top percentages on each marker */
.ba-ds-map__spot {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transform: translate(-50%, -50%);
}

/* x/y positions the flag, so each variant offsets the label box around it */
.ba-ds-map__spot--below {
    flex-direction: column;
    transform: translate(-50%, calc(-50% + 12px));
}

.ba-ds-map__spot--left {
    flex-direction: row-reverse;
    transform: translate(calc(-100% + 22px), -50%);
}

.ba-ds-map__spot:hover .ba-ds-map__flag,
.ba-ds-map__spot:focus-visible .ba-ds-map__flag {
    transform: scale(1.15);
}

.ba-ds-map__spot:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Red-and-white dive flag on a short pole */
.ba-ds-map__flag {
    position: relative;
    display: block;
    width: 20px;
    height: 15px;
    flex-shrink: 0;
    /* White stripe runs top-left → bottom-right, so the gradient axis (which is
       perpendicular to the bands) points to the top-right corner. */
    background: linear-gradient(
        to top right,
        var(--ba-ds-flag-red) 0 36%,
        #ffffff 36% 64%,
        var(--ba-ds-flag-red) 64% 100%
    );
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

/* Pole */
.ba-ds-map__flag::before {
    content: "";
    position: absolute;
    top: 0;
    left: -2px;
    width: 2px;
    height: 24px;
    border-radius: 2px;
    background: var(--color-dark);
}

/* The halo disc and its pulsing ring were removed: five circles breathing
   around the map flags drew more attention than the flags themselves. The
   markers now read as flags on a map, and the drop shadow above keeps them
   legible over both the sea and the land. */

/* ── Labels ──────────────────────────────────────────────────────────────── */

.ba-ds-map__name,
.ba-ds-map__place {
    font-family: var(--font-base);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
    white-space: nowrap;
    color: #ffffff;
    text-shadow:
        0 1px 0 rgba(31, 41, 51, 0.85),
        0 0 6px rgba(31, 41, 51, 0.55);
}

.ba-ds-map__name {
    font-size: clamp(0.6rem, 1.35vw, 0.95rem);
}

.ba-ds-map__place {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ba-ds-map__place--lg {
    font-size: clamp(0.7rem, 1.8vw, 1.3rem);
    letter-spacing: 0.06em;
}

.ba-ds-map__place--sm {
    font-size: clamp(0.55rem, 1.25vw, 0.9rem);
    color: rgba(255, 255, 255, 0.9);
}

/* ── Our shop — the header logo dropped onto Nakijin ─────────────────────── */

.ba-ds-map__shop {
    position: absolute;
    width: clamp(42px, 8%, 96px);
    height: auto;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* ── Map popup ───────────────────────────────────────────────── */
.ba-ds-modal {
    width: min(92vw, 720px);
    padding: 0;
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.ba-ds-modal::backdrop {
    background: rgba(12, 52, 97, 0.7);
    backdrop-filter: blur(3px);
}

.ba-ds-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    transition: background 0.2s ease;
}

.ba-ds-modal__close:hover {
    background: var(--color-primary);
}

.ba-ds-modal__video {
    aspect-ratio: 9 / 16;
    max-height: 55vh;
    margin: 0 auto;
    background: var(--color-dark);
}

.ba-ds-modal__video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.ba-ds-modal__body {
    padding: 1.5rem;
}

.ba-ds-modal__title {
    margin: 0.85rem 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.ba-ds-modal__desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.ba-ds-modal__caption {
    margin-bottom: 0;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-muted);
}

/* Tablet+ — video beside text inside the popup */
@media (min-width: 768px) {
    .ba-ds-modal {
        width: min(92vw, 760px);
    }

    .ba-ds-modal[open] {
        display: grid;
        grid-template-columns: 280px 1fr;
    }

    .ba-ds-modal__video {
        aspect-ratio: auto;
        max-height: none;
        height: 100%;
        min-height: 480px;
    }

    .ba-ds-modal__body {
        align-self: center;
        padding: 2rem;
    }
}

/* ── Explore — alternating site rows ─────────────────────────── */
.ba-ds-site {
    display: grid;
    gap: 1.75rem;
    align-items: center;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-surface-alt);
    scroll-margin-top: calc(var(--ba-header-h) + 1rem);
}

/* Vertical (Shorts) video — 9:16, card-style frame */
.ba-ds-site__video {
    justify-self: center;
    width: min(100%, 300px);
    aspect-ratio: 9 / 16;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--color-dark);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.ba-ds-site__video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.ba-ds-site__title {
    margin: 1rem 0 0.75rem;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
}

.ba-ds-site__desc {
    max-width: 55ch;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.ba-ds-site__caption {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    max-width: 55ch;
    margin-bottom: 0;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-muted);
}

.ba-ds-site__caption .bi {
    color: var(--color-primary);
}

/* Articles about this area — the reverse direction of the /dive-sites/#anchor
   links those posts already carry, so each site and its guide point at each
   other instead of the blog being a one-way dead end. */
.ba-ds-site__reads {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.ba-ds-site__read {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-primary);
    text-decoration: none;
}

.ba-ds-site__read .bi {
    flex: none;
    font-size: 1rem;
}

.ba-ds-site__read span {
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.ba-ds-site__read:hover span,
.ba-ds-site__read:focus-visible span {
    border-bottom-color: currentColor;
}

/* Tablet+ — video and text side by side, alternating */
@media (min-width: 768px) {
    .ba-ds-site {
        grid-template-columns: 320px 1fr;
        gap: 3rem;
    }

    .ba-ds-site--flip .ba-ds-site__video { order: 2; }
    .ba-ds-site--flip .ba-ds-site__body  { order: 1; justify-self: end; text-align: right; }
    .ba-ds-site--flip .ba-ds-site__reads { align-items: flex-end; }
    .ba-ds-site--flip .ba-ds-site__desc,
    .ba-ds-site--flip .ba-ds-site__caption { margin-left: auto; }
    .ba-ds-site--flip .ba-ds-site__caption { flex-direction: row-reverse; }
}

@media (min-width: 992px) {
    .ba-ds-site { gap: 4.5rem; }
}
