/* ============================================================
   GALLERY PAGE - EDITORIAL ARCHIVE
   ============================================================ */

:root {
    --gallery-accent: var(--color-accent);
    --gallery-border: rgba(255, 255, 255, 0.1);
    --gallery-glass: rgba(10, 10, 10, 0.7);
}

.page-gallery {
    background: #000;
    color: #fff;
    overflow-x: hidden;
}

/* --- Hero Section --- */
.gallery-hero {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10rem 10vw 5rem;
    overflow: hidden;
}

.gallery-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gallery-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: brightness(0.5) contrast(1.2);
}

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000 0%, transparent 100%);
    z-index: 1;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
}

.gallery-hero-kicker {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6em;
    color: var(--gallery-accent);
    margin-bottom: 2rem;
    display: block;
    font-weight: 700;
}

.gallery-hero-title {
    margin: 0;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.85;
    letter-spacing: -0.05em;
    font-family: var(--font-heading);
}

.title-serif {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
}

/* --- Sticky Filter Bar --- */
.gallery-filter-wrapper {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: var(--gallery-glass);
    border-bottom: 1px solid var(--gallery-border);
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 3rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0.5rem 0;
    position: relative;
}

.filter-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gallery-accent);
    transition: width 0.4s ease;
}

.filter-btn.active {
    color: #fff;
}

.filter-btn.active::after {
    width: 100%;
}

.filter-btn:hover {
    color: #fff;
}

/* --- Masonry Grid --- */
.gallery-section {
    padding: 1.25rem 0;
    position: relative;
}

.gallery-bg-text {
    position: absolute;
    top: 20%;
    left: 0;
    width: 100%;
    font-size: 25vw;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1;
    z-index: 0;
}

.container {
    width: min(92%, 1600px);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    border-radius: 4px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery-item:hover .gallery-item-info {
    opacity: 1;
    transform: translateY(0);
}

.item-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gallery-accent);
    margin-bottom: 0.5rem;
    display: block;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Grid Layout Patterns */
.size-sm { grid-column: span 4; aspect-ratio: 1; }
.size-md { grid-column: span 6; aspect-ratio: 4/3; }
.size-lg { grid-column: span 8; aspect-ratio: 16/9; }
.size-tall { grid-column: span 4; aspect-ratio: 3/4; }
.size-wide { grid-column: span 12; aspect-ratio: 21/9; }

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    padding: 4rem;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* --- Responsiveness --- */
@media (max-width: 1024px) {
    .gallery-grid {
        gap: 1.5rem;
    }
    .size-sm, .size-md, .size-lg, .size-tall, .size-wide {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .size-sm, .size-md, .size-lg, .size-tall, .size-wide {
        grid-column: span 12;
    }
    .gallery-filter {
        gap: 1.5rem;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 5vw;
    }
}
