/* ============================================================
   GALLERY PAGE STYLES
   gallery.css | Loaded only on gallery.php
   Supports both image and video tiles with lightbox.
   ============================================================ */

/* ---------- BANNER ---------- */
.gallery-banner {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(80px, 12vw, 160px) 0 clamp(56px, 8vw, 110px);
    background:
        radial-gradient(ellipse 70% 60% at 75% 0%, rgba(34,197,94,.14) 0%, transparent 60%),
        linear-gradient(180deg, #fcfffb 0%, #eef6e9 100%);
}
.gallery-banner::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
    z-index: -1;
}
.gallery-banner__inner { text-align: center; max-width: 760px; margin: 0 auto; }
.gallery-banner h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -.025em;
    line-height: 1.05;
    margin: 0 0 18px;
}
.gallery-banner .lead {
    color: var(--be-text-2);
    font-size: 1.1rem;
    margin: 0 auto 24px;
    max-width: 580px;
}
.gallery-banner__crumb {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--be-font-display);
    font-size: 13px; font-weight: 600;
    color: var(--be-text-2);
    background: rgba(255,255,255,.7);
    border: 1px solid var(--be-line);
    padding: 8px 18px;
    border-radius: var(--be-radius-pill);
    backdrop-filter: blur(8px);
}
.gallery-banner__crumb a { color: var(--be-green-700); font-weight: 700; }
.gallery-banner__crumb i { color: var(--be-muted); font-size: 10px; }

/* ---------- FILTER PILLS ---------- */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: clamp(32px, 4vw, 48px);
}
.gallery-filter {
    background: #fff;
    border: 1.5px solid var(--be-line);
    color: var(--be-ink);
    font-family: var(--be-font-display);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--be-radius-pill);
    cursor: pointer;
    transition: all .25s var(--be-ease);
    display: inline-flex; align-items: center; gap: 8px;
}
.gallery-filter:hover {
    border-color: var(--be-green-300);
    color: var(--be-green-700);
    background: var(--be-green-50);
}
.gallery-filter.is-active {
    background: var(--be-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--be-shadow-green);
}
.gallery-filter__count {
    background: rgba(255,255,255,.18);
    padding: 1px 8px;
    border-radius: var(--be-radius-pill);
    font-size: 11.5px;
    font-weight: 700;
}
.gallery-filter:not(.is-active) .gallery-filter__count {
    background: var(--be-bg-soft);
    color: var(--be-text-2);
}

/* ---------- GRID (masonry-ish via CSS columns) ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    grid-auto-flow: dense;
    gap: 16px;
}
@media (max-width: 1100px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 280px; } }

.gallery-item {
    position: relative;
    border-radius: var(--be-radius-lg);
    overflow: hidden;
    box-shadow: var(--be-shadow);
    cursor: pointer;
    transition: transform .35s var(--be-ease), box-shadow .35s var(--be-ease), opacity .35s ease;
}
.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--be-shadow-md);
}
.gallery-item.is-hidden {
    display: none;
}

.gallery-item--wide { grid-column: span 2; }
.gallery-item--tall { grid-row: span 2; }
.gallery-item--big  { grid-column: span 2; grid-row: span 2; }
@media (max-width: 800px) {
    .gallery-item--wide, .gallery-item--big { grid-column: span 2; }
    .gallery-item--tall { grid-row: span 1; }
}
@media (max-width: 480px) {
    .gallery-item--wide, .gallery-item--big, .gallery-item--tall { grid-column: span 1; grid-row: span 1; }
}

.gallery-item img,
.gallery-item video,
.gallery-item__thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .8s var(--be-ease);
}
.gallery-item:hover img,
.gallery-item:hover .gallery-item__thumb,
.gallery-item:hover video {
    transform: scale(1.06);
}

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(11,22,32,.85) 100%);
    opacity: 0;
    transition: opacity .35s var(--be-ease);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    color: #fff;
}
.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}
.gallery-item__cat {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 12px;
    background: var(--be-gradient);
    border-radius: var(--be-radius-pill);
    font-family: var(--be-font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    box-shadow: var(--be-shadow-green);
    transform: translateY(8px);
    opacity: 0;
    transition: opacity .3s ease .05s, transform .3s ease .05s;
}
.gallery-item__title {
    font-family: var(--be-font-display);
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0 0 4px;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity .3s ease .1s, transform .3s ease .1s;
}
.gallery-item__desc {
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    line-height: 1.55;
    margin: 0;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity .3s ease .15s, transform .3s ease .15s;
}
.gallery-item:hover .gallery-item__cat,
.gallery-item:hover .gallery-item__title,
.gallery-item:hover .gallery-item__desc {
    transform: translateY(0);
    opacity: 1;
}

/* Play icon for video tiles */
.gallery-item__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: var(--be-green-700);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    box-shadow: 0 16px 36px rgba(15,23,42,.25);
    pointer-events: none;
    z-index: 3;
    transition: transform .35s var(--be-ease-spring), background .25s ease;
}
.gallery-item__play::before {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5);
    animation: be-ping 1.8s ease-out infinite;
}
.gallery-item:hover .gallery-item__play {
    transform: translate(-50%, -50%) scale(1.08);
    background: #fff;
}

