/* Logan's Martial Arts - Cinematic Legacy Gallery UX */
.gallery-cinematic-hero {
    position: relative;
    overflow: hidden;
    padding: 3.25rem 0 2.75rem;
    border-bottom: 1px solid rgba(202, 162, 75, .18);
    background:
        radial-gradient(circle at 20% 15%, rgba(202, 162, 75, .18), transparent 30%),
        linear-gradient(135deg, rgba(127, 29, 20, .35), rgba(9, 9, 10, .92) 48%, rgba(202, 162, 75, .08));
}
.gallery-cinematic-hero:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,.2)), url('/assets/brand/bg_dragon.png') center/cover no-repeat;
    opacity: .28;
    pointer-events: none;
}
.gallery-cinematic-hero .container {
    position: relative;
    z-index: 1;
}
.gallery-hero-panel {
    max-width: 860px;
    padding: 1.4rem 1.6rem;
    border-left: 4px solid var(--gold);
    background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,.12));
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.gallery-hero-panel h1 {
    margin: .2rem 0 .65rem;
    font-size: clamp(1.45rem, 3vw, 2.85rem);
    line-height: 1.07;
    text-shadow: 0 3px 16px rgba(0,0,0,.65);
}
.gallery-hero-panel .lead {
    margin-bottom: 0;
}
.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.35rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid rgba(202, 162, 75, .18);
}
.gallery-toolbar__title {
    margin: 0;
    color: var(--gold-soft);
    font-size: 1.1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.gallery-toolbar__meta {
    color: var(--muted);
    font-size: .95rem;
}
.cinematic-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
}
.cinematic-album-card {
    position: relative;
    min-height: 310px;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(202, 162, 75, .22);
    background: #090909;
    box-shadow: 0 22px 46px rgba(0,0,0,.34);
    isolation: isolate;
}
.cinematic-album-card--feature {
    grid-column: span 2;
    min-height: 390px;
}
.cinematic-album-card a {
    color: inherit;
}
.cinematic-album-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    transform: scale(1);
    transition: transform .45s ease, filter .45s ease;
    filter: saturate(.98) contrast(1.04) brightness(.86);
}
.cinematic-album-card:hover .cinematic-album-card__image,
.cinematic-album-card:focus-within .cinematic-album-card__image {
    transform: scale(1.035);
    filter: saturate(1.06) contrast(1.06) brightness(.96);
}
.cinematic-album-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.45) 45%, rgba(0,0,0,.92));
}
.cinematic-album-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.35rem;
}
.cinematic-album-card__kicker {
    display: inline-flex;
    padding: .3rem .7rem;
    border: 1px solid rgba(202, 162, 75, .4);
    border-radius: 999px;
    color: var(--gold-soft);
    background: rgba(0,0,0,.35);
    font-size: .50rem;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.cinematic-album-card h2 {
    margin: .7rem 0 .4rem;
    font-size: clamp(.95rem, 1.4vw, 1.4rem);
    line-height: 1.05;
    text-shadow: 0 2px 14px rgba(0,0,0,.75);
}
.cinematic-album-card p {
    margin: .35rem 0 0;
    color: rgba(236,233,223,.82);
}
.cinematic-album-card__arrow {
    display: inline-flex;
    margin-top: .65rem;
    color: var(--gold-soft);
    font-size: .70rem;
    font-weight: 700;
}
.gallery-masonry {
    column-count: 4;
    column-gap: 1rem;
}
.gallery-masonry-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 1rem;
    break-inside: avoid;
}
.cinematic-media-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.55);
    box-shadow: 0 18px 36px rgba(0,0,0,.28);
    cursor: zoom-in;
}
.cinematic-media-card img,
.cinematic-media-card video {
    width: 100%;
    height: auto;
    display: block;
    border: 0;
    border-radius: 0;
    background: #000;
    transition: transform .35s ease, filter .35s ease;
}
.cinematic-media-card:hover img,
.cinematic-media-card:focus-within img {
    transform: scale(1.035);
    filter: brightness(1.08) contrast(1.05);
}
.cinematic-media-card__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem .85rem .75rem;
    color: #fff;
    font-size: .92rem;
    line-height: 1.25;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.84));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}
