/* ============================================================
   The SQL Geek — Main Stylesheet
   Brand: Red (#CC0000) + Black (#0A0A0A) + White
   Fonts: Exo 2 (headings) · Inter (body) · JetBrains Mono (code)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
    /* Colors */
    --clr-bg:           #0A0A0A;
    --clr-surface:      #111111;
    --clr-surface-2:    #181818;
    --clr-surface-3:    #1F1F1F;
    --clr-border:       #2A2A2A;
    --clr-border-light: #333333;

    --clr-red:          #CC0000;
    --clr-red-dark:     #8B0000;
    --clr-red-light:    #E60000;
    --clr-red-glow:     rgba(204, 0, 0, 0.15);
    --clr-red-subtle:   rgba(204, 0, 0, 0.08);

    --clr-text:         #F0F0F0;
    --clr-text-muted:   #9A9A9A;
    --clr-text-faint:   #555555;
    --clr-white:        #FFFFFF;

    --clr-code-bg:      #0D0D0D;
    --clr-tag-bg:       #1A0A0A;

    /* Typography */
    --font-heading: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
    --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --gap:    1.5rem;
    --radius: 6px;
    --radius-lg: 12px;

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    /* Shadows */
    --shadow:       0 2px 12px rgba(0,0,0,0.4);
    --shadow-hover: 0 6px 24px rgba(0,0,0,0.6);
    --shadow-red:   0 4px 20px rgba(204,0,0,0.25);

    /* Layout */
    --container:    1200px;
    --sidebar-w:    300px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--clr-red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-red-light); }
a:focus-visible { outline: 2px solid var(--clr-red); outline-offset: 3px; border-radius: 2px; }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--clr-white);
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1.25rem; color: var(--clr-text); }
p:last-child { margin-bottom: 0; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--clr-code-bg);
    color: #e06c75;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--clr-border);
}

pre {
    background: var(--clr-code-bg);
    border: 1px solid var(--clr-border);
    border-left: 3px solid var(--clr-red);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: #abb2bf;
    font-size: 0.9rem;
    line-height: 1.6;
}

blockquote {
    border-left: 4px solid var(--clr-red);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--clr-surface-2);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--clr-text-muted);
    font-style: italic;
}

hr {
    border: none;
    border-top: 1px solid var(--clr-border);
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
th, td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--clr-border);
    text-align: left;
}
th {
    background: var(--clr-surface-2);
    color: var(--clr-white);
    font-family: var(--font-heading);
    font-weight: 600;
}
tr:nth-child(even) td { background: var(--clr-surface); }

/* ── Skip Link ─────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--clr-red);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 9999;
    transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

/* ── Screen Reader Only ────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--clr-red); outline-offset: 3px; }

.btn-primary {
    background: var(--clr-red);
    color: #fff;
    border-color: var(--clr-red);
}
.btn-primary:hover {
    background: var(--clr-red-light);
    border-color: var(--clr-red-light);
    color: #fff;
    box-shadow: var(--shadow-red);
}

.btn-outline {
    background: transparent;
    color: var(--clr-red);
    border-color: var(--clr-red);
}
.btn-outline:hover {
    background: var(--clr-red-subtle);
    color: var(--clr-red-light);
}

.btn-ghost {
    background: transparent;
    color: var(--clr-text-muted);
    border-color: var(--clr-border);
}
.btn-ghost:hover {
    color: var(--clr-text);
    border-color: var(--clr-border-light);
    background: var(--clr-surface-2);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--clr-text);
    font-family: var(--font-heading);
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--clr-red);
    box-shadow: 0 0 0 3px var(--clr-red-glow);
}
.form-control::placeholder { color: var(--clr-text-faint); }
textarea.form-control { resize: vertical; min-height: 120px; }

.form-hint {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--clr-text-muted);
}
.form-error {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #ff6b6b;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}
.alert-success { background: rgba(0,200,100,0.1); border-color: #00c864; color: #6ee7b7; }
.alert-danger  { background: rgba(204,0,0,0.12);  border-color: var(--clr-red); color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,0.1); border-color: #3b82f6; color: #93c5fd; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: #f59e0b; color: #fcd34d; }

/* ── Badge / Tag ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-heading);
    background: var(--clr-red-subtle);
    color: var(--clr-red-light);
    border: 1px solid rgba(204,0,0,0.2);
    line-height: 1.5;
}

.tag-link {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--clr-tag-bg);
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border);
    transition: all var(--transition);
    font-family: var(--font-mono);
}
.tag-link:hover {
    background: var(--clr-red-subtle);
    color: var(--clr-red-light);
    border-color: rgba(204,0,0,0.3);
}

/* ── Category Chip ─────────────────────────────────────────── */
.cat-chip {
    display: inline-block;
    padding: 0.2em 0.7em;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--clr-red);
    color: #fff;
    transition: background var(--transition);
}
.cat-chip:hover { background: var(--clr-red-light); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   HEADER / NAV
══════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    box-shadow: 0 1px 20px rgba(0,0,0,0.4);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 64px;
}

