/* ── Single profile: photo gallery + lightbox ─────────────────────────────────
   Loaded only on single escort pages. Measurements follow the design kit's
   profile media strip (js/components/profile.js): 240×280 cards in a swipeable
   strip on mobile, a 5-column grid with every photo on desktop, and a dark
   full-screen lightbox.

   Written as plain component CSS on the design tokens rather than Tailwind
   utilities: this sits inside Bootstrap's .container/.row on a legacy template,
   and self-contained class names cannot collide with Bootstrap or style.css.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Scoped reset ─────────────────────────────────────────────────────────────
   Zero-specificity, like navbar.css, so it never outranks the rules below. */
:where(.evas-gallery, .evas-lightbox),
:where(.evas-gallery, .evas-lightbox) *,
:where(.evas-gallery, .evas-lightbox) *::before,
:where(.evas-gallery, .evas-lightbox) *::after {
    box-sizing: border-box;
}

:where(.evas-lightbox) button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Gallery: mobile strip ────────────────────────────────────────────────── */

.evas-gallery {
    /* Bleed past the Bootstrap column padding so the strip runs edge to edge
       on phones, like the design kit. Undone on desktop below. */
    margin-left: -15px;
    margin-right: -15px;
}

.evas-gallery__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 4px;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.evas-gallery__track::-webkit-scrollbar {
    display: none;
}

.evas-gallery__item {
    position: relative;
    display: block;
    flex: 0 0 240px;
    height: 280px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--brand-card);
    scroll-snap-align: start;
    cursor: zoom-in;
    transition: border-color .2s ease, transform .25s ease-out, box-shadow .25s ease;
}

.evas-gallery__item img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    /* Profile photos are portraits; keep faces in frame when cropping. */
    object-position: top;
    transition: transform .4s ease;
}

.evas-gallery__item:hover,
.evas-gallery__item:focus-visible {
    border-color: rgb(var(--brand-purpleL-rgb) / .55);
    outline: none;
}

.evas-gallery__item:hover img {
    transform: scale(1.04);
}

/* The photo last viewed in the lightbox, as in the design kit. */
.evas-gallery__item.is-active {
    border-color: var(--brand-purple);
}

/* ── Gallery: strip controls for mouse users ──────────────────────────────────
   The strip is a touch pattern. On a computer with a narrow window there is no
   swipe, and the scrollbar is hidden above, so the extra photos were
   unreachable. For fine pointers only: page-by-page arrows plus a thin
   scrollbar. Touch devices keep the design kit's clean swipe strip. */

.evas-gallery {
    position: relative;
}

.evas-gallery__nav {
    display: none;
}

@media (hover: hover) and (pointer: fine) and (max-width: 1023.98px) {
    .evas-gallery__nav {
        position: absolute;
        top: 50%;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: 1px solid rgb(var(--brand-purpleL-rgb) / .25);
        border-radius: 50%;
        background: rgb(29 24 35 / .85);
        color: var(--brand-purpleL);
        box-shadow: 0 6px 18px rgb(0 0 0 / .45);
        cursor: pointer;
        transform: translateY(-50%);
        transition: background .2s ease, border-color .2s ease;
    }

    .evas-gallery__nav[hidden] {
        display: none;
    }

    .evas-gallery__nav:hover {
        background: rgb(var(--brand-purple-rgb) / .45);
        border-color: rgb(var(--brand-purpleL-rgb) / .55);
    }

    .evas-gallery__nav:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px var(--brand-purpleL);
    }

    .evas-gallery__nav--prev {
        left: 10px;
    }

    .evas-gallery__nav--next {
        right: 10px;
    }

    /* A visible (thin) scrollbar is the other affordance, and lets trackpad
       and Shift+wheel users see where they are. */
    .evas-gallery__track {
        padding-bottom: 10px;
        scrollbar-width: thin;
        scrollbar-color: rgb(var(--brand-purpleL-rgb) / .35) transparent;
    }

    .evas-gallery__track::-webkit-scrollbar {
        display: block;
        height: 6px;
    }

    .evas-gallery__track::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background: rgb(var(--brand-purpleL-rgb) / .35);
    }
}

/* ── Gallery: desktop grid ────────────────────────────────────────────────── */

@media (min-width: 1024px) {
    .evas-gallery {
        margin-left: 0;
        margin-right: 0;
    }

    /* Every photo is shown: the grid simply wraps onto as many rows as needed. */
    .evas-gallery__track {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
        overflow: visible;
        padding: 0;
        scroll-snap-type: none;
    }

    .evas-gallery__item {
        flex: none;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    .evas-gallery__item:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgb(var(--brand-purple-rgb) / .3);
    }
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.evas-lightbox {
    position: fixed;
    inset: 0;
    /* Above the navbar (50), the "Elige" side panel (200) and the sticky
       WhatsApp button. */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / .92);
}

.evas-lightbox[hidden] {
    display: none;
}

.evas-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 64px 64px 56px;
}

.evas-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transition: opacity .2s ease;
}

.evas-lightbox__img.is-loaded {
    opacity: 1;
}

.evas-lightbox__btn {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgb(var(--brand-purpleL-rgb) / .2);
    border-radius: 50%;
    background: rgb(29 24 35 / .8);
    color: var(--brand-purpleL);
    transition: background .2s ease, border-color .2s ease;
}

.evas-lightbox__btn:hover {
    background: rgb(var(--brand-purple-rgb) / .35);
    border-color: rgb(var(--brand-purpleL-rgb) / .5);
}

.evas-lightbox__btn:focus-visible,
.evas-lightbox__dot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--brand-purpleL);
}

.evas-lightbox__close {
    top: 16px;
    right: 16px;
}

.evas-lightbox__prev,
.evas-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
}

.evas-lightbox__prev {
    left: 12px;
}

.evas-lightbox__next {
    right: 12px;
}

.evas-lightbox__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
}

.evas-lightbox__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--brand-purpleL-rgb) / .3);
    transition: background .2s ease, transform .2s ease;
}

.evas-lightbox__dot.is-current {
    background: var(--brand-purpleL);
    transform: scale(1.25);
}

/* Used instead of dots once a profile has too many photos for a dot row. */
.evas-lightbox__counter {
    font-family: 'BDO Grotesk', sans-serif;
    font-size: 13px;
    letter-spacing: .5px;
    color: var(--brand-muted);
}

/* One photo: nothing to navigate. */
.evas-lightbox.is-single .evas-lightbox__prev,
.evas-lightbox.is-single .evas-lightbox__next,
.evas-lightbox.is-single .evas-lightbox__dots {
    display: none;
}

/* Phones: swipe is the main control, so give the photo the full width and let
   the arrow buttons sit over its edges. */
@media (max-width: 640px) {
    .evas-lightbox__stage {
        padding: 64px 8px 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .evas-gallery__item,
    .evas-gallery__item img,
    .evas-lightbox__img,
    .evas-lightbox__dot {
        transition: none;
    }

    .evas-gallery__item:hover,
    .evas-gallery__item:hover img {
        transform: none;
    }
}
