/* Media Gallery - Modern 2025 UI */

.media-gallery-section {
    padding: 20px;
}

.media-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 auto 16px auto;
    max-width: 1200px;
}

.filters-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-chip {
    appearance: none;
    border: 1px solid #e1e5e9;
    background: #fff;
    color: #333;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.08s ease;
    user-select: none;
}

.filter-chip:hover {
    border-color: #c9d1d9;
}

.filter-chip.active {
    background: #0078D4;
    color: #fff;
    border-color: #0078D4;
}

.filter-chip:focus,
.filter-chip:focus-visible {
    outline: 3px solid #0a66ff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2);
}

.toolbar-spacer {
    flex: 1;
}

.search-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    background: #fff;
    min-width: 220px;
}

.search-input input {
    border: none;
    outline: none;
    width: 180px;
    font-size: 14px;
    background: transparent;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.media-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    background: #fff;
    aspect-ratio: 1 / 1;
    transform: translateZ(0);
}

.media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
    display: block;
    background: #f5f7f9;
}

.media-card:hover img {
    transform: scale(1.03);
}

.media-overlay {
    position: absolute;
    inset: auto 8px 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 12px;
}

.overlay-left {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.overlay-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.overlay-text {
    opacity: 0.9;
}

/* Lightbox adjustments for consistency (uses existing HTML) */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: zoom-out;
}

#lightbox-img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

#lightbox .close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

@media (max-width: 768px) {
    .media-toolbar {
        gap: 10px;
    }
    .search-input {
        min-width: 0;
        width: 100%;
    }
    .search-input input {
        width: 100%;
    }
}

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.results-summary {
    max-width: 1200px;
    margin: 6px auto 12px auto;
    color: #475569;
    font-size: 13px;
}