.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 44px; width: auto; }

.main-nav { flex: 1; }
.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    color: var(--clr-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-body);
}
.nav-link:hover, .nav-link.active {
    color: var(--clr-white);
    background: var(--clr-surface-2);
}
.nav-link.active { color: var(--clr-red); }
.caret { font-size: 0.65em; opacity: 0.7; transition: transform var(--transition); }
.dropdown-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.4rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 300;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.dropdown-toggle[aria-expanded="true"] + .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    color: var(--clr-text-muted);
    font-size: 0.875rem;
    transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover {
    background: var(--clr-surface-3);
    color: var(--clr-white);
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.header-search:focus-within { border-color: var(--clr-red); }
.header-search input {
    background: none;
    border: none;
    color: var(--clr-text);
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    width: 160px;
    font-family: var(--font-body);
}
.header-search input::placeholder { color: var(--clr-text-faint); }
.header-search button {
    background: none;
    border: none;
    padding: 0.4rem 0.75rem 0.4rem 0.25rem;
    color: var(--clr-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.header-search button:hover { color: var(--clr-red); }

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
}
.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--clr-text);
    position: relative;
    transition: background var(--transition);
}
.hamburger::before, .hamburger::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: var(--clr-text);
    position: absolute;
    transition: transform var(--transition), top var(--transition);
}
.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }
.menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.menu-toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger::after  { top: 0; transform: rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem var(--gap);
    z-index: 199;
    box-shadow: var(--shadow);
}
.mobile-menu[hidden] { display: none; }
.mobile-nav-list a {
    display: block;
    padding: 0.65rem 0;
    color: var(--clr-text-muted);
    border-bottom: 1px solid var(--clr-border);
    font-size: 1rem;
}
.mobile-nav-list a:hover { color: var(--clr-red); }
.mobile-search {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.mobile-search input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    color: var(--clr-text);
    font-family: var(--font-body);
}
.mobile-search button {
    padding: 0.55rem 1rem;
    background: var(--clr-red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb-nav {
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 0.6rem 0;
    font-size: 0.82rem;
}
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    color: var(--clr-text-faint);
}
.breadcrumb li + li::before { content: '/'; margin-right: 0.25rem; }
.breadcrumb a { color: var(--clr-text-muted); }
.breadcrumb a:hover { color: var(--clr-red); }
.breadcrumb [aria-current="page"] { color: var(--clr-text); }

/* ══════════════════════════════════════════════════════════════
   HERO / HOMEPAGE BANNER
══════════════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, #0A0A0A 0%, #160000 50%, #0A0A0A 100%);
    border-bottom: 1px solid var(--clr-border);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--clr-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--clr-border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.hero-text { flex: 1; min-width: 280px; }
.hero-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--clr-red);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(204,0,0,0.3);
    padding: 0.2em 0.7em;
    border-radius: 3px;
    background: var(--clr-red-subtle);
}
.hero h1 { margin-bottom: 0.75rem; }
.hero h1 span { color: var(--clr-red); }
.hero-desc {
    color: var(--clr-text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin-bottom: 1.5rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT: MAIN CONTENT + SIDEBAR
══════════════════════════════════════════════════════════════ */
.content-area {
    padding: 3rem 0;
}
.content-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 2.5rem;
    align-items: start;
}
.sidebar { position: sticky; top: 80px; }

/* ── Section Heading ───────────────────────────────────────── */
.section-heading {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-red);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-heading::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--clr-red);
    border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════════
   POST CARDS
══════════════════════════════════════════════════════════════ */
.posts-grid {
    display: grid;
    gap: 1.5rem;
}
.posts-grid-cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.post-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    border-color: rgba(204,0,0,0.35);
    box-shadow: var(--shadow-red);
    transform: translateY(-2px);
}

.post-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--clr-surface-2);
    flex-shrink: 0;
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--clr-surface-2), var(--clr-surface-3));
}
.post-card-image-placeholder svg { opacity: 0.15; }

