/**
 * TEF Gallery Component Stylesheet (gallery.css)
 *
 * Professional, accessible, responsive styling for TEF media galleries
 * Works seamlessly with any lightbox presentation adapter
 */

.tef-gallery-container {
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.tef-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

@media (max-width: 640px) {
    .tef-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

.tef-gallery-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.tef-gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(36, 62, 54, 0.12);
    border-color: rgba(36, 62, 54, 0.25);
}

.media-gallery-item {
    display: block;
    position: relative;
    text-decoration: none;
    outline: none;
    color: inherit;
}

.media-gallery-item:focus-visible {
    outline: 3px solid #243e36;
    outline-offset: 2px;
    border-radius: 8px;
}

.tef-gallery-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #f1f5f9;
}

.tef-gallery-picture {
    display: block;
    width: 100%;
    height: 100%;
}

.tef-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.media-gallery-item:hover .tef-gallery-image {
    transform: scale(1.06);
}

.tef-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(36, 62, 54, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.media-gallery-item:hover .tef-gallery-overlay,
.media-gallery-item:focus-visible .tef-gallery-overlay {
    opacity: 1;
}

.tef-gallery-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #243e36;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transform: scale(0.85);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.media-gallery-item:hover .tef-gallery-badge {
    transform: scale(1);
}

.tef-badge-video {
    background: #e74c3c;
    color: #ffffff;
}

.tef-gallery-caption-box {
    padding: 10px 14px 12px;
    flex: 1;
    background: #ffffff;
}

.tef-gallery-caption-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #4b5563;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lightbox overlay custom styling integration */
.glightbox-clean .gslide-description {
    background: rgba(20, 30, 26, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 12px !important;
    padding: 16px 24px !important;
    max-width: 700px !important;
    margin: 0 auto 20px !important;
}

.glightbox-clean .gslide-title {
    font-family: 'Prompt', 'Sarabun', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 6px !important;
}

.glightbox-clean .gslide-desc {
    font-family: 'Prompt', 'Sarabun', sans-serif !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    color: #e5e7eb !important;
}

.tef-gallery-action-btn:hover {
    background: rgba(36, 62, 54, 0.85) !important;
    transform: scale(1.08);
}
