/* Fact Caliber: compact news portal for short summaries. No build step (served as is). */
:root {
  --accent: #c81e1e;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --text: #16181d;
  --muted: #5d6470;
  --line: #e4e4e0;
  --ok-bg: #e6f4ea; --ok: #136c34;
  --warn-bg: #fdf1dc; --warn: #8a4b00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --breaking-tint: rgba(220, 38, 38, .06);   /* red-600 at 6 %: news that was breaking */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Inter", system-ui, sans-serif;
  color-scheme: light;
}
/* Dark theme: the reader's choice (data-theme, set by the toggle) wins; otherwise the system. */
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #161a21; --surface-2: #1c212a;
  --text: #e8eaee; --muted: #a0a7b4; --line: #2a303b;
  --ok-bg: #12321f; --ok: #7ad69a; --warn-bg: #3a2a0f; --warn: #f3c068;
  --shadow: none;
  --breaking-tint: rgba(220, 38, 38, .12);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #161a21; --surface-2: #1c212a;
    --text: #e8eaee; --muted: #a0a7b4; --line: #2a303b;
    --ok-bg: #12321f; --ok: #7ad69a; --warn-bg: #3a2a0f; --warn: #f3c068;
    --shadow: none;
    --breaking-tint: rgba(220, 38, 38, .12);
  --breaking-tint: rgba(220, 38, 38, .12);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* Lucide icons (inline SVG, blade-lucide-icons): text size, text colour, mirrored in RTL. */
.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; stroke-width: 2.25; }
[dir="rtl"] .icon-dir { transform: scaleX(-1); }
.slider-btn { display: inline-flex; align-items: center; justify-content: center; }
.pager a, .pager span { display: inline-flex; align-items: center; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size, 16px);
  line-height: var(--line-height, 1.6);
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--text); }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.theme-toggle { font: inherit; color: inherit; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.masthead { padding: 18px 0 10px; }
.masthead .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { display: inline-flex; line-height: 0; }
.logo img { height: 52px; width: auto; }
/* Logo per theme: colour logo on light, white logo on dark (same rules as the colour tokens). */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; }
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-brand img { height: 36px; width: auto; max-width: none; flex: none; }
.tagline { color: var(--muted); font-size: .92rem; }
.catnav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); }
.catnav .wrap { position: relative; }
.catnav .wrap > ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.catnav a, .nav-more > button { display: block; padding: 11px 12px; white-space: nowrap; text-decoration: none; font-family: inherit; font-weight: 600; font-size: .93rem; line-height: inherit; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; }
.catnav a:hover, .nav-more > button:hover { color: var(--text); }
.catnav a[aria-current="page"], .nav-more > button[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
/* "More": the rest of the categories, on hover or keyboard/tap focus. */
.nav-more { position: relative; }
.nav-menu { display: none; position: absolute; top: 100%; inset-inline-start: 0; z-index: 30; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .14); }
.nav-more:hover .nav-menu, .nav-more:focus-within .nav-menu { display: block; }
.nav-menu a { padding: 8px 10px; border-bottom: 0; border-radius: 6px; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--surface-2); color: var(--text); }

