/* ═══════════════════════════════════════════════════════════════════════════
   GamesFirst! Archive — Stylesheet
   A clean, readable design for a vintage game magazine archive.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #0f1117;
    --color-bg-alt: #161822;
    --color-surface: #1c1f2e;
    --color-surface-hover: #252840;
    --color-border: #2a2d3e;
    --color-text: #e0e0e6;
    --color-text-muted: #8b8da0;
    --color-heading: #f0f0f5;
    --color-accent: #6c8cff;
    --color-accent-hover: #8aa4ff;
    --color-link: #6c8cff;
    --color-link-hover: #8aa4ff;
    --color-star: #f5c542;
    --color-type-review: #4caf50;
    --color-type-preview: #2196f3;
    --color-type-news: #ff9800;
    --color-type-editorial: #9c27b0;
    --color-type-feature: #e91e63;
    --color-type-interview: #00bcd4;
    --color-type-article: #607d8b;
    --max-width: 1200px;
    --content-width: 800px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--color-link-hover); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { color: var(--color-heading); line-height: 1.3; }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ─── Header ───────────────────────────────────────────────────────────── */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.site-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-heading);
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    max-width: 250px;
}

.nav-toggle { display: none; background: none; border: none; color: var(--color-text); font-size: 1.5rem; cursor: pointer; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-links li a {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

/* ─── Search Overlay ───────────────────────────────────────────────────── */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.95);
    z-index: 200;
    padding-top: 4rem;
}

.search-overlay.active { display: block; }

.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    outline: none;
}

.search-box input:focus { border-color: var(--color-accent); }

.search-box button {
    padding: 0.75rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
}

.search-results a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.search-results a:hover { background: var(--color-surface-hover); }
.search-result-title { font-weight: 600; color: var(--color-heading); }
.search-result-meta { font-size: 0.85rem; color: var(--color-text-muted); }

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--color-surface) 0%, #1a1d30 100%);
    padding: 3rem 0;
    border-bottom: 1px solid var(--color-border);
}

.hero h1 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.hero-text { font-size: 1.1rem; color: var(--color-text-muted); max-width: 700px; margin-bottom: 2rem; }

.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; }

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number { font-size: 2rem; font-weight: 800; color: var(--color-accent); }
.stat-label { font-size: 0.85rem; color: var(--color-text-muted); }

/* ─── Sections ─────────────────────────────────────────────────────────── */
.section { padding: 2.5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
.section-subtitle { color: var(--color-text-muted); margin-bottom: 1.5rem; }
.section-more { margin-top: 1.5rem; text-align: center; }

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.15s;
}

.btn:hover { background: var(--color-accent-hover); color: #fff; }

/* ─── Breadcrumb ───────────────────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    padding: 1rem 0 0;
}

.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-link); }

/* ─── Article Grid ─────────────────────────────────────────────────────── */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.article-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}

.article-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }

.card-content { padding: 1rem; }
.card-meta { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; }
.card-meta time { color: var(--color-text-muted); }
.card-content h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.card-content h3 a { color: var(--color-heading); }
.card-content h3 a:hover { color: var(--color-accent); }
.card-rating { color: var(--color-star); font-size: 1rem; margin-bottom: 0.5rem; }
.card-blurb { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }
.card-author { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.5rem; }

/* ─── Article List ─────────────────────────────────────────────────────── */
.article-list { display: flex; flex-direction: column; gap: 0.5rem; }

