.gallery-layout {
    display: block;
    width: 100%;
    padding: var(--gap);
    background: #080909;
}

.gallery-page {
    --gallery-gold: #d69a2b;
    --gallery-pale: #edd39b;
    position: relative;
    isolation: isolate;
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3.5rem) 3.5rem;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(5, 6, 6, 0.97) 0%, rgba(7, 8, 8, 0.9) 56%, rgba(7, 8, 8, 0.72) 100%),
        radial-gradient(circle at 76% 26%, rgba(112, 67, 13, 0.25), transparent 27rem),
        url("../images/header5-zRB9asr.png") 60% center / cover no-repeat;
}

.gallery-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, #090a0a 0%, transparent 12%, transparent 82%, #090a0a 100%),
        repeating-linear-gradient(118deg, transparent 0 10px, rgba(255, 255, 255, 0.012) 11px, transparent 12px 22px);
    box-shadow: inset 0 0 90px 28px rgba(0, 0, 0, 0.72);
}

.gallery-glow { position: absolute; z-index: 2; width: 300px; height: 300px; border-radius: 50%; filter: blur(90px); pointer-events: none; mix-blend-mode: screen; }
.gallery-glow--gold { right: 6%; bottom: 18%; background: rgba(172, 91, 8, 0.18); }
.gallery-glow--red { top: 19%; left: 4%; width: 220px; height: 220px; background: rgba(120, 24, 10, 0.08); }

.gallery-hero,
.gallery-frame { position: relative; z-index: 4; }

.gallery-hero {
    width: min(760px, 78%);
    margin: 0 auto 2.5rem;
    text-align: center;
}

.gallery-kicker {
    margin: 0 0 0.8rem;
    color: #c5a665;
    font: 600 clamp(0.65rem, 1.5vw, 0.78rem)/1.4 Verdana, Arial, sans-serif;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 2px 5px #000;
}

.gallery-kicker span { color: var(--gallery-gold); }

.gallery-hero h1 {
    margin: 0;
    color: transparent;
    font: 400 clamp(2rem, 5vw, 3.65rem)/1.08 Georgia, 'Times New Roman', serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff0c7, #d9a23b 47%, #7f581c 52%, #e4bd68 76%, #7a5521);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 3px 0 #120c03) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.82));
}

.gallery-hero > p:last-child {
    max-width: 640px;
    margin: 0 auto;
    color: #bcb7ae;
    font: 0.92rem/1.75 Verdana, Arial, sans-serif;
    text-shadow: 0 2px 4px #000;
}

.gallery-divider {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: min(370px, 70%);
    margin: 1.25rem auto;
}

.gallery-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(214, 154, 43, 0.7)); }
.gallery-divider span:last-child { transform: scaleX(-1); }
.gallery-divider i { width: 9px; height: 9px; border: 1px solid var(--gallery-gold); transform: rotate(45deg); box-shadow: 0 0 8px rgba(214, 154, 43, 0.35); }

.gallery-frame {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, rgba(226, 177, 82, 0.72), rgba(63, 49, 29, 0.2) 25%, rgba(128, 91, 31, 0.45) 75%, rgba(225, 172, 70, 0.58)) 1;
    background:
        radial-gradient(circle at 30% 0%, rgba(126, 81, 17, 0.12), transparent 42%),
        linear-gradient(145deg, rgba(18, 19, 19, 0.96), rgba(6, 7, 7, 0.98));
    box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.72), 0 22px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
}

.gallery-corner { position: absolute; width: 28px; height: 28px; pointer-events: none; border-color: #bd842a; opacity: 0.75; }
.gallery-corner--tl { top: 7px; left: 7px; border-top: 1px solid; border-left: 1px solid; }
.gallery-corner--tr { top: 7px; right: 7px; border-top: 1px solid; border-right: 1px solid; }
.gallery-corner--bl { bottom: 7px; left: 7px; border-bottom: 1px solid; border-left: 1px solid; }
.gallery-corner--br { right: 7px; bottom: 7px; border-right: 1px solid; border-bottom: 1px solid; }

.gallery-empty {
    display: grid;
    min-height: 200px;
    place-items: center;
    align-content: center;
    gap: 0.8rem;
    padding: 2rem;
    border: 1px solid rgba(165, 126, 58, 0.16);
    background: radial-gradient(circle, rgba(133, 83, 12, 0.1), transparent 65%), rgba(5, 6, 6, 0.48);
    color: #6f695f;
    text-align: center;
}

.gallery-empty span { color: #9f7021; font-size: 1.1rem; filter: drop-shadow(0 0 7px rgba(210, 137, 26, 0.25)); }
.gallery-empty p { max-width: 340px; margin: 0; font: italic 0.85rem/1.65 Georgia, 'Times New Roman', serif; letter-spacing: 0.05em; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid rgba(131, 108, 70, 0.34);
    background: linear-gradient(145deg, rgba(29, 30, 29, 0.88), rgba(7, 8, 8, 0.95));
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, transform 150ms ease;
}

.gallery-item:hover {
    border-color: var(--gallery-gold);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 200ms ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-caption {
    padding: 0.6rem 0.75rem;
    color: #ccc5b8;
    font: 0.72rem/1.4 Verdana, Arial, sans-serif;
}

.gallery-item:hover .gallery-caption { color: #f1ddb5; }

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 5vw;
    background: rgba(3, 3, 3, 0.9);
    cursor: pointer;
}

.gallery-lightbox.hidden { display: none; }

.gallery-lightbox figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    text-align: center;
    cursor: default;
}

.gallery-lightbox img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
    border: 1px solid rgba(226, 177, 82, 0.55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}

.gallery-lightbox figcaption {
    margin-top: 0.9rem;
    color: #e7dfd0;
    font: 0.85rem/1.5 Georgia, 'Times New Roman', serif;
}

@media (max-width: 720px) {
    .gallery-page { padding: 3rem 0.85rem 2.5rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
