/* Shared stylesheet for every /docs/ page except the hub landing (docs/index.html,
   which is fully self-contained since it's the heaviest, most bespoke page).
   Category index pages and articles all include this file, so the whole
   docs/ area shares one warm, light, "reading" visual identity distinct
   from the app's own dark navy/turquoise control-room theme. */

@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/RobotoMono-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/RobotoMono-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/RobotoMono-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
    --cream: #faf6ee;
    --cream-deep: #f2ead9;
    --paper: #fffdf8;
    --ink: #2a2420;
    --ink-soft: #56493c;
    --ink-mute: #8a7f6f;
    --line: #e8dfc9;
    --teal: #0d9488;
    --teal-deep: #0b7d73;
    --teal-tint: #e3f3f1;
    --amber: #c2703d;
    --amber-tint: #f7e9dd;
    --plum: #7c5cbf;
    --plum-tint: #ece5f7;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow: 0 10px 30px -12px rgba(90, 66, 30, 0.18);
    --shadow-sm: 0 4px 14px -6px rgba(90, 66, 30, 0.14);
    --font-fa: 'Vazirmatn', "Segoe UI", Tahoma, sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--cream);
    background-image: radial-gradient(ellipse 1000px 560px at 85% -8%, rgba(13,148,136,0.06), transparent 60%),
        radial-gradient(ellipse 800px 500px at -5% 15%, rgba(194,112,61,0.05), transparent 55%);
    color: var(--ink);
    font-family: var(--font-fa);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-deep); }
::selection { background: rgba(13,148,136,0.18); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 28px; }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.75);
    backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 20;
}
.masthead-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px var(--teal-tint);
    flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.brand-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.03em; }
.masthead-back {
    font-size: 13px; color: var(--ink-soft); text-decoration: none;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line);
    transition: border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.masthead-back:hover { border-color: var(--teal); color: var(--teal-deep); }

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */
.crumbs {
    font-size: 12.5px; color: var(--ink-mute);
    margin: 26px 0 8px;
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--teal-deep); }

/* ── Category hero (index pages) ───────────────────────────────────────── */
.cat-hero { padding: 20px 0 40px; max-width: 62ch; }
.cat-hero-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 18px;
    background: var(--teal-tint); color: var(--teal-deep);
}
.cat-hero-b .cat-hero-icon { background: var(--amber-tint); color: var(--amber); }
.cat-hero-c .cat-hero-icon { background: var(--plum-tint); color: var(--plum); }
.cat-hero h1 { font-size: clamp(28px, 4.5vw, 38px); font-weight: 800; margin: 0 0 14px; text-wrap: balance; }
.cat-hero p { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state {
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    padding: 56px 32px;
    text-align: center;
    margin-bottom: 70px;
}
.empty-icon { font-size: 34px; display: block; margin-bottom: 14px; }
.empty-state h2 { font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.empty-state p { font-size: 14.5px; color: var(--ink-mute); max-width: 46ch; margin: 0 auto 24px; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.5px; font-weight: 600; color: var(--teal-deep);
    text-decoration: none;
    border: 1px solid var(--line); border-radius: 20px; padding: 9px 18px;
    transition: border-color .15s ease;
}
.back-link:hover { border-color: var(--teal); }

/* ── Article list (populated category pages) ──────────────────────────── */
.article-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 70px; }
.article-card {
    display: flex; align-items: center; gap: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--teal); }
.article-num {
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    color: var(--teal-deep); background: var(--teal-tint);
    border-radius: 10px; padding: 6px 10px; flex: none;
}
.article-body { flex: 1; min-width: 0; }
.article-body h3 { font-size: 16px; font-weight: 700; margin: 0 0 5px; }
.article-body p { font-size: 13.5px; color: var(--ink-mute); margin: 0; }
.article-arrow { color: var(--ink-mute); flex: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--line);
    padding: 26px 0 40px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: var(--ink-mute);
}
footer a { color: var(--ink-mute); text-decoration: none; }
footer a:hover { color: var(--teal-deep); }
footer .src { direction: ltr; font-family: var(--font-mono); }

@media (max-width: 640px) {
    .cat-hero { padding: 14px 0 30px; }
}

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