/* =============================================================
   TEAM GLAM — Editorial Lookbook Gallery Widget CSS
   ============================================================= */

.tg-elg-wrapper {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: clamp(30px, 4vw, 60px) 20px;
}

/* ── HEADER AREA ──────────────────────────────────────────── */
.tg-elg-header {
    text-align: center;
    margin-bottom: clamp(32px, 4.5vw, 54px);
    box-sizing: border-box;
}

.tg-elg-date {
    display: block;
    font-family: var(--tg-font-body, 'brandon-grotesque', sans-serif);
    font-size: clamp(10.5px, 0.9vw, 12px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #888888;
    margin-bottom: 10px;
}

.tg-elg-title {
    font-family: var(--tg-font-heading, 'beaufort-pro', Georgia, serif);
    font-size: clamp(28px, 3.5vw, 46px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: #111111;
    margin: 0 0 10px 0;
}

.tg-elg-desc {
    font-family: var(--tg-font-body, 'brandon-grotesque', sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #555555;
    max-width: 600px;
    margin: 0 auto;
}

/* ── GALLERY GRID (Screenshot 1) ──────────────────────────── */
.tg-elg-grid {
    display: grid;
    grid-template-columns: repeat(var(--tg-elg-cols, 2), 1fr);
    gap: var(--tg-elg-gap, 18px);
    width: 100%;
    box-sizing: border-box;
}

.tg-elg-item {
    position: relative;
    width: 100%;
    aspect-ratio: var(--tg-elg-aspect, 4 / 5);
    overflow: hidden;
    background-color: transparent;
    cursor: pointer;
    box-sizing: border-box;
    display: block;
}

.tg-elg-item img.tg-elg-img,
.tg-elg-item .tg-elg-img,
.tg-elg-img {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: var(--tg-elg-fit, cover) !important;
    object-position: var(--tg-elg-position, center center) !important;
    display: block !important;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
}

.tg-elg-item:hover img.tg-elg-img,
.tg-elg-item:hover .tg-elg-img {
    transform: scale(1.03);
}

/* ── FULLSCREEN EDITORIAL LIGHTBOX MODAL (Screenshot 2) ────── */
.tg-elg-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: var(--tg-elg-modal-bg, #ffffff) !important;
    z-index: 2147483647 !important; /* Above WordPress admin bar and all headers */
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.tg-elg-modal.is-active {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ── Top Bar: Segmented Dash Indicator + Brand + Close ────── */
.tg-elg-modal-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: auto;
}

.tg-elg-modal-indicators {
    width: 100%;
    display: flex;
    gap: 3px;
    padding: 0;
    margin: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.08);
}

.tg-elg-indicator-bar {
    flex: 1;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.25s ease;
}

.tg-elg-indicator-bar.is-active {
    background-color: #111111;
}

.tg-elg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    width: 100%;
    box-sizing: border-box;
}

.tg-elg-modal-brand {
    font-family: var(--tg-font-body, 'brandon-grotesque', sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #111111;
    margin: 0;
    line-height: 1;
}

.tg-elg-modal-close {
    background: transparent;
    border: none;
    color: #111111;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    line-height: 1;
}

.tg-elg-modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.6;
}

.tg-elg-modal-close:hover {
    transform: scale(1.15);
    opacity: 0.6;
}

/* ── Modal Center Stage ────────────────────────────────────── */
.tg-elg-modal-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 30px 80px;
    box-sizing: border-box;
    user-select: none;
    z-index: 10;
}

.tg-elg-modal-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 100%;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
}

.tg-elg-modal-img {
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    max-width: calc(100vw - 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tg-elg-modal-img.is-loading {
    opacity: 0.4;
    transform: scale(0.985);
}

/* ── Left / Right Minimalist Chevron Navigation ───────────── */
.tg-elg-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #111111;
    cursor: pointer;
    padding: 24px 18px;
    z-index: 40;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tg-elg-nav-btn svg {
    width: 20px;
    height: 40px;
    stroke: currentColor;
    stroke-width: 1.4;
    fill: none;
}

.tg-elg-nav-btn:hover {
    opacity: 0.5;
}

.tg-elg-nav-prev {
    left: 20px;
}
.tg-elg-nav-prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

.tg-elg-nav-next {
    right: 20px;
}
.tg-elg-nav-next:hover {
    transform: translateY(-50%) translateX(3px);
}

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 1024px) {
    .tg-elg-grid {
        grid-template-columns: repeat(var(--tg-elg-cols-tablet, 2), 1fr);
        gap: var(--tg-elg-gap-tablet, 14px);
    }

    .tg-elg-modal-stage {
        padding: 56px 50px 24px 50px;
    }

    .tg-elg-modal-img {
        max-width: calc(100vw - 110px);
    }

    .tg-elg-nav-prev {
        left: 10px;
    }
    .tg-elg-nav-next {
        right: 10px;
    }
}

@media (max-width: 767px) {
    .tg-elg-wrapper {
        padding: 24px 14px;
    }

    .tg-elg-grid {
        grid-template-columns: repeat(var(--tg-elg-cols-mobile, 2), 1fr);
        gap: var(--tg-elg-gap-mobile, 10px);
    }

    .tg-elg-header {
        margin-bottom: 24px;
    }

    .tg-elg-title {
        font-size: clamp(24px, 6.5vw, 32px);
    }

    .tg-elg-modal-header {
        padding: 12px 18px;
    }

    .tg-elg-modal-brand {
        font-size: 11.5px;
    }

    .tg-elg-modal-stage {
        padding: 50px 14px 20px 14px;
    }

    .tg-elg-modal-img {
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
        max-width: 95vw;
    }

    .tg-elg-nav-btn {
        padding: 12px 6px;
    }
    .tg-elg-nav-btn svg {
        width: 14px;
        height: 28px;
    }
    .tg-elg-nav-prev {
        left: 2px;
    }
    .tg-elg-nav-next {
        right: 2px;
    }
}