/* Empty / no-results state */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    color: var(--be-text-2);
    background: var(--be-bg-soft);
    border-radius: var(--be-radius-lg);
    font-family: var(--be-font-display);
}
.gallery-empty i { font-size: 32px; color: var(--be-muted); margin-bottom: 12px; display: block; }

/* ---------- LIGHTBOX ---------- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11,22,32,.92);
    backdrop-filter: blur(8px);
}
.gallery-lightbox.is-open {
    display: flex;
    animation: be-fade-in .25s var(--be-ease) both;
}
.gallery-lightbox__media {
    max-width: 92vw;
    max-height: 86vh;
    border-radius: var(--be-radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    animation: lightbox-zoom .35s var(--be-ease-spring) both;
}
.gallery-lightbox__media img,
.gallery-lightbox__media video {
    display: block;
    max-width: 92vw;
    max-height: 86vh;
    border-radius: var(--be-radius-lg);
    object-fit: contain;
    background: #000;
}
@keyframes lightbox-zoom {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: absolute;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .25s ease, transform .25s var(--be-ease-spring);
    font-size: 18px;
    z-index: 2;
}
.gallery-lightbox__close { top: 24px; right: 24px; }
.gallery-lightbox__nav--prev { top: 50%; left: 24px; transform: translateY(-50%); }
.gallery-lightbox__nav--next { top: 50%; right: 24px; transform: translateY(-50%); }
.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
    background: var(--be-gradient);
    border-color: transparent;
}
.gallery-lightbox__nav--prev:hover,
.gallery-lightbox__nav--next:hover {
    transform: translateY(-50%) scale(1.08);
}

.gallery-lightbox__caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(0,0,0,.6);
    border: 1px solid rgba(255,255,255,.10);
    color: #fff;
    border-radius: var(--be-radius-pill);
    font-family: var(--be-font-display);
    font-size: 13px;
    font-weight: 600;
    max-width: calc(100% - 48px);
    text-align: center;
}
@media (max-width: 540px) {
    .gallery-lightbox__close { top: 14px; right: 14px; width: 42px; height: 42px; }
    .gallery-lightbox__nav { width: 42px; height: 42px; }
    .gallery-lightbox__nav--prev { left: 8px; }
    .gallery-lightbox__nav--next { right: 8px; }
}

/* ---------- CTA SECTION (final) ---------- */
.gallery-cta {
    background: var(--be-gradient-dark);
    color: #fff;
    border-radius: var(--be-radius-xl);
    padding: clamp(40px, 5vw, 60px);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}
.gallery-cta::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(34,197,94,.22) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(164,198,57,.16) 0%, transparent 50%);
    z-index: -1;
}
.gallery-cta h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 12px; }
.gallery-cta p { color: rgba(255,255,255,.78); max-width: 580px; margin: 0 auto 26px; font-size: 1.02rem; }
