/* ==========================================================================
   GFW Masonry Gallery v2.2 — by FISHWINK
   ========================================================================== */

/* --- Filter Bar --- */
.gfw-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}

.gfw-filter-btn {
    background: transparent;
    border: 1.5px solid #d1d5db;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #374151;
    font-family: inherit;
}

.gfw-filter-btn:hover {
    border-color: #0646B3;
    color: #0646B3;
}

.gfw-filter-btn.active {
    background: #0646B3;
    color: #fff;
    border-color: #0646B3;
}

/* ==========================================================================
   LAYOUT: MASONRY (default)
   ========================================================================== */

.gfw-gallery[data-layout="masonry"] .gfw-gallery-grid {
    column-count: var(--gfw-columns, 3);
    column-gap: var(--gfw-gap, 12px);
}

.gfw-gallery[data-layout="masonry"] .gfw-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--gfw-gap, 12px);
}

.gfw-gallery[data-layout="masonry"] .gfw-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   LAYOUT: SQUARE
   ========================================================================== */

.gfw-gallery[data-layout="square"] .gfw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gfw-columns, 3), 1fr);
    gap: var(--gfw-gap, 12px);
}

.gfw-gallery[data-layout="square"] .gfw-gallery-item {
    aspect-ratio: 1 / 1;
}

.gfw-gallery[data-layout="square"] .gfw-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   LAYOUT: 4:3
   ========================================================================== */

.gfw-gallery[data-layout="4-3"] .gfw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gfw-columns, 3), 1fr);
    gap: var(--gfw-gap, 12px);
}

.gfw-gallery[data-layout="4-3"] .gfw-gallery-item {
    aspect-ratio: 4 / 3;
}

.gfw-gallery[data-layout="4-3"] .gfw-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   SHARED ITEM STYLES (all layouts)
   ========================================================================== */

.gfw-gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #f3f4f6;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.06);
    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.gfw-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.12);
}

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

/* Caption overlay on hover */
.gfw-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 14px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

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

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

@media (max-width: 1024px) {
    /* Masonry */
    .gfw-gallery[data-layout="masonry"] .gfw-gallery-grid { column-count: 2; }
    /* Grid layouts */
    .gfw-gallery[data-layout="square"] .gfw-gallery-grid,
    .gfw-gallery[data-layout="4-3"] .gfw-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    /* Masonry */
    .gfw-gallery[data-layout="masonry"] .gfw-gallery-grid { column-count: 1; }
    /* Grid layouts */
    .gfw-gallery[data-layout="square"] .gfw-gallery-grid,
    .gfw-gallery[data-layout="4-3"] .gfw-gallery-grid {
        grid-template-columns: 1fr;
    }
    .gfw-filter-btn { font-size: 13px; padding: 6px 14px; }
}

/* ==========================================================================
   GLIGHTBOX OVERRIDES
   ========================================================================== */

/* Force vertical stacking */
.ginner-container {
    flex-direction: column !important;
    align-items: center !important;
    max-width: 100% !important;
}

.gslide-media {
    max-width: 100% !important;
    flex-shrink: 1 !important;
}

/* Border radius on lightbox image */
.gslide-media img {
    border-radius: 10px !important;
}

/* Custom caption (injected via JS) */
.gfw-lb-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    padding: 12px 24px 0;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .gfw-lb-caption {
        font-size: 13px;
        padding: 10px 16px 0;
    }
    .gslide-media img {
        border-radius: 6px !important;
    }
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.gfw-gallery-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-style: italic;
}
