/* ============================================================
   9569 SILVER KNIGHTS — gallery  ·  mission archive
   (depends on css/theme.css design tokens)
   ============================================================ */

:root {
    --gap: 1.1rem;
}

.content {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}

.page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--h1);
    line-height: 1.04;
    text-align: center;
    text-transform: uppercase;
}

/* ---------------- Year navigation — console selector ---------------- */

.year-navigation {
    display: flex;
    justify-content: center;
    margin: 0 auto clamp(2.5rem, 6vw, 4rem);
}

.year-nav-container {
    --c: 11px;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: linear-gradient(135deg, var(--line-strong), var(--line));
}

.year-nav-container::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px),
            calc(100% - 10px) 100%, 0 100%, 0 10px);
    background: var(--panel-strong);
}

.year-arrow {
    --c: 7px;
    background: var(--surface);
    border: none;
    color: var(--muted);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.year-arrow svg {
    width: 20px;
    height: 20px;
}

.year-arrow:hover:not(:disabled) {
    color: #04121a;
    background: var(--cyan);
}

.year-arrow:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.year-display {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--cyan);
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    min-width: 96px;
    text-align: center;
    text-shadow: 0 0 22px var(--accent-glow);
}

/* ---------------- Year sections ---------------- */

.year-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
}

.year-section.active {
    display: block;
    opacity: 1;
}

.year-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--h2);
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    color: var(--cyan);
    text-shadow: 0 0 24px var(--accent-glow);
}

/* ---------------- Featured videos ---------------- */

.featured-videos {
    max-width: 1200px;
    margin: 0 auto clamp(3rem, 7vw, 5rem);
}

.featured-videos .section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--h3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1.75rem;
    text-align: center;
    color: var(--ink);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 560px));
    justify-content: center;
    gap: var(--gap);
}

.video-card {
    --c: 13px;
    position: relative;
    isolation: isolate;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: linear-gradient(135deg, var(--line-strong), var(--line));
    transition: transform 0.32s var(--ease-out), filter 0.32s var(--ease);
}

.video-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
            calc(100% - 12px) 100%, 0 100%, 0 12px);
    background: var(--panel);
}

.video-card:hover {
    transform: translateY(-7px);
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
}

.video-card iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

.video-info {
    padding: 1.5rem;
}

.video-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.6rem;
}

.video-description {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ---------------- Photo grid (masonry-style) ---------------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    max-width: 1440px;
    margin: 0 auto;
    grid-auto-flow: dense;
}

.gallery-item {
    --c: 12px;
    position: relative;
    overflow: hidden;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background-color: #0e1422;
    background-image: linear-gradient(100deg,
            rgba(255, 255, 255, 0) 30%,
            rgba(92, 208, 236, 0.12) 50%,
            rgba(255, 255, 255, 0) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    transition: transform 0.4s var(--ease-out), filter 0.32s var(--ease);
}

.gallery-item.loaded {
    animation: none;
    background-image: none;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.012);
    filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px var(--accent-glow));
    z-index: 2;
}

.gallery-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.gallery-image.loaded {
    opacity: 1;
}

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

@keyframes shimmer {
    from {
        background-position: 180% 0;
    }

    to {
        background-position: -80% 0;
    }
}

.gallery-item.tiny,
.gallery-item.small {
    grid-column: span 1;
    grid-row: span 1;
    padding-bottom: 100%;
}

.gallery-item.medium,
.gallery-item.tall {
    grid-column: span 1;
    grid-row: span 2;
    padding-bottom: calc(200% + var(--gap));
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
    padding-bottom: 100%;
}

.gallery-item.wide {
    grid-column: span 2;
    grid-row: span 1;
    padding-bottom: 50%;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

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

    .gallery-item.large,
    .gallery-item.wide {
        grid-column: span 1;
    }

    .gallery-item.medium,
    .gallery-item.tall {
        grid-row: span 1;
        padding-bottom: 100%;
    }

    .gallery-item.wide {
        padding-bottom: 56.25%;
    }
}

/* ---------------- Loading / empty states ---------------- */

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
}

.no-content {
    text-align: center;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 3rem 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item {
        animation: none;
        background-image: none;
    }

    .gallery-image {
        opacity: 1;
        transition: none;
    }
}
