/* ============================================================
   GALLERY PAGE — Editorial masonry, mobile-first
   Lightbox JS untouched (openModal/closeModal/currentSlide/showSlides)
   ============================================================ */

/* ---------- 1. COMPACT HERO ---------- */
.gl-hero { padding: 48px 0 36px; }
.gl-hero-inner { max-width: 760px; }
.gl-hero-kicker { display: inline-block; margin-bottom: 12px; }
.gl-hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.12;
    color: var(--forest);
    margin: 0 0 12px;
    letter-spacing: -0.4px;
}
.gl-hero-title em {
    color: var(--marigold);
    font-style: italic;
    font-family: var(--font-display);
}
.gl-hero-lede {
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-muted, #666);
    margin: 0;
    max-width: 640px;
}

/* ---------- 2. CATEGORY TABS ---------- */
.gl-wrap { padding: 40px 0 64px; }
.gl-tabs {
    margin-bottom: 28px;
    /* horizontal scroll on mobile, centered on desktop */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
}
.gl-tabs::-webkit-scrollbar { display: none; }
.gl-tabs ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    min-width: min-content;
}
.gl-tabs li { flex: 0 0 auto; }
.gl-tabs li a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1.5px solid var(--forest);
    border-radius: 999px;
    color: var(--forest);
    text-decoration: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    background: transparent;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.gl-tabs li a:hover {
    background: rgba(30, 58, 43, 0.08);
    transform: translateY(-1px);
}
.gl-tabs li.active a {
    background: var(--marigold);
    border-color: var(--marigold);
    color: #fff;
    box-shadow: 0 8px 20px rgba(217, 122, 44, 0.3);
}

/* ---------- 3. MASONRY GRID ---------- */
.gl-masonry {
    column-count: 2;
    column-gap: 12px;
}
.gl-item {
    break-inside: avoid;
    margin-bottom: 12px;
    background: var(--card-bg);
    border: 1px solid rgba(30, 58, 43, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(19, 36, 25, 0.08);
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease;
}
.gl-item:hover,
.gl-item:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(19, 36, 25, 0.16);
    outline: none;
}
.gl-img-wrap {
    position: relative;
    overflow: hidden;
    background: var(--cream-deep);
}
.gl-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s ease;
}
.gl-item:hover .gl-img-wrap img { transform: scale(1.04); }

.gl-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(19, 36, 25, 0.65), rgba(19, 36, 25, 0) 55%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 14px;
    opacity: 0;
    transition: opacity .3s ease;
}
.gl-item:hover .gl-overlay,
.gl-item:focus-visible .gl-overlay { opacity: 1; }
.gl-overlay-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--marigold);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(217, 122, 44, 0.4);
}
.gl-caption {
    padding: 12px 14px 14px;
    font-family: var(--font-display);
    color: var(--forest);
    font-size: 14px;
    line-height: 1.35;
    border-top: 1px solid rgba(30, 58, 43, 0.08);
    font-weight: 500;
}

/* ---------- EMPTY STATE ---------- */
.gl-empty {
    column-span: all;
    -webkit-column-span: all;
    text-align: center;
    padding: 56px 24px;
    border-radius: 16px;
    border: 1.5px dashed rgba(30, 58, 43, 0.28);
    background: var(--cream-deep);
    margin: 16px 0 0;
}
.gl-empty i {
    font-size: 2.2rem;
    color: var(--marigold);
    margin-bottom: 12px;
    display: block;
}
.gl-empty h3 {
    font-family: var(--font-display);
    color: var(--forest);
    font-size: 1.3rem;
    margin: 0 0 8px;
}
.gl-empty p {
    color: var(--text-muted, #666);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
    font-size: 14px;
}

/* ---------- 4. LIGHTBOX RE-SKIN (CSS only; JS stays in footer.php) ---------- */
.gl-lightbox.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(19, 36, 25, 0.94);
    padding: 40px 16px;
    overflow: auto;
}
.gl-lightbox .modal-content {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    background: transparent;
}
.gl-lightbox .mySlides {
    display: none;
    text-align: center;
}
.gl-lightbox .mySlides img {
    max-width: 100%;
    max-height: 78vh;
    width: auto !important;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.gl-lightbox .close {
    position: absolute;
    top: -8px;
    right: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--marigold);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: transform .25s ease, background .2s ease;
    border: none;
}
.gl-lightbox .close:hover {
    background: var(--marigold-deep, #be6720);
    transform: rotate(90deg);
}
.gl-lightbox .prev,
.gl-lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cream);
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(245, 241, 232, 0.15);
    border-radius: 50%;
    width: 48px; height: 48px;
    display: grid;
    place-items: center;
    transition: background .2s ease, color .2s ease;
    text-decoration: none;
    z-index: 5;
}
.gl-lightbox .prev:hover,
.gl-lightbox .next:hover { background: var(--marigold); color: #fff; }
.gl-lightbox .prev { left: 4px; }
.gl-lightbox .next { right: 4px; }

.gl-lightbox .caption-container {
    text-align: center;
    margin-top: 18px;
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 15px;
    font-style: italic;
}

/* ---------- 5. END CTA STRIP ---------- */
.gl-end-cta {
    padding: 40px 0;
    text-align: center;
}
.gl-end-cta-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.gl-end-cta h2 {
    font-family: var(--font-display);
    color: var(--cream);
    font-size: 1.3rem;
    margin: 0;
    line-height: 1.3;
}
.gl-end-cta .btn-marigold { min-height: 48px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ≥481px */
@media (min-width: 481px) {
    .gl-hero { padding: 56px 0 40px; }
    .gl-hero-title { font-size: 2.2rem; }
    .gl-masonry { column-count: 2; column-gap: 16px; }
    .gl-item { margin-bottom: 16px; }
    .gl-tabs ul { justify-content: center; }
}

/* ≥768px */
@media (min-width: 768px) {
    .gl-hero { padding: 72px 0 52px; }
    .gl-hero-title { font-size: 2.8rem; }
    .gl-hero-lede { font-size: 1.08rem; }

    .gl-wrap { padding: 56px 0 88px; }
    .gl-tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
    .gl-tabs li a { padding: 11px 22px; font-size: 15px; }

    .gl-masonry { column-count: 3; column-gap: 18px; }
    .gl-item { margin-bottom: 18px; border-radius: 14px; }
    .gl-caption { padding: 14px 16px 16px; font-size: 15px; }

    .gl-end-cta { padding: 56px 0; }
    .gl-end-cta-inner { flex-direction: row; justify-content: center; }
    .gl-end-cta h2 { font-size: 1.5rem; }

    .gl-lightbox.modal { padding: 50px 30px; }
    .gl-lightbox .close { top: 10px; right: 10px; }
    .gl-lightbox .prev { left: 20px; }
    .gl-lightbox .next { right: 20px; }
    .gl-lightbox .prev,
    .gl-lightbox .next { width: 54px; height: 54px; font-size: 1.8rem; }
}

/* ≥1200px */
@media (min-width: 1200px) {
    .gl-hero { padding: 88px 0 60px; }
    .gl-hero-title { font-size: 3.2rem; }
    .gl-masonry { column-count: 4; column-gap: 20px; }
    .gl-item { margin-bottom: 20px; }
}
