/*
Theme Name: VGCL - Video Game Console Library
Theme URI: https://videogameconsolelibrary.com
Description: Custom theme for Video Game Console Library - an encyclopedia of video game console hardware from the 1970s to present day.
Version: 1.0.0
Author: VGCL
Author URI: https://videogameconsolelibrary.com
Text Domain: vgcl
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ========== CSS VARIABLES ========== */
:root {
    --vgcl-primary: #1a1a2e;
    --vgcl-secondary: #16213e;
    --vgcl-accent: #e94560;
    --vgcl-accent-hover: #ff6b81;
    --vgcl-highlight: #0f3460;
    --vgcl-text: #e0e0e0;
    --vgcl-text-muted: #a0a0a0;
    --vgcl-bg: #0f0f1a;
    --vgcl-card-bg: #1a1a2e;
    --vgcl-border: #2a2a3e;
    --vgcl-success: #4ecca3;
    --vgcl-warning: #ffc857;
    --vgcl-gold: #ffd700;
    --vgcl-tab-active: #e94560;
    --vgcl-font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --vgcl-font-heading: 'Orbitron', 'Inter', sans-serif;
    --vgcl-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --vgcl-max-width: 1200px;
    --vgcl-radius: 8px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--vgcl-font-main);
    font-size: 16px;
    line-height: 1.7;
    color: var(--vgcl-text);
    background: var(--vgcl-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--vgcl-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--vgcl-accent-hover); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--vgcl-font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.5em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

/* ========== LAYOUT ========== */
.vgcl-container {
    max-width: var(--vgcl-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.vgcl-grid {
    display: grid;
    gap: 30px;
}

.vgcl-grid-2 { grid-template-columns: repeat(2, 1fr); }
.vgcl-grid-3 { grid-template-columns: repeat(3, 1fr); }
.vgcl-grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ========== HEADER ========== */
.vgcl-header {
    background: var(--vgcl-primary);
    border-bottom: 3px solid var(--vgcl-accent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.vgcl-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: var(--vgcl-max-width);
    margin: 0 auto;
}

.vgcl-logo {
    display: flex;
    align-items: center;
}

.vgcl-logo-img {
    height: 56px;
    width: auto;
}

/* ========== NAVIGATION ========== */
.vgcl-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
}

.vgcl-nav a {
    display: block;
    padding: 8px 16px;
    color: var(--vgcl-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--vgcl-radius);
    transition: all 0.2s;
}

.vgcl-nav a:hover,
.vgcl-nav .current-menu-item a {
    background: var(--vgcl-highlight);
    color: #fff;
}

/* Decade sub-navigation */
.vgcl-decade-nav {
    background: var(--vgcl-secondary);
    padding: 10px 0;
    border-bottom: 1px solid var(--vgcl-border);
}

.vgcl-decade-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.vgcl-decade-nav a {
    display: block;
    padding: 6px 20px;
    font-family: var(--vgcl-font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vgcl-text-muted);
    border: 1px solid var(--vgcl-border);
    border-radius: 20px;
    transition: all 0.2s;
}

.vgcl-decade-nav a:hover,
.vgcl-decade-nav a.active {
    background: var(--vgcl-accent);
    border-color: var(--vgcl-accent);
    color: #fff;
}

/* Mobile nav toggle */
.vgcl-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .vgcl-nav-toggle { display: block; }
    .vgcl-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--vgcl-primary);
        padding: 10px;
    }
    .vgcl-nav.open ul { display: flex; }
    .vgcl-decade-nav ul { flex-wrap: wrap; justify-content: center; }
}

/* ========== HERO / CONSOLE HEADER ========== */
.vgcl-hero {
    background: linear-gradient(135deg, var(--vgcl-primary) 0%, var(--vgcl-highlight) 100%);
    padding: 60px 0 40px;
    text-align: center;
}

.vgcl-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
}

.vgcl-hero .subtitle {
    color: var(--vgcl-text-muted);
    font-size: 1.1rem;
}

