/**
 * ITSWEBER CMS – Modern Gallery Lightbox (v3.0.6)
 *
 * Theme-adaptive via CSS custom properties.
 * Each theme can override these variables in its own style.css:
 *
 *   --glb-bg:              Backdrop overlay color
 *   --glb-panel-bg:        Info panel background
 *   --glb-panel-text:      Info panel text color
 *   --glb-accent:          Badge / accent color
 *   --glb-accent-text:     Badge text color
 *   --glb-btn-bg:          Button background
 *   --glb-btn-hover:       Button hover background
 *   --glb-btn-text:        Button icon/text color
 *   --glb-border:          Subtle border color
 *   --glb-share-bg:        Share button background
 *   --glb-share-hover:     Share button hover background
 *   --glb-radius:          Border radius
 *
 * © ITSWEBER – All rights reserved.
 */

/* ─── CSS Custom Property Defaults ───────────────────────────────────── */
:root {
    --glb-bg:           rgba(0, 0, 0, 0.88);
    --glb-panel-bg:     #ffffff;
    --glb-panel-text:   #1a1a1a;
    --glb-accent:       #2563eb;
    --glb-accent-text:  #ffffff;
    --glb-btn-bg:       rgba(255, 255, 255, 0.12);
    --glb-btn-hover:    rgba(255, 255, 255, 0.22);
    --glb-btn-text:     #ffffff;
    --glb-border:       rgba(0, 0, 0, 0.08);
    --glb-share-bg:     #f3f4f6;
    --glb-share-hover:  #e5e7eb;
    --glb-radius:       12px;
}

/* ─── Lightbox Overlay ───────────────────────────────────────────────── */
.glb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.glb.glb-open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: glbFadeIn 0.2s ease-out;
}

.glb-backdrop {
    position: absolute;
    inset: 0;
    background: var(--glb-bg);
}

@keyframes glbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes glbSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Container (the white card) ─────────────────────────────────────── */
.glb-container {
    position: relative;
    z-index: 1;
    width: 92vw;
    max-width: 1100px;
    height: auto;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: glbSlideUp 0.25s ease-out;
}

/* ─── Close Button ───────────────────────────────────────────────────── */
.glb-close {
    position: absolute;
    top: -44px;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--glb-btn-bg);
    color: var(--glb-btn-text);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.glb-close:hover {
    background: var(--glb-btn-hover);
    transform: scale(1.1);
}

.glb-close:focus-visible {
    outline: 2px solid var(--glb-accent);
    outline-offset: 2px;
}

/* ─── Navigation Buttons ─────────────────────────────────────────────── */
.glb-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--glb-btn-bg);
    color: var(--glb-btn-text);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.glb-prev { left: -56px; }
.glb-next { right: -56px; }

.glb-nav:hover:not(:disabled) {
    background: var(--glb-btn-hover);
    transform: translateY(-50%) scale(1.1);
}

.glb-nav:disabled {
    cursor: default;
    opacity: 0.3;
}

.glb-nav:focus-visible {
    outline: 2px solid var(--glb-accent);
    outline-offset: 2px;
}

/* ─── Body (split panel layout) ──────────────────────────────────────── */
.glb-body {
    display: flex;
    border-radius: var(--glb-radius);
    overflow: hidden;
    background: var(--glb-panel-bg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 88vh;
}

/* ─── Image Panel ────────────────────────────────────────────────────── */
.glb-image-panel {
    flex: 1 1 62%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    overflow: hidden;
}

.glb-img {
    display: block;
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
    user-select: none;
}

/* ─── Info Sidebar ───────────────────────────────────────────────────── */
.glb-info-panel {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    color: var(--glb-panel-text);
    border-left: 1px solid var(--glb-border);
    overflow-y: auto;
}

.glb-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Badge */
.glb-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--glb-accent);
    color: var(--glb-accent-text);
    border-radius: 20px;
    white-space: nowrap;
}

/* Counter */
.glb-counter {
    font-size: 0.82rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

/* Title */
.glb-title {
    margin: 0 0 12px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--glb-panel-text);
}

/* Description */
.glb-description {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #4b5563;
}

/* ─── Share Section ──────────────────────────────────────────────────── */
.glb-share {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glb-border);
}

.glb-share-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 10px;
}

.glb-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.glb-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

/* Branded share button colors */
.glb-share-btn[data-type="whatsapp"] {
    background: #25d366;
    color: #ffffff;
}
.glb-share-btn[data-type="whatsapp"]:hover {
    background: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,211,102,0.35);
}

.glb-share-btn[data-type="tiktok"] {
    background: #010101;
    color: #ffffff;
}
.glb-share-btn[data-type="tiktok"]:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.glb-share-btn[data-type="pinterest"] {
    background: #e60023;
    color: #ffffff;
}
.glb-share-btn[data-type="pinterest"]:hover {
    background: #cc001f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230,0,35,0.35);
}

.glb-share-btn[data-type="copy"] {
    background: var(--glb-share-bg);
    color: #374151;
}
.glb-share-btn[data-type="copy"]:hover {
    background: var(--glb-share-hover);
    color: var(--glb-accent);
    transform: translateY(-2px);
}

.glb-share-btn--copied {
    background: #dcfce7 !important;
    color: #16a34a !important;
    box-shadow: 0 4px 12px rgba(22,163,106,0.25) !important;
}

.glb-share-btn:focus-visible {
    outline: 2px solid var(--glb-accent);
    outline-offset: 2px;
}

/* ─── Mobile Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
    .glb-container {
        width: 96vw;
        max-height: 94vh;
    }

    .glb-body {
        flex-direction: column;
        max-height: 92vh;
    }

    .glb-image-panel {
        flex: 0 0 auto;
        max-height: 55vh;
    }

    .glb-img {
        max-height: 55vh;
    }

    .glb-info-panel {
        flex: 1 1 auto;
        width: 100%;
        padding: 18px 16px;
        border-left: none;
        border-top: 1px solid var(--glb-border);
        max-height: 35vh;
        overflow-y: auto;
    }

    .glb-nav {
        width: 38px;
        height: 38px;
    }

    .glb-prev { left: 8px; }
    .glb-next { right: 8px; }

    .glb-close {
        top: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.5);
    }

    .glb-title {
        font-size: 1.05rem;
    }

    .glb-share-buttons {
        gap: 6px;
    }

    .glb-share-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .glb-container {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
    }

    .glb-body {
        border-radius: 0;
        max-height: 100vh;
    }

    .glb-image-panel {
        max-height: 50vh;
    }

    .glb-img {
        max-height: 50vh;
    }

    .glb-info-panel {
        padding: 14px 12px;
        max-height: 45vh;
    }

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