
/* =========================================================
   GALERÍA LUXURY · MI HISTORIA
========================================================= */

/* El caption original ahora funciona como botón */
.gallery-launch {
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        background .25s ease;
}

.gallery-launch:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(37,40,26,.20);
}

.gallery-launch small {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(75,79,53,.18);
    color: var(--olive-dark, #636742);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-launch small b {
    font-size: 16px;
    line-height: 1;
}

/* Modal */
.story-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
}

.story-gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.story-gallery-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(138,141,94,.16), transparent 33%),
        rgba(44,47,31,.97);
    backdrop-filter: blur(16px);
}

.story-gallery-shell {
    position: relative;
    z-index: 2;
    width: min(1420px, 96vw);
    height: min(900px, 92vh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 18px;
    padding: 26px 30px 22px;
    overflow: hidden;
    background: #f5f1e6;
    box-shadow: 0 40px 120px rgba(0,0,0,.38);
    transform: translateY(22px) scale(.985);
    transition: transform .38s cubic-bezier(.2,.8,.2,1);
}

.story-gallery-modal.is-open .story-gallery-shell {
    transform: translateY(0) scale(1);
}

.story-gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(75,79,53,.16);
}

.story-gallery-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #8a8d5e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .17em;
}

.story-gallery-header h2 {
    margin: 0;
    color: #4b4f35;
    font-size: clamp(28px, 3.5vw, 52px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
}

.story-gallery-close {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(75,79,53,.22);
    background: transparent;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.story-gallery-close:hover {
    background: #e8e4d7;
    transform: rotate(3deg);
}

.story-gallery-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 21px;
    height: 1.5px;
    background: #4b4f35;
}

.story-gallery-close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.story-gallery-close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.story-gallery-stage {
    min-height: 0;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    gap: 16px;
    align-items: center;
}

.story-gallery-main {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    background: #dad5c6;
}

.story-gallery-main::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.story-gallery-main img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    display: block;
    object-fit: contain;
    background: #d8d3c5;
    transition: opacity .18s ease, transform .45s ease;
}

.story-gallery-main img.is-changing {
    opacity: 0;
    transform: scale(.99);
}

.story-gallery-main figcaption {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding: 13px 15px;
    color: #fff;
    background: linear-gradient(90deg, rgba(44,47,31,.88), rgba(44,47,31,.36));
    backdrop-filter: blur(8px);
}

.story-gallery-main figcaption span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.story-gallery-main figcaption strong {
    font-size: 12px;
    font-weight: 600;
}

.story-gallery-nav {
    width: 56px;
    height: 76px;
    border: 1px solid rgba(75,79,53,.18);
    background: transparent;
    color: #4b4f35;
    font-size: 43px;
    font-weight: 300;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.story-gallery-nav:hover {
    background: #8a8d5e;
    color: #fff;
}

.story-gallery-prev:hover {
    transform: translateX(-3px);
}

.story-gallery-next:hover {
    transform: translateX(3px);
}

/* Tira de miniaturas */
.story-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(60, minmax(64px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: thin;
}

.story-gallery-thumb {
    position: relative;
    min-width: 72px;
    height: 78px;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: #d8d3c5;
    cursor: pointer;
    opacity: .54;
    transition:
        opacity .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.story-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
}

.story-gallery-thumb:hover {
    opacity: .86;
    transform: translateY(-2px);
}

.story-gallery-thumb.active {
    opacity: 1;
    box-shadow: 0 9px 22px rgba(75,79,53,.16);
}

.story-gallery-thumb.active::after {
    border-color: #8a8d5e;
}

.story-gallery-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding-top: 4px;
    color: #757767;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

body.gallery-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .story-gallery-modal {
        padding: 14px;
    }

    .story-gallery-shell {
        width: 100%;
        height: 94vh;
        padding: 20px 18px 17px;
    }

    .story-gallery-stage {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .story-gallery-nav {
        width: 40px;
        height: 62px;
        font-size: 34px;
    }

    .story-gallery-thumbs {
        grid-template-columns: repeat(60, 76px);
    }
}

@media (max-width: 620px) {
    .story-gallery-modal {
        padding: 0;
    }

    .story-gallery-shell {
        width: 100vw;
        height: 100dvh;
        padding: 18px 12px 15px;
    }

    .story-gallery-header h2 {
        font-size: 27px;
    }

    .story-gallery-eyebrow {
        font-size: 8px;
    }

    .story-gallery-close {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .story-gallery-stage {
        grid-template-columns: 1fr;
        position: relative;
    }

    .story-gallery-main img {
        min-height: 300px;
    }

    .story-gallery-nav {
        position: absolute;
        top: 50%;
        z-index: 4;
        width: 42px;
        height: 58px;
        transform: translateY(-50%);
        border-color: rgba(255,255,255,.28);
        background: rgba(44,47,31,.52);
        color: #fff;
        backdrop-filter: blur(7px);
    }

    .story-gallery-prev {
        left: 7px;
    }

    .story-gallery-next {
        right: 7px;
    }

    .story-gallery-prev:hover,
    .story-gallery-next:hover {
        transform: translateY(-50%);
    }

    .story-gallery-main figcaption {
        left: 10px;
        right: 10px;
        bottom: 10px;
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .story-gallery-main figcaption strong {
        font-size: 10px;
    }

    .story-gallery-thumbs {
        grid-template-columns: repeat(60, 66px);
        gap: 6px;
    }

    .story-gallery-thumb {
        min-width: 66px;
        height: 66px;
    }

    .story-gallery-footer {
        display: none;
    }
}


/* =========================================================
   GALERÍA · 20 FOTOS
========================================================= */

.story-gallery-thumbs {
    grid-template-columns: repeat(60, minmax(64px, 1fr));
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
}

.story-gallery-thumb {
    scroll-snap-align: center;
}

@media (max-width: 900px) {
    .story-gallery-thumbs {
        grid-template-columns: repeat(60, 76px);
    }
}

@media (max-width: 620px) {
    .story-gallery-thumbs {
        grid-template-columns: repeat(60, 66px);
    }
}