.post-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.post-meta-date, .post-meta-read {
    font-size: 0.78rem;
    color: var(--clr-text-faint);
    font-family: var(--font-mono);
}
.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-white);
    margin-bottom: 0.6rem;
    line-height: 1.35;
    transition: color var(--transition);
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--clr-red); }

.post-card-excerpt {
    color: var(--clr-text-muted);
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--clr-border);
}
.post-author {
    font-size: 0.8rem;
    color: var(--clr-text-faint);
}
.post-author strong { color: var(--clr-text-muted); }

/* Featured (larger) post card */
.post-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
}
.post-card-featured .post-card-image {
    width: 45%;
    aspect-ratio: unset;
    min-height: 240px;
}
.post-card-featured .post-card-body { padding: 2rem; }
.post-card-featured .post-card-title { font-size: 1.5rem; }

/* ══════════════════════════════════════════════════════════════
   SINGLE POST
══════════════════════════════════════════════════════════════ */
.post-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--clr-border);
    background: linear-gradient(180deg, #110000 0%, var(--clr-bg) 100%);
}
.post-header .container { max-width: 820px; }
.post-category-meta { margin-bottom: 1rem; }

.post-title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--clr-white);
}

.post-byline {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--clr-text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}
.post-byline-sep { color: var(--clr-text-faint); }

.post-featured-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

/* Post body content */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--clr-text);
    max-width: 720px;
}
.post-content h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--clr-border);
}
.post-content h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.post-content h4 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.post-content ul, .post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.4rem; }
.post-content a { border-bottom: 1px solid rgba(204,0,0,0.4); }
.post-content a:hover { border-color: var(--clr-red); }
.post-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--clr-border);
}

.post-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.post-tags-label { font-size: 0.8rem; color: var(--clr-text-faint); font-family: var(--font-mono); }

/* Post Navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--clr-border);
}
.post-nav-item {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color var(--transition);
}
.post-nav-item:hover { border-color: rgba(204,0,0,0.35); }
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--clr-text-faint); font-family: var(--font-mono); display: block; margin-bottom: 0.3rem; }
.post-nav-title { font-size: 0.9rem; font-weight: 600; color: var(--clr-text); }

/* Author Bio Box */
.author-box {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--clr-surface-2);
    border: 2px solid var(--clr-border);
}
.author-name { font-weight: 700; margin-bottom: 0.25rem; font-family: var(--font-heading); }
.author-bio  { font-size: 0.875rem; color: var(--clr-text-muted); }

/* ══════════════════════════════════════════════════════════════
   COMMENTS
══════════════════════════════════════════════════════════════ */
.comments-section { margin-top: 3rem; }
.comment-list { display: grid; gap: 1.25rem; margin-bottom: 2.5rem; }
.comment {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--clr-red);
    font-size: 1rem;
    flex-shrink: 0;
}
.comment-author { font-weight: 600; font-size: 0.9rem; }
.comment-date   { font-size: 0.78rem; color: var(--clr-text-faint); font-family: var(--font-mono); }
.comment-body p { font-size: 0.9rem; margin-bottom: 0; }

.comment-form-wrap {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.comment-form-wrap h3 { margin-bottom: 1.25rem; font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR WIDGETS
══════════════════════════════════════════════════════════════ */
.widget {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.widget-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-red);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.widget-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 12px;
    background: var(--clr-red);
    border-radius: 2px;
}

/* Recent posts widget */
.recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--clr-border);
    align-items: flex-start;
}
.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-post-thumb {
    width: 56px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--clr-surface-2);
}
.recent-post-info a {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-text);
    line-height: 1.35;
    margin-bottom: 0.2rem;
}
.recent-post-info a:hover { color: var(--clr-red); }
.recent-post-info time { font-size: 0.72rem; color: var(--clr-text-faint); font-family: var(--font-mono); }

/* Categories widget */
.cat-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--clr-border);
}
.cat-list-item:last-child { border-bottom: none; }
.cat-list-item a { font-size: 0.875rem; color: var(--clr-text-muted); }
.cat-list-item a:hover { color: var(--clr-red); }

/* Tags widget */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ══════════════════════════════════════════════════════════════
   DATA RESOURCES PAGE
══════════════════════════════════════════════════════════════ */
.resources-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #0A0A0A 0%, #0d0300 100%);
    border-bottom: 1px solid var(--clr-border);
}
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.resource-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.resource-card:hover {
    border-color: rgba(204,0,0,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}
.resource-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--clr-white);
    line-height: 1.3;
}
.resource-featured-badge {
    background: linear-gradient(135deg, var(--clr-red-dark), var(--clr-red));
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15em 0.5em;
    border-radius: 3px;
    flex-shrink: 0;
    font-family: var(--font-heading);
}
.resource-desc {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    line-height: 1.6;
    flex: 1;
}
.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-red);
    font-family: var(--font-mono);
    margin-top: auto;
}
.resource-link:hover { color: var(--clr-red-light); gap: 0.55rem; }

