/* === Theme Variables === */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --accent-color: #3b82f6;
    --gallery-text-bg: #fafafa;
    --gallery-text-color: #1f2937;
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    --border-color: #374151;
    --accent-color: #60a5fa;
    --gallery-text-bg: #1f2937;
    --gallery-text-color: #f9fafb;
}

/* === Thumbnails === */
.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-radius: 8px;
    width: 100%;
    height: 100%;
}
.video-placeholder .play-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-placeholder .play-icon svg {
    width: 20px;
    height: 20px;
    fill: #1f2937;
    margin-left: 3px;
}

.is-video .video-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.text-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    width: 100%;
    height: 100%;
}
.text-thumbnail .text-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* === Lightbox: Basic Theme Support === */
.gslide-title {
    font-weight: 700;
    color: var(--text-primary);
}

.gslide-description,
.gslide-description .gdesc-inner {
    background: var(--gallery-text-bg) !important;
}

.gslide-desc,
.gslide-desc .text-expanded {
    color: var(--gallery-text-color);
    background: var(--gallery-text-bg);
}

/* Desktop: Dark mode title fix - GLightbox default overrides */
@media (min-width: 769px) {
    [data-theme="dark"] .gslide-title {
        color: #ffffff !important;
    }
}

/* Desktop: Photos/Videos - description at TOP, transparent background */
@media (min-width: 769px) {
    .glightbox-container .gslide-image .gslide-description,
    .glightbox-container .gslide-video .gslide-description {
        position: absolute !important;
        top: 0 !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: transparent !important;
        padding: 12px 16px !important;
        border: none !important;
    }
    .glightbox-container .gslide-image .gslide-description .gdesc-inner,
    .glightbox-container .gslide-video .gslide-description .gdesc-inner {
        background: transparent !important;
        padding: 0 !important;
    }
    .glightbox-container .gslide-image .gslide-description .gslide-title,
    .glightbox-container .gslide-video .gslide-description .gslide-title {
        color: #fff !important;
    }
}

/* === Mobile Fix === */
@media (max-width: 768px) {
    .glightbox-container,
    .glightbox-mobile .gslide.current .ginner-container,
    .glightbox-mobile .gslide.current .gslide-inner-content {
        height: 100dvh !important;
    }
    .goverlay {
        height: 100% !important;
        top: 0 !important;
    }
    /* Override GLightbox mobile defaults - force description to TOP */
    .glightbox-mobile .glightbox-container .gslide-description {
        position: absolute !important;
        top: 0 !important;
        bottom: auto !important;
        order: 0 !important;
        background: transparent !important;
        max-height: none !important;
        padding: 12px 16px !important;
        width: 100% !important;
    }
    .glightbox-mobile .glightbox-container .gslide-description .gdesc-inner {
        background: transparent !important;
        padding: 0 !important;
    }
    .glightbox-mobile .glightbox-container .gslide-description .gslide-title {
        color: #fff !important;
    }
    .glightbox-mobile .glightbox-container .gslide-description .gslide-desc {
        color: #ddd !important;
    }
}
