/* =====================================================
   Smart Gallery Tabs — Frontend CSS
   ===================================================== */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&display=swap');

/* ─── Wrapper ─────────────────────────────────────── */
.sgt-wrap {
    font-family: 'Oswald', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 40px;
    background: transparent;
}

/* ─── Tabs Navigation ─────────────────────────────── */
.sgt-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid #222;
    padding-bottom: 0;

    scrollbar-width: none;
    -ms-overflow-style: none;

    width: 100%;
    max-width: 100%;
}

.sgt-tabs-nav::-webkit-scrollbar {
    display: none;
}

.sgt-tabs-nav .sgt-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.sgt-tab-btn {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 10px 22px;
    background: transparent;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color .25s, border-color .25s, background .25s;
    position: relative;
    top: 2px;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;        /* tab text never wraps */
    flex-shrink: 0;             /* tabs never shrink */
}

.sgt-tab-btn:hover {
    color: #c0392b;
    background: rgba(192, 57, 43, .06);
}

.sgt-tab-btn.active {
    color: #c0392b;
    border-bottom: 3px solid #c0392b;
    background: rgba(192, 57, 43, .07);
}

/* ─── Tab Panels ─────────────────────────────────── */
.sgt-tab-panel {
    display: none;
    animation: sgt-fadein .35s ease;
}

.sgt-tab-panel.active {
    display: block;
}

@keyframes sgt-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Grid (desktop) ─────────────────────────────── */
.sgt-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 14px;
}

@media (max-width: 768px) {
    .sgt-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Mobile Slider ──────────────────────────────── */
@media (max-width: 480px) {
    .sgt-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        scroll-snap-type: x mandatory;
        padding-bottom: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .sgt-grid::-webkit-scrollbar { display: none; }

    .sgt-item {
        flex: 0 0 78vw;         /* each card = 78% of screen width */
        max-width: 78vw;
        scroll-snap-align: start;
    }
}

/* ─── Each Card ─────────────────────────────────── */
.sgt-item {
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Oswald', sans-serif;
}

/* ─── Image Wrapper (no crop + zoom) ─────────────── */
.sgt-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color .3s ease;
    cursor: pointer;
    /* fixed square box so odd-shaped patches don't distort the grid */
    aspect-ratio: 1 / 1;
    background: #f7f7f7;
}

/* Red border on hover */
.sgt-img-wrap:hover {
    border-color: #c0392b;
}

/* The photo — contain so the full patch is always visible, never cropped */
.sgt-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 10px;
    box-sizing: border-box;
    transition: transform .45s cubic-bezier(.25, .46, .45, .94);
}

/* Zoom on hover */
.sgt-img-wrap:hover img {
    transform: scale(1.10);
}

/* ─── Overlay (always visible at bottom) ─────────── */
.sgt-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 10px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
    transition: background .3s;
}

.sgt-img-wrap:hover .sgt-overlay {
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,0) 100%);
}

/* ─── Label (White text — bottom left) ──────────── */
.sgt-label {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: .03em;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    flex: 1;
}

/* ─── Badge (Red pill — bottom right) ───────────── */
.sgt-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #ffffff;
    background: #c0392b;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Empty state ────────────────────────────────── */
.sgt-empty {
    color: #999;
    font-style: italic;
    padding: 20px 0;
    grid-column: 1 / -1;
}

/* ─── Slider Wrapper ─────────────────────────────── */
.sgt-slider-wrap {
    position: relative;
}

/* ─── Arrows (hidden on desktop, visible on mobile) ─ */
.sgt-arrow {
    display: none; /* hidden by default — shown via media query below */
}

/* ─── Dots (hidden on desktop) ──────────────────── */
.sgt-dots {
    display: none;
}

/* ══════════════════════════════════════════════════
   MOBILE — Slider + Arrows + Dots
══════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* ── Arrows ── */
    .sgt-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-60%); /* slightly above center, above the dots */
        z-index: 10;
        width: 36px;
        height: 36px;
        background: #c0392b;
        border: none;
        border-radius: 50%;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,.35);
        transition: background .2s, opacity .2s, transform .2s;
        padding: 0;
    }

    .sgt-arrow svg {
        width: 18px;
        height: 18px;
        display: block;
    }

    .sgt-arrow-prev { left: 4px; }
    .sgt-arrow-next { right: 4px; }

    .sgt-arrow:hover  { background: #a93226; }
    .sgt-arrow:active { transform: translateY(-60%) scale(.92); }

    .sgt-arrow.disabled {
        opacity: .3;
        pointer-events: none;
    }

    /* ── Dots ── */
    .sgt-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 7px;
        margin-top: 14px;
        padding-bottom: 4px;
    }

    .sgt-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: background .2s, transform .2s;
        flex-shrink: 0;
    }

    .sgt-dot.active {
        background: #c0392b;
        transform: scale(1.35);
    }

    /* Push grid slightly inward so arrows don't overlap first/last card */
    .sgt-slider-wrap .sgt-grid {
        padding-left: 44px;
        padding-right: 44px;
    }
}

/* ══════════════════════════════════════════════════
   LIGHTBOX — click an image to view full size + slide
══════════════════════════════════════════════════ */
.sgt-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.sgt-lightbox.active {
    display: flex;
    animation: sgt-fadein .25s ease;
}

.sgt-lightbox-inner {
    position: relative;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sgt-lightbox-img-wrap {
    width: 100%;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgt-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    background: #f7f7f7;
    padding: 10px;
    box-sizing: border-box;
}

.sgt-lightbox-caption {
    font-family: 'Oswald', sans-serif;
    color: #fff;
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    letter-spacing: .04em;
}

.sgt-lightbox-caption .sgt-lightbox-badge {
    display: inline-block;
    margin-left: 8px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
}

.sgt-lightbox-close {
    position: absolute;
    top: -46px;
    right: 0;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.sgt-lightbox-close:hover { color: #c0392b; }

.sgt-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, .1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}

.sgt-lightbox-arrow:hover { background: #c0392b; }
.sgt-lightbox-arrow svg { width: 22px; height: 22px; }

.sgt-lightbox-prev { left: -58px; }
.sgt-lightbox-next { right: -58px; }

.sgt-lightbox-counter {
    color: #999;
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    letter-spacing: .06em;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .sgt-lightbox-prev { left: 6px; }
    .sgt-lightbox-next { right: 6px; }
    .sgt-lightbox-arrow { width: 38px; height: 38px; background: rgba(0,0,0,.5); }
    .sgt-lightbox-close { top: 8px; right: 8px; }
}
