/* Gallery — image-led editorial experience with restrained 3D depth. */
.gallery-hero {
    position: relative;
    min-height: clamp(35rem, 66vw, 47rem);
    display: grid;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background: #111126;
}

.gallery-hero-media,
.gallery-hero-shade { position: absolute; inset: 0; }

.gallery-hero-media { z-index: -4; }

.gallery-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: galleryHeroReveal 1.6s cubic-bezier(.2,.8,.2,1) both;
}

.gallery-hero-shade {
    z-index: -3;
    background:
        linear-gradient(90deg, rgba(12,10,31,.96) 0%, rgba(17,14,45,.86) 38%, rgba(17,14,45,.34) 69%, rgba(17,14,45,.5) 100%),
        linear-gradient(180deg, rgba(11,11,28,.15), rgba(11,11,28,.73));
}

.gallery-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 8rem;
    z-index: -1;
    background: linear-gradient(transparent, rgba(10,9,26,.34));
    pointer-events: none;
}

.gallery-hero-container {
    position: relative;
    width: 100%;
    padding-block: clamp(7rem, 12vw, 10rem) clamp(5rem, 9vw, 8rem);
}

.gallery-hero-container .breadcrumbs { color: rgba(255,255,255,.72); }

.gallery-hero-copy { position: relative; z-index: 3; width: min(40rem, 55%); }

.gallery-hero-copy h1 {
    max-width: 9ch;
    margin: .8rem 0 1rem;
    color: #fff;
    font-size: clamp(3.6rem, 7.4vw, 7rem);
    letter-spacing: -.065em;
    line-height: .91;
    text-wrap: balance;
}

/* The route manager focuses the heading after navigation; it is not interactive. */
.gallery-hero-copy h1:focus-visible { outline: none; }

.gallery-hero-copy .lead {
    max-width: 35rem;
    color: rgba(255,255,255,.75);
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    line-height: 1.7;
}

.gallery-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: #77d6d5;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.gallery-hero-kicker i { width: 2.5rem; height: 1px; background: currentColor; }

.gallery-hero-stats {
    display: flex;
    gap: .75rem;
    margin-top: 2rem;
}

.gallery-hero-stats span {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    padding: .62rem .9rem;
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(10px);
    font-size: .76rem;
}

.gallery-hero-stats strong { color: #fff; font-size: 1rem; }

.gallery-hero-orbit {
    position: absolute;
    z-index: -2;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    pointer-events: none;
}

.gallery-hero-orbit-a { width: 34rem; height: 34rem; right: -10rem; top: -15rem; }
.gallery-hero-orbit-b { width: 18rem; height: 18rem; right: 29%; bottom: -10rem; }

.gallery-hero-scene {
    position: absolute;
    z-index: 2;
    right: 1.5%;
    bottom: clamp(3rem, 7vw, 6rem);
    width: min(36vw, 31rem);
    height: min(31vw, 25rem);
    perspective: 1200px;
    transform-style: preserve-3d;
    pointer-events: none;
}

.gallery-hero-plane {
    position: absolute;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 1.15rem;
    background: rgba(255,255,255,.13);
    box-shadow: 0 2.3rem 4.5rem rgba(2,2,15,.38);
    transform-style: preserve-3d;
    backdrop-filter: blur(12px);
}

.gallery-hero-plane img { width: 100%; height: 100%; object-fit: cover; }

.gallery-hero-plane-back {
    inset: 6% 5% 27% 14%;
    opacity: .76;
    transform: rotateY(-19deg) rotateZ(8deg) translateZ(-55px);
    animation: galleryCardBack 7s ease-in-out infinite;
}

.gallery-hero-plane-front {
    inset: 25% 13% 2% 0;
    transform: rotateY(-14deg) rotateZ(-4deg) translateZ(55px);
    animation: galleryCardFront 6s ease-in-out infinite;
}

.gallery-hero-plane-front img { height: calc(100% - 3.25rem); }

.gallery-hero-plane figcaption {
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 1rem;
    color: #29233f;
    background: rgba(255,255,255,.94);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-hero-plane figcaption span { color: var(--brand); }

.gallery-catalog { position: relative; overflow: hidden; }

.gallery-catalog::before {
    content: "";
    position: absolute;
    width: 34rem;
    height: 34rem;
    left: -20rem;
    top: 4rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    filter: blur(4rem);
    pointer-events: none;
}

.gallery-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.gallery-section-heading h2 { max-width: 15ch; margin: .5rem 0 1rem; letter-spacing: -.045em; }
.gallery-section-heading p { max-width: 43rem; margin: 0; color: var(--text-muted); line-height: 1.8; }

.gallery-section-number {
    align-self: flex-start;
    color: color-mix(in srgb, var(--brand) 15%, transparent);
    font-family: var(--font-display);
    font-size: clamp(5rem, 10vw, 9rem);
    font-weight: 800;
    line-height: .8;
}

.gallery-album-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.5rem; }

.gallery-album-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: 0 .8rem 2.4rem rgba(17,19,39,.07);
    text-decoration: none;
    transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease, border-color .3s ease;
}