/* Category filter tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    color: var(--clr-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-heading);
}
.filter-tab:hover, .filter-tab.active {
    background: var(--clr-red);
    border-color: var(--clr-red);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   PAGE TEMPLATES (About, Contact, Static)
══════════════════════════════════════════════════════════════ */
.page-hero {
    padding: 3rem 0;
    background: linear-gradient(180deg, #110000 0%, var(--clr-bg) 100%);
    border-bottom: 1px solid var(--clr-border);
}
.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero p { color: var(--clr-text-muted); max-width: 600px; }

.page-content-wrap { max-width: 820px; padding: 3rem 0; }
.page-content-wrap h2 { margin: 2rem 0 0.75rem; }
.page-content-wrap p, .page-content-wrap li { color: var(--clr-text-muted); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2.5rem;
    align-items: start;
    padding: 3rem 0;
}
.contact-info-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.contact-info-card h3 { margin-bottom: 1rem; }
.contact-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--clr-border);
    font-size: 0.9rem;
    color: var(--clr-text-muted);
}
.contact-detail:last-child { border-bottom: none; }
.contact-detail-icon { color: var(--clr-red); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--clr-border);
}
.pagination-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    border-radius: var(--radius);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-muted);
    font-size: 0.875rem;
    transition: all var(--transition);
    font-family: var(--font-heading);
    font-weight: 600;
}
.page-link:hover { border-color: var(--clr-red); color: var(--clr-red); }
.page-link.active { background: var(--clr-red); border-color: var(--clr-red); color: #fff; }
.pagination-info { font-size: 0.8rem; color: var(--clr-text-faint); font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--clr-surface);
    border-top: 3px solid var(--clr-red);
    margin-top: auto;
    padding-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2.5rem;
}
.footer-logo { margin-bottom: 0.75rem; height: 36px; }
.footer-tagline { font-size: 0.875rem; color: var(--clr-text-muted); margin-bottom: 1.25rem; }
.social-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-muted);
    transition: all var(--transition);
}
.social-link:hover {
    background: var(--clr-red-subtle);
    border-color: rgba(204,0,0,0.4);
    color: var(--clr-red);
}
.footer-heading {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-text-faint);
    margin-bottom: 1rem;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--clr-text-muted); }
.footer-links a:hover { color: var(--clr-red); }
.footer-recent .post-meta-date { display: block; font-size: 0.72rem; color: var(--clr-text-faint); font-family: var(--font-mono); margin-top: 0.1rem; }
.footer-recent a { font-size: 0.82rem; font-weight: 600; color: var(--clr-text-muted); }
.footer-recent a:hover { color: var(--clr-red); }

.footer-bottom {
    border-top: 1px solid var(--clr-border);
    padding: 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--clr-text-faint);
}
.copyright a { color: var(--clr-text-faint); }
.copyright a:hover { color: var(--clr-red); }

/* ══════════════════════════════════════════════════════════════
   SEARCH RESULTS
══════════════════════════════════════════════════════════════ */
.search-banner { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--clr-border); background: var(--clr-surface); }
.search-form-big {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
    margin-top: 1rem;
}
.search-form-big input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    color: var(--clr-text);
    font-size: 1rem;
    font-family: var(--font-body);
}
.search-form-big input:focus { outline: none; border-color: var(--clr-red); }
.search-count { font-size: 0.875rem; color: var(--clr-text-muted); margin-top: 0.5rem; }

/* ══════════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════════ */
.text-red    { color: var(--clr-red); }
.text-muted  { color: var(--clr-text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--clr-text-faint);
}
.empty-state h3 { margin-bottom: 0.5rem; color: var(--clr-text-muted); }
.divider { border: none; border-top: 1px solid var(--clr-border); margin: 2rem 0; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .post-card-featured { flex-direction: column; }
    .post-card-featured .post-card-image { width: 100%; min-height: 200px; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-nav, .header-search { display: none; }
    .menu-toggle { display: flex; align-items: center; }
    .header-inner { gap: 0.75rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .post-nav { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .posts-grid-cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    :root { --gap: 1rem; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .author-box { flex-direction: column; }
    .resources-grid { grid-template-columns: 1fr; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .sidebar, .comments-section { display: none; }
    body { background: #fff; color: #000; }
    .post-content { max-width: 100%; }
}