/* Console quick facts bar */
.vgcl-quick-facts {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.vgcl-fact {
    text-align: center;
}

.vgcl-fact-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vgcl-text-muted);
    margin-bottom: 4px;
}

.vgcl-fact-value {
    display: block;
    font-family: var(--vgcl-font-heading);
    font-size: 1.1rem;
    color: var(--vgcl-accent);
    font-weight: 700;
}

/* ========== TABS (Console Detail Pages) ========== */
.vgcl-tabs {
    background: var(--vgcl-card-bg);
    border-radius: var(--vgcl-radius) var(--vgcl-radius) 0 0;
    margin-top: 30px;
}

.vgcl-tab-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid var(--vgcl-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vgcl-tab-nav li a {
    display: block;
    padding: 14px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vgcl-text-muted);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.vgcl-tab-nav li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.vgcl-tab-nav li a.active {
    color: #fff;
    border-bottom-color: var(--vgcl-accent);
}

.vgcl-tab-content {
    display: none;
    padding: 30px;
}

.vgcl-tab-content.active {
    display: block;
}

/* ========== CARDS ========== */
.vgcl-card {
    background: var(--vgcl-card-bg);
    border: 1px solid var(--vgcl-border);
    border-radius: var(--vgcl-radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.vgcl-card:hover {
    transform: translateY(-3px);
    border-color: var(--vgcl-accent);
}

.vgcl-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--vgcl-secondary);
}

.vgcl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vgcl-card-body {
    padding: 18px;
}

.vgcl-card-title {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.vgcl-card-meta {
    font-size: 0.8rem;
    color: var(--vgcl-text-muted);
}

.vgcl-card-year {
    font-family: var(--vgcl-font-mono);
    color: var(--vgcl-accent);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========== SPECS TABLE ========== */
.vgcl-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.vgcl-specs-table th,
.vgcl-specs-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--vgcl-border);
}

.vgcl-specs-table th {
    width: 35%;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--vgcl-text-muted);
    background: rgba(255,255,255,0.02);
}

.vgcl-specs-table td {
    font-family: var(--vgcl-font-mono);
    font-size: 0.9rem;
}

/* ========== RATINGS ========== */
.vgcl-rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.vgcl-rating-label {
    width: 140px;
    font-size: 0.85rem;
    color: var(--vgcl-text-muted);
}

.vgcl-rating-track {
    flex: 1;
    height: 8px;
    background: var(--vgcl-border);
    border-radius: 4px;
    overflow: hidden;
}

.vgcl-rating-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--vgcl-accent) 0%, var(--vgcl-warning) 100%);
    transition: width 0.6s ease;
}

.vgcl-rating-value {
    font-family: var(--vgcl-font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: right;
}

/* ========== DECADE OVERVIEW ========== */
.vgcl-decade-hero {
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.vgcl-decade-hero::before {
    content: attr(data-decade);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--vgcl-font-heading);
    font-size: 15rem;
    font-weight: 900;
    color: rgba(255,255,255,0.03);
    pointer-events: none;
}

.vgcl-decade-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--vgcl-text);
}

/* ========== TIMELINE ========== */
.vgcl-timeline {
    position: relative;
    padding-left: 40px;
}

.vgcl-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--vgcl-border);
}

.vgcl-timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.vgcl-timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--vgcl-accent);
    border: 2px solid var(--vgcl-bg);
}

.vgcl-timeline-year {
    font-family: var(--vgcl-font-mono);
    color: var(--vgcl-accent);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* ========== CONSOLE GRID (Decade Overview) ========== */
.vgcl-console-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ========== BREADCRUMBS ========== */
.vgcl-breadcrumbs {
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--vgcl-text-muted);
}

.vgcl-breadcrumbs a { color: var(--vgcl-text-muted); }
.vgcl-breadcrumbs a:hover { color: var(--vgcl-accent); }
.vgcl-breadcrumbs .separator { margin: 0 8px; opacity: 0.5; }

/* ========== ARTICLE / BLOG ========== */
.vgcl-article {
    max-width: 800px;
    margin: 40px auto;
}

