/* =========================================================================
   DESIGN TOKENS
   Palette   : ink black-navy background, brass/gold accent, muted teal secondary
   Type      : Source Serif 4 (display/headlines), Inter (body/UI), JetBrains Mono (meta)
   Signature : the "post spine" date column + serif drop-cap on articles
   ========================================================================= */
:root {
    --bg-base: #12141c;
    --bg-surface: #1b1e29;
    --bg-surface-raised: #22273570;
    --border-subtle: #2c3040;

    --text-primary: #e9e8e3;
    --text-muted: #9498a6;

    --accent-brass: #c9a227;
    --accent-brass-hover: #e0b93a;
    --accent-teal: #4fa694;

    --font-display: "Source Serif 4", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-brass);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--accent-brass-hover); }

:focus-visible {
    outline: 2px solid var(--accent-brass);
    outline-offset: 2px;
}

.eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    color: var(--accent-teal);
    margin-bottom: 0.5rem;
}

/* ---------- Navbar ---------- */
.site-navbar {
    background: rgba(18, 20, 28, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}
.site-brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary) !important;
    letter-spacing: 0.01em;
}
.brand-mark { color: var(--accent-brass); font-size: 0.8em; }
.site-navbar .nav-link {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}
.site-navbar .nav-link:hover { color: var(--text-primary); }

/* ---------- Hero ---------- */
.hero {
    padding: 5.5rem 0 3.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    max-width: 720px;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.hero-sub {
    color: var(--text-muted);
    max-width: 560px;
    font-size: 1.05rem;
}

/* ---------- Post index (signature: the spine) ---------- */
.posts-section { padding: 3.5rem 0 4rem; }

.post-index { display: flex; flex-direction: column; }

.post-row {
    display: flex;
    gap: 1.75rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.post-row:first-child { padding-top: 0; }

.post-spine {
    flex: 0 0 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.2rem;
    border-right: 2px solid var(--accent-brass);
    font-family: var(--font-mono);
    color: var(--text-muted);
    line-height: 1.2;
}
.spine-date { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; }
.spine-day { font-size: 1.5rem; color: var(--text-primary); font-weight: 500; }
.spine-year { font-size: 0.72rem; }

.post-body { flex: 1; min-width: 0; }
.post-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--accent-brass); }
.post-summary { color: var(--text-muted); margin-bottom: 1rem; max-width: 640px; }
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.read-more-btn {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-teal);
}
.read-more-btn:hover { color: var(--accent-brass); }

.empty-state .empty-icon { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 1rem; display: block; }

/* ---------- Pagination ---------- */
.pagination .page-link {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}
.pagination .page-item.active .page-link {
    background: var(--accent-brass);
    border-color: var(--accent-brass);
    color: var(--bg-base);
}

/* ---------- Article / blog detail ---------- */
.article-page { padding: 4rem 0 5rem; }
.article-header { margin-bottom: 2rem; }
.article-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 3.5vw, 2.6rem);
    line-height: 1.2;
    margin: 0.4rem 0 1rem;
}
.article-summary { color: var(--text-muted); font-size: 1.08rem; max-width: 640px; }

.article-content {
    font-size: 1.08rem;
    color: #dcdbd6;
}
.article-content > *:first-child::first-letter {
    font-family: var(--font-display);
    font-size: 3.6rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    padding: 0.1rem 0.5rem 0 0;
    color: var(--accent-brass);
}
.article-content h2, .article-content h3 {
    font-family: var(--font-display);
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
}
.article-content img { max-width: 100%; border-radius: 6px; margin: 1.5rem 0; }
.article-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}
.article-content code {
    font-family: var(--font-mono);
    color: var(--accent-teal);
}
.article-content blockquote {
    border-left: 3px solid var(--accent-brass);
    padding-left: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 1.5rem 0;
}
.article-divider { border-color: var(--border-subtle); margin: 2.5rem 0; }
.back-link { font-size: 0.92rem; }

/* ---------- Ad slots ---------- */
.ad-slot {
    border: 1px dashed var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-surface);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    position: relative;
}
.ad-slot-label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ---------- Related posts ---------- */
.related-posts { margin-top: 3rem; }
.related-heading {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}
.related-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}
.related-card:hover { border-color: var(--accent-brass); color: var(--accent-brass); }
.related-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.related-title { font-family: var(--font-display); font-weight: 600; }

/* ---------- Static pages ---------- */
.static-page { padding: 4rem 0 5rem; }
.static-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    margin-bottom: 1.5rem;
}
.static-page p, .static-page li { color: #dcdbd6; }

/* ---------- Buttons ---------- */
.btn-brass {
    background: var(--accent-brass);
    border-color: var(--accent-brass);
    color: #16171f;
    font-weight: 600;
}
.btn-brass:hover, .btn-brass:focus {
    background: var(--accent-brass-hover);
    border-color: var(--accent-brass-hover);
    color: #16171f;
}
.btn-outline-light { border-color: var(--border-subtle); }

/* ---------- Forms ---------- */
.form-control, .form-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent-brass);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.15);
}
.form-label { color: var(--text-muted); font-size: 0.9rem; }
.form-text { color: var(--text-muted); font-size: 0.8rem; }

/* ---------- Admin ---------- */
.admin-auth-section { padding: 6rem 0; }
.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 2.5rem 2rem;
}
.admin-card-title { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 1.5rem; }
.admin-section { padding: 3rem 0 4rem; }
.admin-title { font-family: var(--font-display); font-size: 1.9rem; }
.admin-table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.5rem 1rem;
}
.admin-table { color: var(--text-primary); margin-bottom: 0; }
.admin-table thead th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom-color: var(--border-subtle);
}
.admin-table td { border-color: var(--border-subtle); }
.status-badge { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; }
.status-published { background: rgba(79, 166, 148, 0.18); color: var(--accent-teal); }
.status-draft { background: rgba(201, 162, 39, 0.18); color: var(--accent-brass); }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 0 2rem;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.footer-tagline { max-width: 320px; }
.footer-heading {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent-brass); }
.site-footer hr { border-color: var(--border-subtle); }
.footer-copyright { font-size: 0.8rem; margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .post-row { gap: 1rem; }
    .post-spine { flex-basis: 48px; }
    .spine-day { font-size: 1.2rem; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
