/* ============================================================
   PF2026 — Archive / Search / 404 layouts
   ============================================================ */

/* ---------- Header de page d'archive ---------- */
.archive-header { padding: 28px 0 32px; }

.archive-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 21/9;
    max-height: 320px;
    border-radius: var(--r-lg);
    overflow: hidden;
    margin: 16px 0 28px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--type-dragon) 100%);
}
.archive-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .55;
}
.archive-cover-content {
    position: relative;
    z-index: 2;
    padding: 36px 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.archive-cover-title {
    font-size: 34px;
    font-weight: 700;
    color: white;
    letter-spacing: -.04em;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    margin: 0 0 8px;
}
.archive-cover-meta {
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    font-weight: 600;
}

.archive-title-block { margin: 16px 0 8px; }
.archive-title-block .section-title {
    font-size: 30px;
    margin-bottom: 4px;
}
.archive-title-block em {
    font-style: normal;
    color: var(--yellow-dark);
}
.archive-description {
    margin-top: 14px;
    font-size: 15px;
    color: var(--ink-mid);
    line-height: 1.6;
    max-width: 720px;
}

/* ---------- Grid de cartes ---------- */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding-bottom: 48px;
}

.archive-empty {
    padding: 60px 0;
    text-align: center;
    color: var(--ink-light);
}

/* ---------- Search ---------- */
.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 20px;
}
.search-input {
    flex: 1;
    padding: 11px 18px;
    font-family: var(--font);
    font-size: 14px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--r-full);
    color: var(--ink);
    transition: border-color .15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--ink);
}

/* ---------- Pagination wrap ---------- */
.pagination-wrap { padding: 32px 0 60px; }

/* ============================================================
   Library view (category-jeux-video.php) — game boxes grouped by platform
   ============================================================ */
.library-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 18px 0 16px;
}
.library-header strong { color: var(--ink); font-weight: 700; }

/* ---------- Plateforme (Switch, NDS, GameBoy…) ---------- */
.library-platform {
    margin: 36px 0 8px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.library-platform:first-of-type { border-top: 0; padding-top: 8px; }

.library-platform-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 22px;
}
.library-platform-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
    margin: 0;
}
.library-platform-years {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.library-platform-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px;
    padding-bottom: 16px;
    --box-aspect: 5/7; /* défaut, override par data via style inline */
}

.game-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}
.game-box:hover {
    transform: translateY(-6px);
}
/* Major games stand out a touch (slightly larger title, no real grid size diff) */
.game-box--major .game-box-title { font-size: 15px; }

/* Cover : ratio dérivé du --box-aspect du conteneur (par plateforme) */
.game-box-cover {
    aspect-ratio: var(--box-aspect);
    background: var(--cream);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 1px 2px rgba(13, 13, 28, .08),
        0 8px 24px rgba(13, 13, 28, .12);
    transition: box-shadow .25s, transform .25s;
}
.game-box:hover .game-box-cover {
    box-shadow:
        0 1px 2px rgba(13, 13, 28, .1),
        0 24px 48px rgba(13, 13, 28, .22);
}

.game-box-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--cream);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}
.game-box:hover .game-box-cover img {
    transform: scale(1.04);
}

/* ---- Variant rotation : cross-fade entre N slides ---- */
.game-box-cover--rotates {
    /* Les slides s'empilent en absolute, on contrôle l'opacité au JS */
}
.game-box-cover--rotates .game-box-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease-in-out, transform .35s cubic-bezier(.16, 1, .3, 1);
}
.game-box-cover--rotates .game-box-slide.is-active {
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .game-box-cover--rotates .game-box-slide { transition: none; }
}

/* Empty-state cover (no Categories Image set) */
.game-box-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: rgba(13, 13, 28, .25);
    background: linear-gradient(135deg, var(--cream) 0%, var(--border) 100%);
}

/* Subtle vertical highlight along the left edge — mimics a box spine */
.game-box-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, .35) 0%,
        rgba(0, 0, 0, .08) 50%,
        rgba(255, 255, 255, .2) 100%
    );
    pointer-events: none;
}

.game-box-info {
    padding: 0 4px;
    text-align: center;
}
.game-box-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: -.01em;
    margin-bottom: 4px;
}
.game-box-meta {
    display: flex;
    gap: 6px;
    justify-content: center;
    font-size: 11px;
    color: var(--ink-light);
    font-weight: 500;
}
.game-box-meta span + span::before {
    content: '·';
    margin-right: 6px;
    color: var(--border);
}

/* ---------- Variant pills (Rouge / Bleu, Or / Argent, ...) ---------- */
.game-box-variants {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 4px 0 6px;
}
.variant-pill {
    --variant-color: var(--ink-light);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--ink-mid);
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    line-height: 1.4;
}
.variant-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--variant-color);
    border: 1px solid rgba(0, 0, 0, .1);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .library-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
    .game-box-title { font-size: 13px; }
    .library-platform-header { flex-wrap: wrap; }
    .library-platform-header h2 { font-size: 18px; }
}

/* ---------- 404 ---------- */
.error-404 {
    padding: 80px 0 100px;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}
.error-404-code {
    font-size: 140px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.06em;
    color: var(--yellow);
    margin-bottom: 16px;
}
.error-404-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
    margin-bottom: 12px;
}
.error-404-desc {
    font-size: 15px;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 32px;
}
.error-404-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .archive-cover-content { padding: 20px; }
    .archive-cover-title { font-size: 22px; }
    .archive-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .error-404-code { font-size: 96px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-form .btn { justify-content: center; }
}
