/* =====================================================
   Featured Gallery — Frontend Styles
   ===================================================== */

/* ── Base container ── */
.fg-gallery {
    position: relative;
    width: 100%;
    margin: 1.5em 0;
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════
   SLIDER
   ═══════════════════════════════════════════════════ */
.fg-style-slider {
    overflow: hidden;
    border-radius: 8px;
    background: #111;
}

.fg-slider-track {
    display: flex;
    transition: transform .45s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

.fg-slide {
    flex: 0 0 100%;
    position: relative;
    overflow: hidden;
    max-height: 520px;
}

.fg-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 520px;
    transition: transform .3s ease;
}

.fg-slide:hover img {
    transform: scale(1.02);
}

/* Prev / Next arrows */
.fg-prev,
.fg-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fg-prev { left: 12px; }
.fg-next { right: 12px; }

.fg-prev:hover,
.fg-next:hover {
    background: rgba(0,0,0,.75);
}

/* Dots */
.fg-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.fg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.fg-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* Caption */
.fg-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff;
    font-size: .9em;
    text-align: center;
}

/* ═══════════════════════════════════════════════════
   GRID
   ═══════════════════════════════════════════════════ */
.fg-style-grid .fg-grid-inner {
    display: grid;
    gap: 8px;
}

.fg-style-grid .fg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fg-style-grid .fg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.fg-style-grid .fg-cols-4 { grid-template-columns: repeat(4, 1fr); }

.fg-style-grid .fg-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 1;
    background: #eee;
}

.fg-style-grid .fg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.fg-style-grid .fg-item:hover img {
    transform: scale(1.06);
}

/* ═══════════════════════════════════════════════════
   MASONRY
   ═══════════════════════════════════════════════════ */
.fg-style-masonry .fg-grid-inner {
    columns: 3;
    column-gap: 8px;
}

.fg-style-masonry .fg-cols-2 { columns: 2; }
.fg-style-masonry .fg-cols-4 { columns: 4; }

.fg-style-masonry .fg-item {
    break-inside: avoid;
    margin-bottom: 8px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: #eee;
}

.fg-style-masonry .fg-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .3s ease;
}

.fg-style-masonry .fg-item:hover img {
    transform: scale(1.04);
}

/* Grid/Masonry caption */
.fg-style-grid .fg-caption,
.fg-style-masonry .fg-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: .8em;
    opacity: 0;
    transition: opacity .2s;
}

.fg-style-grid .fg-item:hover .fg-caption,
.fg-style-masonry .fg-item:hover .fg-caption {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════ */
.fg-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fg-fade-in .2s ease;
}

@keyframes fg-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fg-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fg-lightbox-inner img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.fg-lightbox-caption {
    color: #ddd;
    font-size: .9em;
    margin-top: 10px;
    text-align: center;
}

.fg-lightbox-close {
    position: absolute;
    top: -36px;
    right: -8px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    opacity: .8;
    transition: opacity .15s;
}

.fg-lightbox-close:hover { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .fg-style-grid .fg-cols-3,
    .fg-style-grid .fg-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .fg-style-masonry { columns: 2 !important; }
}

@media (max-width: 400px) {
    .fg-style-grid .fg-cols-2,
    .fg-style-grid .fg-cols-3,
    .fg-style-grid .fg-cols-4 { grid-template-columns: 1fr; }
    .fg-style-masonry { columns: 1 !important; }
}
