/* ========================================
   GALLERY PAGE
   ======================================== */

.gallery-page .page-hero {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.14), rgba(var(--accent-secondary-rgb), 0.1));
}

.gallery-page .hero-content {
    text-align: center;
}

.gallery-page .hero-grid {
    grid-template-columns: 1fr;
}

.gallery-page .hero-image {
    display: none;
}

.gallery-page .gallery-breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.gallery-page .gallery-breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.gallery-page .gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: var(--spacing-xl);
}

.gallery-page .gallery-filter-btn {
    border: 1px solid rgba(var(--accent-primary-rgb), 0.18);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 0.55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.gallery-page .gallery-filter-btn:hover,
.gallery-page .gallery-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.gallery-page .public-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.gallery-page .public-gallery-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.gallery-page .public-gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--accent-primary-rgb), 0.28);
}

.gallery-page .public-gallery-media {
    appearance: none;
    border: 0;
    width: 100%;
    display: block;
    cursor: zoom-in;
    aspect-ratio: 5 / 4;
    background: #d9d9d9;
    overflow: hidden;
    position: relative;
}

.gallery-page .public-gallery-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.gallery-page .public-gallery-card:hover .public-gallery-media img {
    transform: scale(1.04);
}

.gallery-page .public-gallery-content {
    padding: 0.9rem 1rem 1rem;
}

.gallery-page .public-gallery-content h3 {
    margin: 0;
    font-size: 1rem;
}

.gallery-page .gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

.gallery-page .gallery-page-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-page .gallery-page-btn:hover,
.gallery-page .gallery-page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.gallery-page .gallery-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gallery-page .gallery-lightbox[hidden] {
    display: none;
}

.gallery-page .gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gallery-page .gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(5, 10, 25, 0.78);
    cursor: zoom-out;
}

.gallery-page .gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1280px, 96vw);
    max-height: 92vh;
}

.gallery-page .gallery-lightbox-figure {
    margin: 0;
    display: grid;
    gap: 0;
    background: rgba(8, 14, 30, 0.96);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
}

.gallery-page .gallery-lightbox-dialog img {
    width: 100%;
    max-width: 100%;
    max-height: min(82vh, 980px);
    object-fit: contain;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 50%);
}

.gallery-page .gallery-lightbox-caption {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem 1.15rem;
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.06));
}

.gallery-page .gallery-lightbox-caption strong {
    font-size: 1rem;
    font-weight: 700;
}

.gallery-page .gallery-lightbox-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.gallery-page .gallery-lightbox-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(11, 18, 36, 0.72);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.gallery-page .gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: rgba(11, 18, 36, 0.72);
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}

.gallery-page .gallery-lightbox-nav:hover {
    transform: translateY(-50%) scale(1.06);
    background: rgba(11, 18, 36, 0.92);
}

.gallery-page .gallery-lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.gallery-page .gallery-lightbox-prev {
    left: 1.1rem;
}

.gallery-page .gallery-lightbox-next {
    right: 1.1rem;
}

.gallery-page .gallery-lightbox-close:hover {
    transform: scale(1.06);
    background: rgba(11, 18, 36, 0.92);
}

@media (max-width: 1100px) {
    .gallery-page .public-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-page .public-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-page .gallery-lightbox {
        padding: 1rem;
    }

    .gallery-page .gallery-lightbox-dialog {
        width: 100%;
    }

    .gallery-page .gallery-lightbox-dialog img {
        max-height: 72vh;
    }
}

@media (max-width: 560px) {
    .gallery-page .public-gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-page .public-gallery-content {
        padding: 0.85rem 0.9rem 1rem;
    }

    .gallery-page .gallery-lightbox-caption {
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.9rem 1rem 1rem;
    }

    .gallery-page .gallery-lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 44px;
        height: 44px;
    }

    .gallery-page .gallery-lightbox-nav {
        width: 46px;
        height: 46px;
        font-size: 2rem;
    }

    .gallery-page .gallery-lightbox-prev {
        left: 0.65rem;
    }

    .gallery-page .gallery-lightbox-next {
        right: 0.65rem;
    }
}