.vgcl-article-content p {
    margin: 0 0 1.2em;
}

.vgcl-article-content h2 {
    margin-top: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--vgcl-border);
}

/* ========== FOOTER ========== */
.vgcl-footer {
    background: var(--vgcl-primary);
    border-top: 1px solid var(--vgcl-border);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.vgcl-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.vgcl-footer h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: var(--vgcl-accent);
}

.vgcl-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vgcl-footer li { margin-bottom: 8px; }

.vgcl-footer a {
    color: var(--vgcl-text-muted);
    font-size: 0.9rem;
}

.vgcl-footer a:hover { color: #fff; }

.vgcl-footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--vgcl-border);
    color: var(--vgcl-text-muted);
    font-size: 0.85rem;
}

/* ========== SEARCH ========== */
.vgcl-search {
    position: relative;
}

.vgcl-search input {
    width: 100%;
    padding: 12px 20px;
    background: var(--vgcl-secondary);
    border: 1px solid var(--vgcl-border);
    border-radius: var(--vgcl-radius);
    color: var(--vgcl-text);
    font-size: 1rem;
}

.vgcl-search input:focus {
    outline: none;
    border-color: var(--vgcl-accent);
}

/* ========== MODELS GALLERY ========== */
.vgcl-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.vgcl-model-item {
    text-align: center;
    padding: 15px;
    background: var(--vgcl-secondary);
    border-radius: var(--vgcl-radius);
    border: 1px solid var(--vgcl-border);
}

.vgcl-model-item img {
    border-radius: 4px;
    margin-bottom: 8px;
}

.vgcl-model-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.vgcl-model-year {
    font-size: 0.75rem;
    color: var(--vgcl-text-muted);
}

/* ========== SIDEBAR (for blog/articles) ========== */
.vgcl-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 968px) {
    .vgcl-with-sidebar {
        grid-template-columns: 1fr;
    }
}

.vgcl-sidebar .widget {
    background: var(--vgcl-card-bg);
    border: 1px solid var(--vgcl-border);
    border-radius: var(--vgcl-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.vgcl-sidebar .widget-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--vgcl-border);
}

/* ========== GENERATION BADGE ========== */
.vgcl-gen-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    background: var(--vgcl-highlight);
    color: var(--vgcl-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== SCROLL ANIMATIONS ========== */
.vgcl-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.vgcl-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== BLOG GRID ========== */
.vgcl-blog-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.vgcl-cat-pill {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vgcl-text-muted);
    border: 1px solid var(--vgcl-border);
    border-radius: 20px;
    transition: all 0.2s;
}

.vgcl-cat-pill:hover,
.vgcl-cat-pill.active {
    background: var(--vgcl-accent);
    border-color: var(--vgcl-accent);
    color: #fff;
}

.vgcl-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.vgcl-blog-card {
    background: var(--vgcl-card-bg);
    border: 1px solid var(--vgcl-border);
    border-radius: var(--vgcl-radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.vgcl-blog-card:hover {
    transform: translateY(-3px);
    border-color: var(--vgcl-accent);
}

.vgcl-blog-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.vgcl-blog-card-link:hover {
    color: inherit;
}

.vgcl-blog-card-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--vgcl-secondary);
}

.vgcl-blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vgcl-blog-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--vgcl-secondary) 0%, var(--vgcl-highlight) 100%);
}

.vgcl-blog-card-body {
    padding: 18px;
}

.vgcl-blog-card-cat {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--vgcl-highlight);
    color: var(--vgcl-accent);
    border-radius: 4px;
    margin-bottom: 10px;
}

.vgcl-blog-card-title {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.vgcl-blog-card-excerpt {
    font-size: 0.88rem;
    color: var(--vgcl-text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}

.vgcl-blog-card-date {
    font-size: 0.78rem;
    color: var(--vgcl-text-muted);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .vgcl-blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== WP ADMIN BAR FIX ========== */
body.admin-bar .vgcl-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .vgcl-header {
        top: 46px;
    }
}
