/*
 * Galería horizontal cinematográfica — José Ramones
 * Mantiene el lenguaje visual de [jr_cinematic_hero].
 */

.jrh-gallery,
.jrh-gallery * {
    box-sizing: border-box;
}

.jrh-gallery {
    --jrh-blue: #1664d6;
    --jrh-black: #07090c;
    --jrh-charcoal: #191919;
    --jrh-gray: #d1d1d1;
    --jrh-white: #ffffff;
    --jrh-line: rgba(255, 255, 255, 0.1);
    --jrh-progress: 0;
    --jrh-stage-height: 100svh;

    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    overflow: clip;
    isolation: isolate;
    color: var(--jrh-white);
    background: var(--jrh-black);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jrh-gallery img {
    display: block;
}

.jrh-gallery figure,
.jrh-gallery h2,
.jrh-gallery h3,
.jrh-gallery p {
    margin-top: 0;
}

.jrh-gallery__stage {
    position: relative;
    width: 100%;
    height: var(--jrh-stage-height);
    min-height: 590px;
    overflow: hidden;
    background: var(--jrh-black);
}

.jrh-gallery__background,
.jrh-gallery__grid,
.jrh-gallery__vignette,
.jrh-gallery__grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.jrh-gallery__background {
    z-index: 0;
    background:
        radial-gradient(circle at 72% 34%, rgba(22, 100, 214, 0.23), transparent 34%),
        radial-gradient(circle at 15% 78%, rgba(255, 255, 255, 0.06), transparent 31%),
        linear-gradient(135deg, #07090c 0%, #10141b 46%, #07090c 100%);
    transform: scale(1.06);
    will-change: transform;
}

.jrh-gallery__background::before,
.jrh-gallery__background::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.jrh-gallery__background::before {
    top: -42vh;
    right: -18vw;
    width: min(72vw, 1050px);
    aspect-ratio: 1;
}

.jrh-gallery__background::after {
    bottom: -30vh;
    left: -13vw;
    width: min(42vw, 620px);
    aspect-ratio: 1;
}

.jrh-gallery__grid {
    z-index: 1;
    opacity: 0.2;
    background:
        linear-gradient(
            90deg,
            transparent 24.9%,
            rgba(255, 255, 255, 0.032) 25%,
            transparent 25.1%,
            transparent 49.9%,
            rgba(255, 255, 255, 0.032) 50%,
            transparent 50.1%,
            transparent 74.9%,
            rgba(255, 255, 255, 0.032) 75%,
            transparent 75.1%
        );
    mask-image: linear-gradient(to bottom, transparent, black 13%, black 88%, transparent);
}

.jrh-gallery__vignette {
    z-index: 7;
    background:
        linear-gradient(90deg, rgba(7, 9, 12, 0.64) 0%, transparent 27%, transparent 78%, rgba(7, 9, 12, 0.3) 100%),
        linear-gradient(0deg, rgba(7, 9, 12, 0.76) 0%, transparent 31%, rgba(7, 9, 12, 0.12) 100%);
}

.jrh-gallery__grain {
    z-index: 8;
    opacity: 0.1;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.45'/%3E%3C/svg%3E");
}

.jrh-gallery__status {
    position: absolute;
    z-index: 22;
    top: clamp(28px, 4.2vw, 60px);
    right: clamp(22px, 5vw, 72px);
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--jrh-white);
    font: 700 11px/1 system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    pointer-events: none;
}

.jrh-gallery__status i {
    display: block;
    width: 38px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}

.jrh-gallery__intro {
    position: absolute;
    z-index: 15;
    top: clamp(82px, 11vh, 132px);
    left: clamp(22px, 6vw, 92px);
    width: min(760px, 58vw);
    pointer-events: none;
    will-change: opacity, transform;
}

.jrh-gallery__eyebrow {
    margin: 0 0 20px !important;
    color: var(--jrh-gray) !important;
    font: 750 clamp(11px, 1vw, 14px)/1.2 system-ui, sans-serif !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase;
}

.jrh-gallery .jrh-gallery__title {
    max-width: 780px;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--jrh-white) !important;
    font: 900 clamp(52px, 6.5vw, 108px)/0.84 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: -0.075em !important;
    text-wrap: balance;
    text-shadow: 0 12px 45px rgba(0, 0, 0, 0.38);
}

.jrh-gallery__description {
    width: min(570px, 90%);
    margin: 28px 0 0 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font: 450 clamp(15px, 1.35vw, 20px)/1.55 system-ui, sans-serif !important;
}

.jrh-gallery__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.52);
    font: 700 10px/1 system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.jrh-gallery__window {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: clamp(145px, 18vh, 195px);
    padding-bottom: clamp(106px, 14vh, 145px);
}

