/* fallacy.is — ink-on-paper, reference-feel */

:root {
    --bg: #faf8f4;
    --bg-panel: #ffffff;
    --ink: #1a1a1f;
    --ink-soft: #3d3d45;
    --ink-muted: #6b7280;
    --rule: #e5e3dc;
    --rule-soft: #efede6;
    --accent: #b33a1b;                 /* deep terracotta */
    --accent-soft: #f6e9e3;

    --cat-logical: #1a3a5c;
    --cat-logical-soft: #e7eef6;
    --cat-bias: #5c1a3a;
    --cat-bias-soft: #f6e7ee;
    --cat-rhetorical: #3a5c1a;
    --cat-rhetorical-soft: #ecf4e0;
    --cat-debate: #5c3a1a;
    --cat-debate-soft: #f4ece0;

    --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --max: 1100px;
    --radius: 4px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--mono);
    font-size: 0.92em;
    background: var(--rule-soft);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--ink);
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--ink);
    color: #f2efe8;
    border-bottom: 1px solid #000;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}
.site-logo {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.3px;
    color: #f6f3ea;
}
.site-logo:hover { text-decoration: none; color: #fff; }
.site-logo span { color: var(--accent); }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
    color: #d6d2c8;
    font-size: 14px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.site-nav a:hover { color: #fff; text-decoration: none; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #f2efe8;
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 760px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--ink);
        padding: 16px 24px;
        border-bottom: 1px solid #000;
    }
    .site-nav.open { display: flex; }
    .nav-toggle { display: block; }
    .site-header { position: relative; }
}

/* ---------- Hero ---------- */
.hero {
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--rule);
    background: linear-gradient(180deg, #faf8f4 0%, #f3efe5 100%);
}
.hero h1 {
    font-family: var(--serif);
    font-size: 52px;
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}
.hero .lede {
    font-size: 20px;
    color: var(--ink-soft);
    max-width: 640px;
    margin: 0 0 28px;
}
.hero-example {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}
.hero-example code {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    padding: 6px 12px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .hero { padding: 48px 0 36px; }
    .hero h1 { font-size: 36px; }
    .hero .lede { font-size: 17px; }
}

/* ---------- Category sections (home) ---------- */
.category-section {
    padding: 48px 0 16px;
    border-bottom: 1px solid var(--rule);
}
.category-heading {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
    letter-spacing: -0.2px;
}
.category-heading a { color: var(--ink); }
.category-heading a:hover { color: var(--accent); text-decoration: none; }

.category-page {
    padding: 48px 0;
}
.category-page h1 {
    font-family: var(--serif);
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 12px;
}
.category-page .lede {
    color: var(--ink-soft);
    font-size: 18px;
    max-width: 640px;
    margin: 0 0 32px;
}

/* ---------- Fallacy grid ---------- */
.fallacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.fallacy-card {
    display: block;
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.fallacy-card:hover {
    border-color: var(--ink-soft);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.fallacy-card h3 {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ink);
}
.fallacy-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- Entry page (fallacy detail) ---------- */
.entry {
    padding: 48px 0 64px;
}
.entry-container {
    max-width: 760px;
}
.entry-head {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
}
.entry-category-row { margin-bottom: 12px; }
.entry-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 3px;
    background: var(--cat-logical-soft);
    color: var(--cat-logical);
}
.entry-category.category-cognitive-bias    { background: var(--cat-bias-soft); color: var(--cat-bias); }
.entry-category.category-rhetorical-device { background: var(--cat-rhetorical-soft); color: var(--cat-rhetorical); }
.entry-category.category-debate-tactic     { background: var(--cat-debate-soft); color: var(--cat-debate); }

.entry-head h1 {
    font-family: var(--serif);
    font-size: 48px;
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.4px;
}
.entry-definition {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    color: var(--ink-soft);
    line-height: 1.4;
    margin: 0 0 20px;
}
.entry-shortlink {
    font-size: 14px;
    color: var(--ink-muted);
    margin: 0;
}
.entry-shortlink code {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.alias-list { color: var(--ink-muted); }

.entry-body h2 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 12px;
    letter-spacing: -0.2px;
}
.entry-body h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 8px;
}
.entry-body p { margin: 0 0 16px; }
.entry-body blockquote {
    margin: 24px 0;
    padding: 12px 20px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-soft);
}
.entry-body ul, .entry-body ol { margin: 0 0 16px 24px; }
.entry-body li { margin: 6px 0; }
.entry-body hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

@media (max-width: 640px) {
    .entry-head h1 { font-size: 34px; }
    .entry-definition { font-size: 19px; }
}

/* ---------- Related ---------- */
.related {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
}
.related h2 {
    font-family: var(--serif);
    font-size: 22px;
    margin: 0 0 16px;
}

/* ---------- Articles ---------- */
.articles-index { padding: 48px 0; }
.articles-index h1 {
    font-family: var(--serif);
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 12px;
}
.articles-index .lede { color: var(--ink-soft); margin: 0 0 32px; }
.article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-list-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
}
.article-list-item:last-child { border-bottom: 0; }
.article-list-item a { color: var(--ink); display: block; }
.article-list-item a:hover { text-decoration: none; }
.article-list-item h2 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
}
.article-list-item a:hover h2 { color: var(--accent); }
.article-list-item .meta {
    font-size: 14px;
    color: var(--ink-muted);
    margin: 0 0 8px;
}
.article-list-item p {
    color: var(--ink-soft);
    margin: 0;
}
.empty { color: var(--ink-muted); }

.article { padding: 48px 0 64px; }
.article-container { max-width: 720px; }
.article-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.article-header h1 {
    font-family: var(--serif);
    font-size: 42px;
    line-height: 1.15;
    font-weight: 700;
    margin: 0 0 12px;
}
.article-meta { font-size: 14px; color: var(--ink-muted); margin: 0 0 12px; }
.article-lede {
    font-family: var(--serif);
    font-size: 20px;
    font-style: italic;
    color: var(--ink-soft);
    margin: 0;
}
.article-cover {
    width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: var(--radius);
}
.article-body h2 {
    font-family: var(--serif);
    font-size: 26px;
    margin: 40px 0 12px;
}
.article-body p { margin: 0 0 16px; }
.article-body blockquote {
    margin: 24px 0;
    padding: 12px 20px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-style: italic;
}
.article-body ul, .article-body ol { margin: 0 0 16px 24px; }

/* ---------- Prose pages (About, Privacy, Terms, Error) ---------- */
.prose-page { padding: 48px 0 64px; }
.prose-page .container { max-width: 720px; }
.prose-page h1 {
    font-family: var(--serif);
    font-size: 40px;
    margin: 0 0 20px;
}
.prose-page h2 {
    font-family: var(--serif);
    font-size: 22px;
    margin: 32px 0 10px;
}
.prose-page p { margin: 0 0 14px; }
.prose-page ul { margin: 0 0 14px 24px; }
.prose-page li { margin: 4px 0; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 48px;
    padding: 32px 0 24px;
    border-top: 1px solid var(--rule);
    background: #f0ede4;
    color: var(--ink-muted);
    font-size: 14px;
}
.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--ink-muted); }
.footer-nav a:hover { color: var(--accent); }
