/* ============================================
   ERIMAH GALLERY — EDITORIAL MASONRY
   
   This file loads AFTER style.css and overrides
   the light homepage theme for the dark gallery.
   ============================================ */

/* =============================================
   VARIABLES
   ============================================= */
.gallery-page {
    --gal-bg: #07080b;
    --gal-surface: #0d0e12;
    --gal-border: rgba(255,255,255,0.04);
    --gal-border-hover: rgba(126,200,227,0.15);
    --gal-text: #c8ccd4;
    --gal-muted: rgba(255,255,255,0.35);
    --gal-accent: #7ec8e3;
    --gal-white: #f0f2f5;
    --gal-radius: 12px;
    --gal-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --gal-font-display: 'Fraunces', serif;
    --gal-font-body: 'Outfit', sans-serif;
}

/* =============================================
   PAGE BASE — Override body/page bg
   ============================================= */
.gallery-page {
    padding-top: 72px;
    background: var(--gal-bg) !important;
    color: var(--gal-text);
    font-family: var(--gal-font-body);
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   NAVBAR — Override light theme navbar
   ============================================= */
.gallery-page .navbar {
    background: rgba(7,8,11,0.6) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gal-border) !important;
    transition: all 0.3s ease;
}
.gallery-page .navbar.scrolled {
    background: rgba(7,8,11,0.92) !important;
    box-shadow: none !important;
}

/* Nav links — override homepage colors */
.gallery-page .nav-link {
    color: rgba(255,255,255,0.45) !important;
}
.gallery-page .nav-link:hover,
.gallery-page .nav-link.active {
    color: var(--gal-white) !important;
}

/* Logo — override homepage colors */
.gallery-page .logo-e {
    color: var(--gal-accent) !important;
}
.gallery-page .logo-text {
    color: var(--gal-white) !important;
}
.gallery-page .logo-sub {
    color: rgba(255,255,255,0.3) !important;
}

/* Mobile toggle — override homepage colors */
.gallery-page .nav-toggle span {
    background: var(--gal-white) !important;
}

/* Mobile menu — dark bg */
@media (max-width: 768px) {
    .gallery-page .nav-menu {
        background: rgba(7,8,11,0.98) !important;
    }
    .gallery-page .nav-menu.open {
        background: rgba(7,8,11,0.98) !important;
    }
}

/* =============================================
   SECTION LABEL (reusable)
   ============================================= */
.gal-sec-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.gal-sec-line {
    width: 32px;
    height: 1px;
    background: var(--gal-accent);
}
.gal-sec-text {
    font-family: var(--gal-font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gal-accent);
}

/* =============================================
   HERO — ASYMMETRIC SPLIT
   ============================================= */
.gal-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.gal-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(126,200,227,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.gal-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    align-items: center;
    width: 100%;
}

.gal-hero-content {
    padding: 80px 0;
}

.gal-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-family: var(--gal-font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gal-accent);
    background: rgba(126,200,227,0.06);
    border: 1px solid rgba(126,200,227,0.12);
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 32px;
    animation: galFadeUp 0.7s var(--gal-ease) 0.1s both;
}

.gal-hero-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gal-accent);
    animation: galPulse 2s ease-in-out infinite;
}

@keyframes galPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.gal-hero h1 {
    font-family: var(--gal-font-display);
    font-size: clamp(52px, 7vw, 96px);
    font-weight: 800;
    line-height: 0.92;
    color: var(--gal-white);
    letter-spacing: -0.04em;
    margin-bottom: 28px;
}

.gal-hero h1 span { display: block; }

.gal-h1-l1 {
    animation: galFadeUp 0.7s var(--gal-ease) 0.25s both;
}
.gal-h1-l2 {
    font-style: italic;
    font-weight: 600;
    color: var(--gal-accent);
    animation: galFadeUp 0.7s var(--gal-ease) 0.4s both;
}

