/* ══════════════════════════════════
   CSFV Gallery — Front-End Styles
   ══════════════════════════════════ */

:root {
    --csfv-primary: #004b66;
    --csfv-primary-light: #006b8f;
    --csfv-accent: #e8f4f8;
    --csfv-gold: #c9962a;
}

.csfv-gallery-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── FILTER BAR ── */
.csfv-filter-bar {
    position: relative;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s;
}
.csfv-filter-bar.csfv-stuck {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.csfv-filter-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Filter buttons */
.csfv-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.22s ease;
    background: white;
    color: #64748b;
    border-color: #e2e8f0;
    font-family: inherit;
    line-height: 1;
}
.csfv-filter-btn .material-symbols-outlined {
    font-size: 16px;
}
.csfv-filter-btn:hover {
    border-color: var(--csfv-primary);
    color: var(--csfv-primary);
}
.csfv-filter-btn.active {
    background: var(--csfv-primary);
    color: white;
    border-color: var(--csfv-primary);
}

.csfv-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 10px;
    padding: 1px 7px;
    font-weight: 700;
}
.csfv-filter-btn:not(.active) .csfv-count {
    background: #f1f5f9;
    color: #94a3b8;
}

.csfv-photo-count {
    margin-left: auto;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* ── MASONRY GALLERY ── */
.csfv-gallery-masonry {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    columns: 3;
    column-gap: 16px;
}
@media (max-width: 1024px) {
    .csfv-gallery-masonry { columns: 2; }
}
@media (max-width: 640px) {
    .csfv-gallery-masonry { columns: 1; }
}

/* Gallery item */
.csfv-gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    display: block;
}
.csfv-gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.csfv-gallery-item:hover img {
    transform: scale(1.07);
}

/* Overlay */
.csfv-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 30, 45, 0.75) 0%, rgba(0, 0, 0, 0) 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
}
.csfv-gallery-item:hover .csfv-overlay {
    opacity: 1;
}
.csfv-overlay-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}
.csfv-overlay-title {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: white;
    line-height: 1.2;
}

/* Zoom icon */
.csfv-zoom-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.csfv-gallery-item:hover .csfv-zoom-icon {
    opacity: 1;
    transform: scale(1);
}
.csfv-zoom-icon .material-symbols-outlined {
    font-size: 18px;
    color: var(--csfv-primary);
}

/* Category dot */
.csfv-cat-dot {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.85);
    color: var(--csfv-primary);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.csfv-gallery-item:hover .csfv-cat-dot {
    opacity: 1;
    transform: translateY(0);
}

/* Hidden / Filter */
.csfv-gallery-item.csfv-hidden-item {
    display: none;
}

/* ── Reveal animation ── */
.csfv-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.csfv-reveal.csfv-visible {
    opacity: 1;
    transform: none;
}
.csfv-delay-1 { transition-delay: 0.1s; }
.csfv-delay-2 { transition-delay: 0.2s; }
.csfv-delay-3 { transition-delay: 0.3s; }

/* No results */
.csfv-no-results {
    text-align: center;
    padding: 80px 20px;
    max-width: 1280px;
    margin: 0 auto;
}
.csfv-no-results .material-symbols-outlined {
    font-size: 48px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 12px;
}
.csfv-no-results p {
    color: #94a3b8;
    font-weight: 500;
    font-size: 15px;
}

/* ══════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════ */
.csfv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 20, 30, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.csfv-lightbox.csfv-lb-open {
    opacity: 1;
    pointer-events: all;
}

.csfv-lb-img-wrap {
    position: relative;
    max-width: 88vw;
    max-height: 85vh;
}
#csfv-lb-img {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}
.csfv-lightbox.csfv-lb-open #csfv-lb-img {
    transform: scale(1);
}

/* Close */
.csfv-lb-close {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    z-index: 10;
}
.csfv-lb-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Prev / Next */
.csfv-lb-prev,
.csfv-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    z-index: 10;
}
.csfv-lb-prev:hover,
.csfv-lb-next:hover {
    background: rgba(255, 255, 255, 0.2);
}
.csfv-lb-prev { left: 24px; }
.csfv-lb-next { right: 24px; }

/* Counter */
.csfv-lb-counter {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    z-index: 10;
}

/* Caption */
.csfv-lb-caption {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    z-index: 10;
    max-width: 600px;
    padding: 0 20px;
}
.csfv-lb-title {
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    color: white;
}
.csfv-lb-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4px;
    line-height: 1.4;
}
.csfv-lb-cat {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
    .csfv-filter-inner {
        padding: 10px 16px;
        gap: 6px;
    }
    .csfv-filter-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
    .csfv-photo-count {
        display: none;
    }
    .csfv-gallery-masonry {
        padding: 24px 16px;
    }
    .csfv-lb-prev { left: 10px; width: 40px; height: 40px; }
    .csfv-lb-next { right: 10px; width: 40px; height: 40px; }
    .csfv-lb-close { top: 14px; right: 14px; width: 40px; height: 40px; }
    .csfv-lb-caption { bottom: 16px; }
    .csfv-lb-title { font-size: 16px; }
}

/* ── Touch swipe hint ── */
@media (hover: none) {
    .csfv-overlay { opacity: 0.6; }
    .csfv-cat-dot { opacity: 1; transform: translateY(0); }
    .csfv-zoom-icon { display: none; }
}
