@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --g-gold: #D4A843;
    --g-gold-light: #F5E6C8;
    --g-navy: #0A1628;
    --g-navy-mid: #142238;
    --g-navy-light: #1C3050;
    --g-cream: #FDF8F0;
    --g-white: #FFFFFF;
    --g-text: #E8E0D4;
    --g-text-muted: #9A8E7F;
    --g-accent-warm: #C67A3C;
    --g-accent-rose: #B5545B;
    --g-glass: rgba(10, 22, 40, 0.85);
    --g-glass-light: rgba(255, 255, 255, 0.06);
    --g-border: rgba(212, 168, 67, 0.15);
    --g-radius: 16px;
    --g-radius-sm: 10px;
    --g-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --g-transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--g-navy);
    color: var(--g-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* ── Background Ambience ── */
.gallery-page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(212, 168, 67, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 90%, rgba(198, 122, 60, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(181, 84, 91, 0.03) 0%, transparent 50%);
}

/* ── Top Navigation ── */
.gallery-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--g-border);
    padding: 1rem 0;
    transition: var(--g-transition);
}

.gallery-nav .nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-nav .logo img {
    height: 45px;
}

.gallery-nav .back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--g-gold);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--g-border);
    border-radius: 50px;
    transition: var(--g-transition);
}

.gallery-nav .back-link:hover {
    background: var(--g-gold);
    color: var(--g-navy);
    border-color: var(--g-gold);
}

/* ── Hero Banner ── */
.gallery-hero {
    position: relative;
    z-index: 1;
    padding: 140px 2rem 60px;
    text-align: center;
}

.gallery-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--g-white);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.gallery-hero h1 span {
    background: linear-gradient(135deg, var(--g-gold), var(--g-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-hero p {
    font-size: 1.15rem;
    color: var(--g-text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.gallery-hero .image-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--g-glass-light);
    border: 1px solid var(--g-border);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--g-gold);
    backdrop-filter: blur(10px);
}

/* ── Category Filter Bar ── */
.filter-bar {
    position: sticky;
    top: 73px;
    z-index: 90;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--g-border);
    padding: 1rem 0;
}

.filter-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
    flex-shrink: 0;
    padding: 0.55rem 1.4rem;
    border: 1px solid var(--g-border);
    border-radius: 50px;
    background: transparent;
    color: var(--g-text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--g-transition);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--g-gold);
    border-color: var(--g-gold);
}

.filter-btn.active {
    background: var(--g-gold);
    color: var(--g-navy);
    border-color: var(--g-gold);
    font-weight: 600;
}

/* ── Gallery Grid ── */
.gallery-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.gallery-grid {
    columns: 4 280px;
    column-gap: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
    border-radius: var(--g-radius);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

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

/* Image Enhancement for Low-Fidelity */
.gallery-item img {
    width: 100%;
    display: block;
    border-radius: var(--g-radius);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease;
    filter: contrast(1.08) saturate(1.15) brightness(1.02);
    image-rendering: auto;
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--g-radius);
    background: linear-gradient(180deg,
        transparent 40%,
        rgba(10, 22, 40, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: var(--g-radius);
    box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.08);
    transition: box-shadow 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover::after {
    box-shadow: inset 0 0 0 2px rgba(212, 168, 67, 0.3);
}

.gallery-item:hover img {
    transform: scale(1.06);
    filter: contrast(1.12) saturate(1.25) brightness(1.05);
}

.gallery-item .item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 1.2rem;
    transform: translateY(10px);
    opacity: 0;
    transition: var(--g-transition);
}

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

.item-overlay .category-tag {
    display: inline-block;
    background: rgba(212, 168, 67, 0.9);
    color: var(--g-navy);
    padding: 0.2rem 0.75rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-overlay .expand-icon {
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 10, 20, 0.97);
    backdrop-filter: blur(30px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--g-radius);
    filter: contrast(1.1) saturate(1.2) brightness(1.03);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--g-transition);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: var(--g-gold);
    color: var(--g-navy);
    border-color: var(--g-gold);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--g-transition);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--g-gold);
    color: var(--g-navy);
    border-color: var(--g-gold);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(12px);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--g-border);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--g-gold);
    white-space: nowrap;
}

/* ── Stagger Animations ── */
.gallery-item:nth-child(1) { transition-delay: 0.02s; }
.gallery-item:nth-child(2) { transition-delay: 0.04s; }
.gallery-item:nth-child(3) { transition-delay: 0.06s; }
.gallery-item:nth-child(4) { transition-delay: 0.08s; }
.gallery-item:nth-child(5) { transition-delay: 0.10s; }
.gallery-item:nth-child(6) { transition-delay: 0.12s; }
.gallery-item:nth-child(7) { transition-delay: 0.14s; }
.gallery-item:nth-child(8) { transition-delay: 0.16s; }

/* ── Footer (Gallery Page) ── */
.gallery-footer {
    position: relative;
    z-index: 1;
    background: var(--g-navy-mid);
    border-top: 1px solid var(--g-border);
    padding: 2rem;
    text-align: center;
}

.gallery-footer p {
    color: var(--g-text-muted);
    font-size: 0.85rem;
}

.gallery-footer a {
    color: var(--g-gold);
    text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .gallery-grid { columns: 3 220px; }
}

@media (max-width: 768px) {
    .gallery-hero { padding: 120px 1.5rem 40px; }
    .gallery-hero h1 { font-size: 2.2rem; }
    .gallery-grid { columns: 2 160px; column-gap: 0.75rem; }
    .gallery-item { margin-bottom: 0.75rem; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1rem; }
    .lightbox-prev { left: 0.75rem; }
    .lightbox-next { right: 0.75rem; }
    .filter-inner { padding: 0 1rem; }
}

@media (max-width: 480px) {
    .gallery-grid { columns: 2 140px; }
    .gallery-hero h1 { font-size: 1.8rem; }
    .item-overlay .category-tag { font-size: 0.65rem; }
}