.gal-hero-line {
    width: 56px;
    height: 2px;
    background: linear-gradient(90deg, var(--gal-accent), transparent);
    margin-bottom: 24px;
    animation: galFadeUp 0.7s var(--gal-ease) 0.5s both;
}

.gal-hero-sub {
    font-family: var(--gal-font-body);
    font-size: 15px;
    line-height: 1.8;
    color: var(--gal-muted);
    max-width: 340px;
    animation: galFadeUp 0.7s var(--gal-ease) 0.6s both;
}

/* Hero image mosaic */
.gal-hero-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 40px 0 40px 20px;
}

.gal-hero-img {
    border-radius: var(--gal-radius);
    overflow: hidden;
    position: relative;
    animation: galFadeUp 0.8s var(--gal-ease) both;
}
.gal-hero-img:nth-child(1) { animation-delay: 0.3s; }
.gal-hero-img:nth-child(2) { animation-delay: 0.45s; }
.gal-hero-img:nth-child(3) { animation-delay: 0.6s; }

.gal-hero-img--tall {
    grid-row: 1 / 3;
}

.gal-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 6s ease;
}
.gal-hero-img:hover img {
    transform: scale(1.05);
}

.gal-hero-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(7,8,11,0.4) 100%);
    pointer-events: none;
}

/* =============================================
   BUILD JOURNEY
   ============================================= */
.gal-journey {
    padding: 120px 0;
    border-bottom: 1px solid var(--gal-border);
}

.gal-journey-head {
    margin-bottom: 56px;
}

.gal-journey-head h2 {
    font-family: var(--gal-font-display);
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 800;
    color: var(--gal-white);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.gal-journey-desc {
    margin-top: 14px;
    font-size: 15px;
    color: var(--gal-muted);
    max-width: 420px;
    line-height: 1.7;
}

.gal-journey-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.gal-jcard {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--gal-surface);
    border: 1px solid var(--gal-border);
    transition: transform 0.5s var(--gal-ease), border-color 0.4s;
    opacity: 0;
    transform: translateY(30px);
}
.gal-jcard.visible {
    animation: galFadeUp 0.6s var(--gal-ease) both;
}
.gal-jcard:nth-child(1).visible { animation-delay: 0.1s; }
.gal-jcard:nth-child(2).visible { animation-delay: 0.25s; }
.gal-jcard:nth-child(3).visible { animation-delay: 0.4s; }

.gal-jcard:hover {
    transform: translateY(-4px);
    border-color: var(--gal-border-hover);
}

.gal-jcard-img {
    aspect-ratio: 4/5;
    overflow: hidden;
    position: relative;
}

.gal-jcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--gal-ease);
}
.gal-jcard:hover .gal-jcard-img img {
    transform: scale(1.06);
}

.gal-jcard-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(7,8,11,0.7) 100%);
    pointer-events: none;
}

.gal-jcard-num {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    font-family: var(--gal-font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--gal-accent);
    background: rgba(7,8,11,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(126,200,227,0.15);
}

.gal-jcard-info {
    padding: 20px;
}
.gal-jcard-info h3 {
    font-family: var(--gal-font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--gal-white);
    margin-bottom: 6px;
}
.gal-jcard-info p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--gal-muted);
}

/* =============================================
   PORTFOLIO — MASONRY
   ============================================= */
.gal-portfolio {
    padding: 120px 0;
}

.gal-portfolio-head {
    margin-bottom: 48px;
}

.gal-portfolio-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 8px;
}

.gal-portfolio-title-row h2 {
    font-family: var(--gal-font-display);
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 800;
    color: var(--gal-white);
    letter-spacing: -0.02em;
}

/* Filters */
.gal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gal-filter {
    padding: 8px 20px;
    font-family: var(--gal-font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--gal-muted);
    background: transparent;
    border: 1px solid var(--gal-border);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.gal-filter:hover {
    color: var(--gal-white);
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.03);
}
.gal-filter.active {
    color: var(--gal-bg);
    background: var(--gal-accent);
    border-color: var(--gal-accent);
    box-shadow: 0 4px 20px rgba(126,200,227,0.2);
}

