/**
 * Furry Con Archives — progressive UI enhancements
 * Core layout/nav styles live in base.html inline CSS so pages work even if this file fails to load.
 */

:root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --glass-bg: rgba(20, 20, 20, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --focus-ring: 0 0 0 3px rgba(0, 190, 238, 0.45);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

::selection {
    background: rgba(0, 190, 238, 0.35);
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: 100002;
    padding: 0.65rem 1.25rem;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
    top: var(--space-md);
    outline: none;
    box-shadow: var(--focus-ring);
}

.site-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.site-body > main.container {
    flex: 1;
    width: 100%;
}

.header {
    transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.header.is-scrolled {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom-color: var(--glass-border) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

@media (min-width: 1024px) {
    .header-content {
        padding: 0.85rem 2rem;
    }

    .container {
        padding: 2.5rem 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        padding: 3rem 2.5rem;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

@media (max-width: 768px) {
    #cookieConsentPopup .cookie-consent-inner {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    #cookieConsentOk {
        width: 100%;
        max-width: 200px;
    }
}

@media (min-width: 769px) {
    .footer {
        margin-top: 5rem;
    }

    .footer-section h3 {
        font-size: 0.8rem;
        letter-spacing: 0.06em;
    }
}

@media (min-width: 1024px) {
    .messages {
        padding: 0 2rem;
    }

    .alert {
        padding: 1.1rem 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header,
    .skip-link {
        transition: none;
    }
}

/* Skeleton / shimmer placeholders for API-loaded content */
.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary, #2a2a2a) 0%,
        rgba(255, 255, 255, 0.04) 40%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.04) 60%,
        var(--bg-tertiary, #2a2a2a) 100%
    );
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.35s ease-in-out infinite;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
}

.skeleton-line {
    height: 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
}

.skeleton-line.sm { height: 0.65rem; }
.skeleton-line.lg { height: 1.25rem; }
.skeleton-line.title { height: 1.1rem; width: 75%; }
.skeleton-line.short { width: 42%; }
.skeleton-line.medium { width: 62%; }

.skeleton-block { border-radius: 8px; }
.skeleton-circle { border-radius: 50%; flex-shrink: 0; }

.skeleton-card {
    overflow: hidden;
}

.skeleton-stat .skeleton-line {
    margin-left: auto;
    margin-right: auto;
}

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

@media (prefers-reduced-motion: reduce) {
    .skeleton-shimmer {
        animation: none;
        background: var(--bg-tertiary, #2a2a2a);
    }
}

/* Obvious loading pulse while API data / thumbnails are in flight */
@keyframes data-loading-flicker {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.55; filter: brightness(1.35); }
}

[aria-busy="true"]:not(#global-loading-bar) {
    animation: data-loading-flicker 0.85s ease-in-out infinite;
}

.document-grid.is-loading {
    animation: data-loading-flicker 0.85s ease-in-out infinite;
}

.doc-thumb-loading {
    animation: data-loading-flicker 0.7s ease-in-out infinite;
    position: relative;
}

.doc-thumb-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 190, 238, 0.14) 45%,
        rgba(0, 212, 255, 0.22) 50%,
        rgba(0, 190, 238, 0.14) 55%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: skeleton-shimmer 1.1s ease-in-out infinite;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    [aria-busy="true"]:not(#global-loading-bar),
    .document-grid.is-loading,
    .doc-thumb-loading {
        animation: none;
    }

    .doc-thumb-loading::after {
        animation: none;
        opacity: 0.35;
    }
}
