/**
 * Critical CSS - Above-the-fold Gallery Page
 * Extracted from inline styles for better caching and maintainability
 *
 * @package AquaticArtists
 * @version 1.0.0
 * @date 2026-02-01
 */

/* Reset and Base */
.aquatic-artists-gallery *,
.aquatic-artists-gallery *::before,
.aquatic-artists-gallery *::after {
    box-sizing: border-box;
}

/* Container */
.aquatic-artists-gallery {
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 15px;
}

/* Filter Container */
.filter-container {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #1a1a1a;
    border-radius: 8px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #f0f0f0;
}

/* Filter Buttons */
.project-type-filters,
.project-level-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-button {
    width: 140px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8px;
    border: none;
    border-radius: 20px;
    margin: 0;
    cursor: pointer;
    white-space: normal;
    line-height: 1.2;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease;
    font-size: 14px;
}

.filter-button:hover {
    background-color: #777;
}

.filter-button:active {
    transform: scale(0.98);
}

.filter-button.active {
    background-color: #00A1C6;
    color: #F9A643;
    font-size: 16px;
    font-weight: bold;
}

#clear-filters {
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
}

#clear-filters:hover {
    background-color: #777;
}

/* Gallery Grid - Skeleton State */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.gallery-skeleton-item {
    position: relative;
    overflow: hidden;
    border: 2px solid #333;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Gallery Items (once loaded) */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #F9A643;
    background-color: #222;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    font-size: 0;
}

.gallery-item .gallery-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform .3s ease, filter .35s ease;
    background-color: #222;
    contain: layout style paint;
}

.gallery-item:hover .gallery-item-image {
    transform: scale(1.1);
}

.gallery-item .gallery-item-image.is-blurry {
    filter: blur(5px);
    transform: scale(1.01);
    will-change: filter;
}

.gallery-item:hover .gallery-item-image.is-blurry {
    transform: scale(1.01);
}

.gallery-title {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    font-size: 16px;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    transition: background-color 0.3s ease;
}

.gallery-item:hover .gallery-title {
    background: rgba(0, 161, 198, .8);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0 20px 0;
    flex-wrap: wrap;
}

.pagination-button {
    padding: 8px 16px;
    background-color: #00A1C6;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: #007a99;
}

.pagination-button:disabled {
    background-color: #555;
    cursor: not-allowed;
    color: #999;
}

.pagination-info {
    font-size: 0.95em;
    color: #ddd;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }

    .filter-button {
        width: 140px;
        height: 60px;
        padding: 8px;
        font-size: 14px;
    }
}

/* ========================================
   Reduced Motion Support
   Respects user preference for reduced motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    /* Disable skeleton shimmer animation */
    .gallery-skeleton-item {
        animation: none;
        background: #1a1a1a;
    }

    /* Disable hover zoom on gallery images */
    .gallery-item:hover .gallery-item-image {
        transform: none;
    }

    .gallery-item .gallery-item-image.is-blurry {
        transform: none;
    }

    .gallery-item:hover .gallery-item-image.is-blurry {
        transform: none;
    }

    /* Disable all transitions */
    .filter-button,
    .gallery-item .gallery-item-image,
    .gallery-title,
    .pagination-button {
        transition: none;
    }

    /* Disable filter button active scale */
    .filter-button:active {
        transform: none;
    }
}