/* MASONRY — CSS column-count */
.gal-masonry {
    column-count: 3;
    column-gap: 18px;
}

/* Cards */
.gal-mcard {
    break-inside: avoid;
    margin-bottom: 18px;
    border-radius: var(--gal-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: var(--gal-surface);
    border: 1px solid var(--gal-border);
    transition: transform 0.5s var(--gal-ease), box-shadow 0.5s, border-color 0.4s;
    opacity: 0;
    transform: translateY(20px);
}

.gal-mcard.visible {
    animation: galMasonIn 0.5s var(--gal-ease) both;
}

.gal-mcard:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(126,200,227,0.08);
    border-color: var(--gal-border-hover);
}

.gal-mcard.hidden {
    display: none;
}

/* Image — NATURAL HEIGHT */
.gal-mcard-img {
    overflow: hidden;
    position: relative;
}
.gal-mcard-img img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s var(--gal-ease);
}
.gal-mcard:hover .gal-mcard-img img {
    transform: scale(1.05);
}

/* Hover overlay */
.gal-mcard-over {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 20px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(7,8,11,0.9) 100%);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s, transform 0.35s;
}
.gal-mcard:hover .gal-mcard-over {
    opacity: 1;
    transform: translateY(0);
}

.gal-mcard-tag {
    display: inline-block;
    font-family: var(--gal-font-body);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gal-accent);
    background: rgba(126,200,227,0.1);
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 8px;
}
.gal-mcard-over h3 {
    font-family: var(--gal-font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--gal-white);
    line-height: 1.3;
}

/* Coming Soon */
.gal-mcard-soon { cursor: default; }
.gal-mcard-soon:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--gal-border);
}

.gal-mcard-placeholder {
    padding: 56px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    background: radial-gradient(ellipse at center, rgba(126,200,227,0.02) 0%, transparent 70%);
    min-height: 220px;
}
.gal-mcard-placeholder svg {
    width: 36px;
    height: 36px;
    color: rgba(255,255,255,0.06);
    stroke-width: 1;
}
.gal-ph-title {
    font-family: var(--gal-font-display);
    font-size: 17px;
    font-weight: 600;
    color: rgba(255,255,255,0.1);
}
.gal-ph-sub {
    font-family: var(--gal-font-body);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.06);
}

/* Empty */
.gal-empty {
    text-align: center;
    padding: 100px 20px;
}
.gal-empty h3 {
    font-family: var(--gal-font-display);
    font-size: 22px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 8px;
}
.gal-empty p {
    color: rgba(255,255,255,0.15);
}

/* =============================================
   LIGHTBOX
   ============================================= */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5,6,9,0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.gal-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.gal-lb-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.gal-lb-close:hover {
    background: rgba(255,255,255,0.08);
    transform: rotate(90deg);
}
.gal-lb-close svg {
    width: 20px;
    height: 20px;
    color: var(--gal-white);
}

.gal-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.gal-lb-nav:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(126,200,227,0.15);
}
.gal-lb-nav svg {
    width: 20px;
    height: 20px;
    color: var(--gal-white);
}
.gal-lb-prev { left: 24px; }
.gal-lb-next { right: 24px; }

.gal-lb-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 85vw;
    max-height: 90vh;
}
.gal-lb-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.gal-lb-body img {
    max-width: 80vw;
    max-height: 76vh;
    object-fit: contain;
    display: block;
}
.gal-lb-caption {
    margin-top: 24px;
    text-align: center;
}
.gal-lb-caption h3 {
    font-family: var(--gal-font-display);
    font-size: 18px;
    color: var(--gal-white);
    margin-bottom: 6px;
}
.gal-lb-caption span {
    font-size: 11px;
    color: var(--gal-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.gal-lb-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--gal-font-body);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.1em;
}

/* =============================================
   CTA — Override btn-primary from style.css
   ============================================= */