.jrh-gallery__track {
    display: flex;
    width: max-content;
    min-width: max-content;
    align-items: center;
    gap: clamp(16px, 1.25vw, 24px);
    padding-right: clamp(50px, 8vw, 130px);
    padding-left: clamp(22px, 6vw, 92px);
    will-change: transform;
}

.jrh-gallery__track::before {
    flex: 0 0 clamp(560px, 53vw, 920px);
    content: "";
}

.jrh-gallery__card {
    --jrh-focus-x: 50%;
    --jrh-focus-y: 50%;

    position: relative;
    flex: 0 0 auto;
    width: clamp(270px, 25vw, 390px);
    height: clamp(360px, calc(var(--jrh-stage-height) - 260px), 610px);
    min-height: 360px;
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: #0d1117;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.24);
    transition: border-color 260ms ease, box-shadow 260ms ease;
    will-change: transform;
}

.jrh-gallery__card--wide {
    width: clamp(390px, 38vw, 610px);
}

.jrh-gallery__card--narrow {
    width: clamp(245px, 22vw, 330px);
}

.jrh-gallery__card:hover {
    border-color: rgba(22, 100, 214, 0.78);
    box-shadow: 0 32px 95px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(22, 100, 214, 0.14);
}

.jrh-gallery__media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.jrh-gallery .jrh-gallery__media img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: var(--jrh-focus-x) var(--jrh-focus-y) !important;
    filter: saturate(0.86) contrast(1.06) brightness(0.78);
    transform: scale(1.015);
    transition: transform 750ms cubic-bezier(0.22, 1, 0.36, 1), filter 380ms ease;
}

.jrh-gallery__card:hover .jrh-gallery__media img {
    transform: scale(1.07);
    filter: saturate(1) contrast(1.04) brightness(0.94);
}

.jrh-gallery__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(7, 9, 12, 0.03) 0%, rgba(7, 9, 12, 0.03) 45%, rgba(7, 9, 12, 0.5) 72%, rgba(7, 9, 12, 0.97) 100%),
        linear-gradient(135deg, rgba(22, 100, 214, 0.15), transparent 42%);
}

.jrh-gallery__card::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    height: 3px;
    background: linear-gradient(90deg, var(--jrh-blue), #5b9cff, transparent);
    content: "";
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.jrh-gallery__card:hover::after {
    transform: scaleX(1);
}

.jrh-gallery__caption {
    position: absolute;
    right: clamp(20px, 2vw, 30px);
    bottom: clamp(24px, 3.4vh, 38px);
    left: clamp(20px, 2vw, 30px);
    z-index: 4;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.jrh-gallery__number {
    display: block;
    margin-bottom: 11px;
    color: rgba(255, 255, 255, 0.62);
    font: 750 11px/1 system-ui, sans-serif;
    letter-spacing: 0.2em;
}

.jrh-gallery .jrh-gallery__caption h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--jrh-white) !important;
    font: 900 clamp(27px, 2.55vw, 43px)/0.92 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: -0.055em !important;
    text-shadow: 0 5px 24px rgba(0, 0, 0, 0.58);
}

.jrh-gallery__caption p {
    max-width: 330px;
    margin: 11px 0 0 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font: 450 13px/1.45 system-ui, sans-serif !important;
}

.jrh-gallery__progress {
    position: absolute;
    z-index: 21;
    right: clamp(22px, 6vw, 92px);
    bottom: clamp(68px, 8.5vh, 94px);
    left: clamp(22px, 6vw, 92px);
    height: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.11);
    pointer-events: none;
}

.jrh-gallery__progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--jrh-blue), #5b9cff, #ffffff);
    transform: scaleX(var(--jrh-progress));
    transform-origin: left center;
    box-shadow: 0 0 18px rgba(22, 100, 214, 0.42);
}

.jrh-gallery__scroll-indicator {
    position: absolute;
    z-index: 22;
    left: clamp(22px, 6vw, 92px);
    bottom: clamp(22px, 4vw, 52px);
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--jrh-white);
    font: 750 10px/1 system-ui, sans-serif;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    pointer-events: none;
}

.jrh-gallery__scroll-indicator i {
    position: relative;
    display: block;
    width: 72px;
    height: 1px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.18);
}

.jrh-gallery__scroll-indicator i::after {
    position: absolute;
    inset: 0;
    background: var(--jrh-blue);
    content: "";
    transform: translateX(-100%);
    animation: jrh-scroll-line 1.8s ease-in-out infinite;
}