.cinematic-media-card:hover .cinematic-media-card__caption,
.cinematic-media-card:focus-within .cinematic-media-card__caption {
    opacity: 1;
    transform: translateY(0);
}
.cinematic-media-card__play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #17120a;
    background: rgba(224, 194, 120, .92);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    font-weight: 700;
}
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    background: rgba(4,4,5,.94);
    color: var(--text);
}
.gallery-lightbox.is-open {
    display: grid;
    grid-template-rows: 1fr auto;
}
.gallery-lightbox__stage {
    position: relative;
    display: grid;
    place-items: center;
    padding: 4.5rem 5rem 2rem;
    min-height: 0;
}
.gallery-lightbox__stage img,
.gallery-lightbox__stage video {
    max-width: min(100%, 1180px);
    max-height: calc(100vh - 155px);
    border-radius: 12px;
    border: 1px solid rgba(202,162,75,.24);
    box-shadow: 0 30px 80px rgba(0,0,0,.65);
    background: #000;
}
.gallery-lightbox__caption {
    padding: .9rem 1.5rem 1.2rem;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid rgba(202, 162, 75, .15);
}
.gallery-lightbox__caption strong {
    color: var(--gold-soft);
}
.gallery-lightbox__button {
    position: absolute;
    z-index: 2;
    border: 1px solid rgba(202,162,75,.35);
    color: var(--text);
    background: rgba(0,0,0,.55);
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.gallery-lightbox__button:hover {
    background: rgba(202,162,75,.18);
    color: #fff;
}
.gallery-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 46px;
    height: 46px;
    font-size: 1.45rem;
}
.gallery-lightbox__prev,
.gallery-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    font-size: 2rem;
}
.gallery-lightbox__prev { left: 1rem; }
.gallery-lightbox__next { right: 1rem; }
.gallery-empty-state {
    padding: 2rem;
    border: 1px dashed rgba(202,162,75,.3);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(0,0,0,.22);
}
@media (max-width: 1120px) {
    .gallery-masonry { column-count: 3; }
}
@media (max-width: 780px) {
    .gallery-cinematic-hero { padding: 2rem 0; }
    .gallery-hero-panel { padding: 1rem 1.1rem; }
    .gallery-toolbar { align-items: flex-start; flex-direction: column; }
    .cinematic-album-card--feature { grid-column: span 1; min-height: 330px; }
    .gallery-masonry { column-count: 2; }
    .gallery-lightbox__stage { padding: 4rem .75rem 1rem; }
    .gallery-lightbox__prev, .gallery-lightbox__next { display: none; }
}
@media (max-width: 520px) {
    .cinematic-album-grid { grid-template-columns: 1fr; }
    .gallery-masonry { column-count: 1; }
    .cinematic-media-card__caption { position: static; opacity: 1; transform: none; background: rgba(0,0,0,.7); }
}
.cinematic-media-card { display: block; color: inherit; }


/* Gallery Typography + Sharpness Refinements - 20260531 */
.gallery-hero-panel h1 {
    font-size: clamp(1.45rem, 3vw, 2.85rem);
    line-height: 1.07;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
}
.cinematic-media-card img,
.cinematic-media-card video {
    image-rendering: auto;
    backface-visibility: hidden;
    transform: translateZ(0);
}
.cinematic-media-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}
.gallery-masonry {
    column-gap: 1.25rem;
}
.gallery-masonry-item {
    margin-bottom: 1.25rem;
}
@media (max-width: 780px) {
    .gallery-hero-panel h1 {
        font-size: clamp(1.35rem, 7vw, 2.35rem);
    }
}


/* Larger Immersive Lightbox Slideshow Overrides - 20260601
   The earlier slideshow sizing was limited by the caption row and conservative max dimensions.
   These rules make the clicked-gallery slideshow use nearly the full browser viewport. */
.gallery-lightbox.is-open {
    display: block;
}
.gallery-lightbox__stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem 5.25rem;
    box-sizing: border-box;
}
.gallery-lightbox__stage img,
.gallery-lightbox__stage video {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 11rem);
    max-height: calc(100vh - 2.25rem);
    object-fit: contain;
    border-radius: 14px;
}
.gallery-lightbox__caption {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: .85rem;
    z-index: 2;
    max-width: min(920px, calc(100vw - 2rem));
    transform: translateX(-50%);
    padding: .55rem 1.1rem;
    border: 1px solid rgba(202, 162, 75, .18);
    border-radius: 999px;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    pointer-events: none;
}
.gallery-lightbox__caption:empty {
    display: none;
}
.gallery-lightbox__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
}
.gallery-lightbox__prev,
.gallery-lightbox__next {
    position: fixed;
    top: 50%;
    width: 54px;
    height: 78px;
    transform: translateY(-50%);
}
.gallery-lightbox__prev { left: 1.1rem; }
.gallery-lightbox__next { right: 1.1rem; }
@media (max-width: 780px) {
    .gallery-lightbox__stage {
        padding: 3.9rem .75rem 1rem;
    }
    .gallery-lightbox__stage img,
    .gallery-lightbox__stage video {
        max-width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 5rem);
    }
    .gallery-lightbox__caption {
        bottom: .5rem;
        max-width: calc(100vw - 1rem);
        border-radius: 12px;
        font-size: .85rem;
    }
}

/* Gallery Hero Compact Refinement - 20260604
   Reduces the Gallery & Videos hero section footprint by roughly 25% while
   preserving the cinematic / legacy styling. */
.gallery-cinematic-hero {
    padding: 2.45rem 0 2.05rem;
}
.gallery-hero-panel {
    padding: 1.05rem 1.2rem;
    border-left-width: 3px;
}
.gallery-hero-panel .eyebrow {
    margin: 0 0 .45rem;
    font-size: .60rem;
    letter-spacing: .15em;
}
.gallery-hero-panel h1 {
    margin: .1rem 0 .45rem;
    font-size: clamp(1.1rem, 2.25vw, 2.15rem);
    line-height: 1.04;
}
.gallery-hero-panel .lead {
    font-size: clamp(.86rem, 1.35vw, 1rem);
    line-height: 1.25;
    max-width: 48rem;
}
@media (max-width: 780px) {
    .gallery-cinematic-hero {
        padding: 1.5rem 0;
    }
    .gallery-hero-panel {
        padding: .75rem .85rem;
    }
    .gallery-hero-panel h1 {
        font-size: clamp(1rem, 5.25vw, 1.75rem);
    }
    .gallery-hero-panel .lead {
        font-size: .9rem;
    }
}