.gal-cta {
    padding: 120px 0;
    background: var(--gal-surface) !important;
    border-top: 1px solid var(--gal-border);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.gal-cta::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(126,200,227,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.gal-cta h2 {
    font-family: var(--gal-font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    color: var(--gal-white);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.gal-cta p {
    font-size: 16px;
    color: var(--gal-muted);
    margin-bottom: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}
.gal-cta-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Override the homepage .btn-primary on gallery page */
.gallery-page .gal-cta .btn-primary {
    background: var(--gal-accent) !important;
    color: var(--gal-bg) !important;
    border-color: var(--gal-accent) !important;
    border-radius: 8px;
}
.gallery-page .gal-cta .btn-primary:hover {
    background: #9dd8ee !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(126,200,227,0.25);
}

.gal-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 32px;
    background: #25D366;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-family: var(--gal-font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.gal-wa-btn:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,211,102,0.25);
}
.gal-wa-btn svg { width: 18px; height: 18px; }

/* =============================================
   FOOTER — Override light theme footer
   ============================================= */
.gallery-page .footer {
    background: var(--gal-bg) !important;
    border-top: 1px solid var(--gal-border) !important;
    color: var(--gal-text);
}
.gallery-page .footer .footer-brand p,
.gallery-page .footer .footer-links a,
.gallery-page .footer .footer-contact a,
.gallery-page .footer .footer-contact span,
.gallery-page .footer .footer-contact p,
.gallery-page .footer .footer-services a {
    color: var(--gal-muted) !important;
}
.gallery-page .footer .footer-links h4,
.gallery-page .footer .footer-contact h4,
.gallery-page .footer .footer-services h4 {
    color: var(--gal-white) !important;
}
.gallery-page .footer .footer-links a:hover,
.gallery-page .footer .footer-services a:hover {
    color: var(--gal-accent) !important;
}
.gallery-page .footer .footer-bottom {
    border-top-color: var(--gal-border) !important;
}
.gallery-page .footer .footer-bottom p,
.gallery-page .footer .footer-legal span {
    color: rgba(255,255,255,0.35) !important;
}
.gallery-page .footer .footer-credit a {
    color: var(--gal-accent) !important;
}
.gallery-page .footer .footer-credit a:hover {
    color: #fff !important;
}
.gallery-page .footer .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes galFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes galMasonIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
    .gal-masonry { column-count: 2; }
}

@media (max-width: 900px) {
    .gal-hero-inner {
        grid-template-columns: 1fr;
    }
    .gal-hero-content { padding: 40px 0 20px; }
    .gal-hero-images {
        padding: 0 0 40px;
        grid-template-columns: 1fr 1fr;
        max-height: 400px;
    }
    .gal-hero-img--tall { grid-row: auto; }

    .gal-journey { padding: 80px 0; }
    .gal-journey-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gal-jcard-img { aspect-ratio: 16/10; }

    .gal-portfolio { padding: 80px 0; }
    .gal-portfolio-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .gal-hero { min-height: auto; padding-top: 20px; }
    .gal-hero h1 { font-size: 48px; }

    .gal-lb-prev { left: 10px; }
    .gal-lb-next { right: 10px; }
    .gal-lb-nav { width: 42px; height: 42px; }
    .gal-lb-body img { max-width: 92vw; }

    .gallery-page .footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .gallery-page .footer .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .gal-hero h1 { font-size: 44px; }

    .gal-masonry {
        column-count: 1;
        column-gap: 0;
    }
    .gal-mcard { margin-bottom: 16px; }

    /* Always show overlay on mobile since no hover */
    .gal-mcard-over {
        opacity: 1;
        transform: translateY(0);
    }

    .gal-cta { padding: 80px 0; }
    .gal-cta-btns {
        flex-direction: column;
        align-items: center;
    }
    .gal-cta-btns .btn,
    .gal-wa-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        text-align: center;
    }

    .gal-lb-prev { left: 8px; }
    .gal-lb-next { right: 8px; }
    .gal-lb-nav { width: 40px; height: 40px; }
    .gal-lb-body img { max-width: 94vw; }
}