.list-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.list-item:hover { background: var(--color-surface); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-meta { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.25rem; font-size: 0.8rem; }
.list-item-meta time { color: var(--color-text-muted); }
.list-item h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.list-item h3 a { color: var(--color-heading); }
.list-item h3 a:hover { color: var(--color-accent); }
.list-item-details { display: flex; gap: 0.75rem; align-items: center; font-size: 0.8rem; color: var(--color-text-muted); flex-wrap: wrap; }
.list-item-blurb { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* ─── Type Badges ──────────────────────────────────────────────────────── */
.card-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-review { background: var(--color-type-review); color: #fff; }
.type-preview { background: var(--color-type-preview); color: #fff; }
.type-news { background: var(--color-type-news); color: #fff; }
.type-editorial { background: var(--color-type-editorial); color: #fff; }
.type-feature { background: var(--color-type-feature); color: #fff; }
.type-interview { background: var(--color-type-interview); color: #fff; }
.type-article, .type-archive, .type-comic, .type-podcast, .type-hardware, .type-gallery, .type-how-to {
    background: var(--color-type-article); color: #fff;
}

/* ─── Platform Tags ────────────────────────────────────────────────────── */
.platform-tags { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }

.platform-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--color-surface-hover);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

a.platform-tag:hover { background: var(--color-accent); color: #fff; }

/* ─── Rating Stars ─────────────────────────────────────────────────────── */
.rating { color: var(--color-star); }
.stars { color: var(--color-star); font-size: 1.25rem; }

/* ─── Year Navigation ──────────────────────────────────────────────────── */
.year-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: 8px;
}

.year-link {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: background 0.15s;
}

.year-link:hover { background: var(--color-surface-hover); color: var(--color-heading); }
.year-link .count { font-size: 0.8rem; opacity: 0.7; }

.year-section { margin-bottom: 2rem; }
.year-heading { font-size: 1.3rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); margin-bottom: 0.75rem; }

/* ─── Browse Grid ──────────────────────────────────────────────────────── */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.browse-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.browse-card h3 { margin-bottom: 0.75rem; }
.browse-card h3 a { color: var(--color-heading); }

.browse-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.browse-item {
    padding: 0.35rem 0.75rem;
    background: var(--color-surface-hover);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--color-text);
    transition: background 0.15s;
}

.browse-item:hover { background: var(--color-accent); color: #fff; }
.browse-item .count { font-size: 0.75rem; opacity: 0.7; }

/* ─── Taxonomy Grid ────────────────────────────────────────────────────── */
.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.taxonomy-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.taxonomy-card:hover { border-color: var(--color-accent); }
.taxonomy-name { font-weight: 600; color: var(--color-heading); }
.taxonomy-count { font-size: 0.85rem; color: var(--color-text-muted); }

/* ─── Article Page ─────────────────────────────────────────────────────── */
.article-page { padding: 0 0 3rem; }

.article-header { margin-bottom: 2rem; }
.article-meta-top { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.game-title { font-size: 1rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.article-rating { margin-bottom: 0.75rem; }
.rating-number { color: var(--color-text-muted); font-size: 0.9rem; margin-left: 0.5rem; }
.article-byline { color: var(--color-text-muted); margin-bottom: 0.75rem; }
.article-byline a { color: var(--color-accent); }
.article-blurb { font-size: 1.05rem; color: var(--color-text-muted); font-style: italic; line-height: 1.5; border-left: 3px solid var(--color-accent); padding-left: 1rem; }

.article-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.article-body {
    max-width: var(--content-width);
    line-height: 1.7;
    font-size: 1.05rem;
}

.article-body p { margin-bottom: 1rem; }
.article-body h2 { margin-top: 2rem; }
.article-body h3 { margin-top: 1.5rem; }
.article-body blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--color-text-muted);
    font-style: italic;
}
.article-body img {
    border-radius: 4px;
    margin: 1rem 0;
}
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-body th, .article-body td { padding: 0.5rem; border: 1px solid var(--color-border); text-align: left; }
.article-body th { background: var(--color-surface); }

/* ─── Sidebar ──────────────────────────────────────────────────────────── */
.article-sidebar { position: sticky; top: 5rem; }

.sidebar-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-box h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.game-info dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.75rem; font-size: 0.9rem; }
.game-info dt { color: var(--color-text-muted); font-weight: 600; }
.game-info dd { color: var(--color-text); }

.ups-downs { font-size: 0.9rem; margin-bottom: 0.5rem; line-height: 1.5; }
.ups { color: var(--color-type-review); }
.downs { color: #ef5350; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.gallery-thumb img { border-radius: 4px; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ─── Author Pages ─────────────────────────────────────────────────────── */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.author-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.author-card:hover { border-color: var(--color-accent); }
.author-card-name { font-weight: 600; color: var(--color-heading); }
.author-card-title { font-size: 0.85rem; color: var(--color-text-muted); }
.author-card-count { font-size: 0.85rem; color: var(--color-accent); margin-top: 0.25rem; }

.author-profile { margin-bottom: 2rem; }
.author-header h1 { margin-bottom: 0.25rem; }
.author-title { font-size: 1.1rem; color: var(--color-accent); margin-bottom: 1rem; }
.author-bio { color: var(--color-text); line-height: 1.6; margin-bottom: 1rem; white-space: pre-line; }

.author-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.author-stats { margin: 1rem 0; }
.stat-bars { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--color-surface);
    border-radius: 4px;
    font-size: 0.85rem;
}

.stat-bar-label { color: var(--color-text-muted); }
.stat-bar-count { font-weight: 600; color: var(--color-heading); }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h3 { font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--color-heading); }
.footer-section p { font-size: 0.85rem; color: var(--color-text-muted); }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.35rem; }
.footer-section a { color: var(--color-text-muted); font-size: 0.85rem; }
.footer-section a:hover { color: var(--color-link); }

.footer-bottom {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ─── Pagination ───────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: background 0.15s;
}

.page-link:hover { background: var(--color-surface-hover); color: var(--color-heading); }
.page-link.active { background: var(--color-accent); color: #fff; }
.page-dots { padding: 0.4rem 0.25rem; color: var(--color-text-muted); }

/* ─── Page Content ─────────────────────────────────────────────────────── */
.page-content { max-width: var(--content-width); line-height: 1.7; }
.page-content p { margin-bottom: 1rem; }
.page-content h2 { margin-top: 2rem; }
.section-intro { margin-bottom: 1.5rem; max-width: var(--content-width); }

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .article-sidebar-layout { grid-template-columns: 1fr; }
    .article-sidebar { position: static; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-stats { gap: 1.5rem; }
    .stat-number { font-size: 1.5rem; }
    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .browse-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: 0.5rem; }
    .nav-links.open { display: flex; }
    .nav-links li a { display: block; }
    h1 { font-size: 1.5rem; }
}