/* ---------- breaking strip ---------- */
.breaking { background: var(--accent); color: #fff; }
.breaking .wrap { display: flex; align-items: center; gap: 14px; padding-top: 8px; padding-bottom: 8px; overflow: hidden; }
.breaking strong { flex: none; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 4px; }
.breaking ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.breaking li { white-space: nowrap; }
.breaking a { color: #fff; text-decoration: none; font-weight: 600; }
.breaking a:hover { text-decoration: underline; }

/* Footer stays at the bottom of the window on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { padding: 22px 0 40px; flex: 1 0 auto; }

/* ---------- section heads ---------- */
.section { margin-top: 44px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--text); padding-bottom: 6px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font: 800 1.2rem/1.3 var(--font-head); }
.section-head h2 a { text-decoration: none; }
.section-head a.more { color: var(--accent); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }

/* ---------- top of home ---------- */
.top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.lead { background: var(--surface-2); border-radius: var(--radius); padding: 22px; border-inline-start: 5px solid var(--accent); }
.lead .kicker { color: var(--accent); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.lead h1, .lead h2 { font: 800 1.85rem/1.25 var(--font-head); margin: 6px 0 10px; letter-spacing: -.01em; }
.lead h2 a { text-decoration: none; }
.lead h2 a:hover { color: var(--accent); }

/* ---------- top slider ---------- */
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-height: 260px; }
.slide .meta { margin-top: auto; }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
.slider-btn { font: 700 1rem/1 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; }
.slider-btn:hover { border-color: var(--accent); color: var(--accent); }
.slider-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.slider-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.slider-dots button[aria-current="true"] { background: var(--accent); width: 22px; border-radius: 999px; }
.lead p { font-size: 1.08rem; margin: 0 0 12px; }
.latest { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.latest h2 { margin: 0 0 6px; font: 800 1rem/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.latest ol { margin: 0; padding: 0; list-style: none; }
.latest li { padding: 12px 0; border-top: 1px solid var(--line); }
.latest li:first-child { border-top: 0; }
.latest .t { font-weight: 600; line-height: 1.4; display: block; }
.latest .s { margin: 4px 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.latest a.t { text-decoration: none; }
.latest a.t:hover { color: var(--accent); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.top-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
/* A news that was breaking when it was published keeps a light red background. */
.card.was-breaking, .lead.was-breaking { background-image: linear-gradient(var(--breaking-tint), var(--breaking-tint)); }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card.has-updates { border-top: 3px solid var(--accent); }
.card.has-updates:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h3 { margin: 0; font: 700 1.06rem/1.4 var(--font-head); }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .meta { margin-top: auto; padding-top: 6px; }
.card .meta a { position: relative; z-index: 1; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .82rem; color: var(--muted); }
.meta a { text-decoration: none; }
.meta a:hover { color: var(--text); text-decoration: underline; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px; letter-spacing: .01em; }
.badge-verified { background: var(--ok-bg); color: var(--ok); }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-breaking { background: var(--accent); color: #fff; text-transform: uppercase; }
.badge-cat { background: var(--surface-2); color: var(--muted); }
.badge-sub { font-size: .66rem; font-weight: 600; padding: 3px 6px; background: none; color: var(--muted); border: 1px solid var(--line); }
.updates-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; }

/* ---------- news page ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.article { max-width: 780px; }
.article h1 { font: 800 2rem/1.4 var(--font-head); margin: 10px 0 12px; letter-spacing: -.01em; }
.article .summary { font-size: 1.15rem; margin: 0 0 16px; }
.article .meta { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--text); color: var(--bg); border-radius: 8px; padding: 8px 14px; font-weight: 700; text-decoration: none; font-size: .9rem; }
.btn:hover { opacity: .9; }
.follows { max-width: 780px; background: var(--surface-2); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.follows h2 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.follows ol { margin: 0; padding-inline-start: 18px; }
.follows li { margin: 4px 0; }
.follows a { font-weight: 600; text-decoration: none; }
.follows a:hover { color: var(--accent); }

/* ---------- update tree (timeline) ---------- */
.tree { max-width: 780px; margin-top: 30px; }
.tree h2 { font: 800 1.2rem/1.3 var(--font-head); border-bottom: 2px solid var(--text); padding-bottom: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; padding-inline-start: 18px; border-inline-start: 2px solid var(--line); }
.timeline .timeline { margin-top: 10px; }
.node { position: relative; margin: 0 0 14px; }
.node::before { content: ""; position: absolute; inset-inline-start: -25px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.node-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.node-body .when { font-size: .8rem; color: var(--muted); font-weight: 600; }
.node-body h3 { margin: 2px 0 4px; font: 700 1rem/1.4 var(--font-head); }
.node-body h3 a { text-decoration: none; }
.node-body h3 a:hover { color: var(--accent); }
.node-body p { margin: 0 0 6px; color: var(--muted); font-size: .94rem; }
.more-link { display: inline-block; margin-top: 4px; color: var(--accent); font-weight: 700; text-decoration: none; font-size: .9rem; }
.more-link:hover { text-decoration: underline; }

/* ---------- category page ---------- */
.page-head h1 { font: 800 1.7rem/1.3 var(--font-head); margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.chips a[aria-current="page"], .chips a:hover { border-color: var(--accent); color: var(--accent); }
/* Archive filters: dates, category and the filter button in one row (wraps on small screens). */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 22px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.filters label { display: flex; flex-direction: column; gap: 5px; flex: 1 1 160px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.filters input, .filters select { width: 100%; min-height: 40px; padding: 8px 11px; font: 500 .95rem/1.3 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
.filters select { cursor: pointer; }
.filters input:hover, .filters select:hover { border-color: var(--muted); }
.filters input:focus-visible, .filters select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.filters button { min-height: 40px; padding: 8px 22px; font: 700 .95rem/1 var(--font); color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; cursor: pointer; transition: filter .15s; }
.filters button:hover { filter: brightness(1.08); }
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .filters { padding: 12px; }
  .filters button { flex: 1 1 100%; }
}
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.pager a, .pager span { border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; text-decoration: none; font-weight: 600; }
.pager span { color: var(--muted); opacity: .6; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---------- prose / errors ---------- */
.prose { max-width: 720px; }
.prose h1 { font: 800 1.8rem/1.3 var(--font-head); }
.prose h2 { font: 800 1.15rem/1.3 var(--font-head); margin-top: 28px; }
.prose li { margin: 8px 0; }
.error { text-align: center; padding: 60px 0; }
.error .code { font: 800 4rem/1 var(--font-head); color: var(--accent); }

/* ---------- footer ---------- */
/* ---------- social links ---------- */
.social { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.social a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.social a:hover { color: #fff; border-color: transparent; }
.social a.social-telegram:hover { background: #229ed9; }
.social a.social-facebook:hover { background: #1877f2; }
.social-footer a { padding-block: 0; padding-inline: 10px 12px; height: 34px; font-weight: 600; }

footer { border-top: 3px solid var(--accent); background: var(--surface-2); color: var(--muted); font-size: .9rem; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; padding-top: 34px; padding-bottom: 30px; }
footer p { margin: 0 0 10px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.footer-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.footer-title { margin: 0 0 12px; font: 800 .82rem/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--text); }
.footer-brand .footer-title { margin: 8px 0 0; }
.footer-col p a { color: var(--accent); font-weight: 600; }
.footer-bottom { border-top: 1px solid var(--line); font-size: .82rem; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding-top: 12px; padding-bottom: 12px; }

@media (max-width: 900px) {
  .top { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .lead { padding: 16px; }
  .lead h1, .lead h2, .article h1 { font-size: 1.5rem; }
  .slide { min-height: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  /* Narrow screens: the menu bar scrolls sideways; "More" opens under the bar's end. */
  .catnav .wrap > ul { overflow-x: auto; scrollbar-width: none; }
  .catnav .wrap > ul::-webkit-scrollbar { display: none; }
  .nav-more { position: static; }
  .nav-menu { inset-inline-start: auto; inset-inline-end: 16px; }
  .logo img { height: 40px; }
  .topbar .date { display: none; }
}