@keyframes jrh-scroll-line {
    0% {
        transform: translateX(-100%);
    }

    45%,
    55% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

.jrh-gallery__mobile-instruction {
    display: none;
}

@media (max-width: 980px) {
    .jrh-gallery__stage {
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 90px 0 76px;
    }

    .jrh-gallery__status {
        display: none;
    }

    .jrh-gallery__intro {
        position: relative;
        top: auto;
        left: auto;
        width: min(calc(100% - 40px), 760px);
        margin: 0 auto 42px;
        pointer-events: auto;
        opacity: 1 !important;
        transform: none !important;
    }

    .jrh-gallery__window {
        position: relative;
        inset: auto;
        display: block;
        overflow: visible;
        padding: 0;
    }

    .jrh-gallery__track {
        width: auto;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 16px;
        padding: 0 20px 14px;
        scroll-padding-left: 20px;
        scroll-snap-type: x mandatory;
        transform: none !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    }

    .jrh-gallery__track::before {
        display: none;
    }

    .jrh-gallery__track::-webkit-scrollbar {
        height: 6px;
    }

    .jrh-gallery__track::-webkit-scrollbar-track {
        background: transparent;
    }

    .jrh-gallery__track::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.22);
    }

    .jrh-gallery__card,
    .jrh-gallery__card--wide,
    .jrh-gallery__card--narrow {
        width: min(78vw, 440px);
        height: min(118vw, 590px);
        min-height: 430px;
        scroll-snap-align: start;
        transform: none !important;
    }

    .jrh-gallery__progress {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        width: min(calc(100% - 40px), 900px);
        margin: 22px auto 0;
    }

    .jrh-gallery__scroll-indicator {
        position: relative;
        left: auto;
        bottom: auto;
        width: min(calc(100% - 40px), 900px);
        margin: 17px auto 0;
    }

    .jrh-gallery__mobile-instruction {
        display: block;
        width: min(calc(100% - 40px), 900px);
        margin: 12px auto 0;
        color: rgba(255, 255, 255, 0.46);
        font: 700 9px/1.3 system-ui, sans-serif;
        letter-spacing: 0.16em;
        text-transform: uppercase;
    }

    .jrh-gallery__grid {
        display: none;
    }
}

@media (max-width: 560px) {
    .jrh-gallery__stage {
        padding-top: 76px;
    }

    .jrh-gallery__intro {
        width: calc(100% - 28px);
        margin-bottom: 32px;
    }

    .jrh-gallery .jrh-gallery__title {
        font-size: clamp(45px, 14.5vw, 68px) !important;
    }

    .jrh-gallery__eyebrow {
        margin-bottom: 15px !important;
        font-size: 9px !important;
    }

    .jrh-gallery__description {
        margin-top: 18px !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    .jrh-gallery__meta {
        gap: 9px 16px;
        font-size: 8px;
    }

    .jrh-gallery__track {
        padding-right: 14px;
        padding-left: 14px;
        scroll-padding-left: 14px;
    }

    .jrh-gallery__card,
    .jrh-gallery__card--wide,
    .jrh-gallery__card--narrow {
        width: 84vw;
        height: 122vw;
        min-height: 430px;
    }

    .jrh-gallery__caption {
        right: 20px;
        bottom: 25px;
        left: 20px;
    }

    .jrh-gallery .jrh-gallery__caption h3 {
        font-size: clamp(29px, 9vw, 42px) !important;
    }

    .jrh-gallery__caption p {
        display: none;
    }

    .jrh-gallery__progress,
    .jrh-gallery__scroll-indicator,
    .jrh-gallery__mobile-instruction {
        width: calc(100% - 28px);
    }
}

@media (hover: none), (pointer: coarse) {
    .jrh-gallery__card:hover {
        border-color: rgba(255, 255, 255, 0.13);
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.24);
    }

    .jrh-gallery__card:hover .jrh-gallery__media img {
        transform: scale(1.015);
        filter: saturate(0.86) contrast(1.06) brightness(0.78);
    }
}

@media (prefers-reduced-motion: reduce) {
    .jrh-gallery *,
    .jrh-gallery *::before,
    .jrh-gallery *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .jrh-gallery__stage {
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 90px 0 76px;
    }

    .jrh-gallery__intro {
        position: relative;
        top: auto;
        left: auto;
        width: min(calc(100% - 40px), 760px);
        margin: 0 auto 42px;
        opacity: 1 !important;
        transform: none !important;
    }

    .jrh-gallery__window {
        position: relative;
        inset: auto;
        padding: 0;
    }

    .jrh-gallery__track {
        width: auto;
        min-width: 0;
        overflow-x: auto;
        padding: 0 20px 14px;
        transform: none !important;
    }

    .jrh-gallery__track::before {
        display: none;
    }

    .jrh-gallery__card {
        transform: none !important;
    }

    .jrh-gallery__progress,
    .jrh-gallery__scroll-indicator {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        width: min(calc(100% - 40px), 900px);
        margin: 20px auto 0;
    }
}