.gallery-album-card:hover {
    transform: translateY(-.55rem);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
    box-shadow: 0 1.8rem 4rem rgba(31,22,54,.14);
}

.gallery-album-card.is-featured { grid-column: span 2; display: grid; grid-template-columns: minmax(0,1.45fr) minmax(18rem,.75fr); }

.gallery-album-cover { position: relative; min-height: 20rem; overflow: hidden; background: var(--surface-2); }
.gallery-album-card.is-featured .gallery-album-cover { min-height: 31rem; }

.gallery-album-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .4s ease;
}

.gallery-album-card:hover .gallery-album-cover img { transform: scale(1.045); filter: saturate(1.05); }

.gallery-album-cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(14,12,31,.34));
    pointer-events: none;
}

.gallery-album-count {
    position: absolute; z-index: 1; top: 1rem; right: 1rem;
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem .7rem; color: #fff; border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px; background: rgba(15,13,34,.56); backdrop-filter: blur(10px);
    font-size: .77rem; font-weight: 700;
}

.gallery-album-placeholder { min-height: 20rem; display: grid; place-items: center; color: var(--text-muted); }
.gallery-album-body { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 3vw, 2.5rem); }
.gallery-album-label { color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.gallery-album-body h2 { margin: .65rem 0 .9rem; color: var(--text); font-size: clamp(1.4rem, 2.2vw, 2.2rem); letter-spacing: -.04em; }
.gallery-album-body p { margin: 0 0 1.5rem; color: var(--text-muted); line-height: 1.7; }
.gallery-album-meta { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .78rem; }
.gallery-album-meta > * + *:not(.gallery-album-arrow)::before { content: "•"; margin-right: .75rem; opacity: .45; }
.gallery-album-arrow { margin-left: auto; width: 2.45rem; height: 2.45rem; display: grid; place-items: center; color: var(--brand); border-radius: 50%; background: color-mix(in srgb, var(--brand) 9%, transparent); transition: transform .3s ease, color .3s ease, background .3s ease; }
.gallery-album-card:hover .gallery-album-arrow { transform: translateX(.25rem); color: #fff; background: var(--brand); }

@keyframes galleryHeroReveal { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes galleryCardFront { 50% { transform: rotateY(-10deg) rotateZ(-2deg) translate3d(0,-.7rem,70px); } }
@keyframes galleryCardBack { 50% { transform: rotateY(-22deg) rotateZ(10deg) translate3d(.5rem,.5rem,-55px); } }

@media (max-width: 980px) {
    .gallery-hero-copy { width: min(38rem, 72%); }
    .gallery-hero-scene { opacity: .55; right: -11%; width: 45vw; height: 40vw; }
    .gallery-album-card.is-featured { grid-template-columns: 1fr; }
    .gallery-album-card.is-featured .gallery-album-cover { min-height: 25rem; }
}

@media (max-width: 700px) {
    .gallery-hero { min-height: 39rem; }
    .gallery-hero-shade { background: linear-gradient(90deg, rgba(12,10,31,.94), rgba(17,14,45,.67)), linear-gradient(180deg, rgba(11,11,28,.15), rgba(11,11,28,.83)); }
    .gallery-hero-copy { width: 100%; }
    .gallery-hero-copy h1 { font-size: clamp(3.3rem, 16vw, 5.2rem); }
    .gallery-hero-scene { display: none; }
    .gallery-section-heading { display: block; }
    .gallery-section-number { display: none; }
    .gallery-album-grid { grid-template-columns: 1fr; }
    .gallery-album-card.is-featured { grid-column: auto; }
    .gallery-album-card.is-featured .gallery-album-cover, .gallery-album-cover { min-height: 17rem; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-hero-media img, .gallery-hero-plane { animation: none !important; }
    .gallery-album-card, .gallery-album-cover img { transition-duration: .01ms !important; }
}
