/* Page Galerie — grille + lightbox minimal */

.gallery-page-intro {
    margin-bottom: 22px;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(224, 224, 224, 0.88);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }
}

.gallery-card {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(187, 134, 252, 0.2);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-2px);
    border-color: rgba(187, 134, 252, 0.45);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.gallery-card:focus {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 2px;
}

.gallery-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    vertical-align: middle;
}

.gallery-card-caption {
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(224, 224, 224, 0.82);
    text-align: left;
}

.gallery-empty {
    position: relative;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 56px 28px 52px;
    margin-top: 8px;
    color: var(--text-light);
    border-radius: 18px;
    border: 1px dashed rgba(187, 134, 252, 0.3);
    background:
        radial-gradient(circle at 50% 0%, rgba(3, 218, 198, 0.08), transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(187, 134, 252, 0.08), transparent 55%),
        rgba(0, 0, 0, 0.25);
    overflow: hidden;
    isolation: isolate;
}

.gallery-empty__icon {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--secondary-accent), #02b8a8);
    box-shadow:
        0 10px 30px rgba(3, 218, 198, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    margin-bottom: 6px;
    animation: galleryEmptyFloat 3.6s ease-in-out infinite;
}

.gallery-empty__icon--warn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.gallery-empty__icon--error {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.gallery-empty__icon i {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.gallery-empty__halo {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 65%);
    z-index: 1;
    animation: galleryEmptyPulse 2.6s ease-in-out infinite;
}

.gallery-empty__title {
    margin: 0;
    font-family: 'Audiowide', 'Exo 2', sans-serif;
    font-size: 1.45rem;
    color: #fff;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.gallery-empty__subtitle {
    margin: 0;
    max-width: 460px;
    color: var(--text-lighter);
    font-size: 0.95rem;
    line-height: 1.5;
}

.gallery-empty__decor {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    font-size: 4.5rem;
    color: var(--secondary-accent);
}
.gallery-empty__decor i:nth-child(1) { transform: rotate(-12deg) translateY(-10px); }
.gallery-empty__decor i:nth-child(2) { display: none; }
.gallery-empty__decor i:nth-child(3) { transform: rotate(10deg) translateY(8px); color: var(--primary-accent); }

@keyframes galleryEmptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes galleryEmptyPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-empty__icon,
    .gallery-empty__halo {
        animation: none;
    }
}

@media (max-width: 600px) {
    .gallery-empty {
        padding: 40px 18px 36px;
    }
    .gallery-empty__icon {
        width: 72px;
        height: 72px;
        font-size: 1.6rem;
    }
    .gallery-empty__title { font-size: 1.2rem; }
    .gallery-empty__decor { font-size: 3rem; padding: 0 12px; }
}

/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
    background: rgba(5, 5, 12, 0.92);
    backdrop-filter: blur(6px);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox__inner {
    position: relative;
    max-width: min(96vw, 1200px);
    max-height: 92vh;
    margin: auto;
}

.gallery-lightbox__inner img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.gallery-lightbox__caption {
    margin-top: 14px;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(224, 224, 224, 0.9);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-lightbox__close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(187, 134, 252, 0.4);
    background: rgba(15, 15, 22, 0.95);
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.gallery-lightbox__close:hover {
    background: rgba(187, 134, 252, 0.2);
    border-color: var(--secondary-accent);
}

[data-theme="light"] .gallery-card {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(90, 45, 168, 0.15);
}

[data-theme="light"] .gallery-card-caption {
    color: rgba(15, 23, 42, 0.78);
}

[data-theme="light"] .gallery-empty {
    background:
        radial-gradient(circle at 50% 0%, rgba(3, 218, 198, 0.10), transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(187, 134, 252, 0.10), transparent 55%),
        rgba(255, 255, 255, 0.65);
    border-color: rgba(90, 45, 168, 0.2);
    color: #1e293b;
}
[data-theme="light"] .gallery-empty__title { color: #1e293b; text-shadow: none; }
[data-theme="light"] .gallery-empty__subtitle { color: #475569; }
