/* ═══════════════════════════════════════════════════
   RaTurka Documentation Portal — Design System CSS
   Fonts: Inter + JetBrains Mono (Google Fonts)
   Accent: #30c5d8
   ═══════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-alt:      oklch(0.975 0.004 250);
  --border:      oklch(0.90 0.006 250);
  --text:        oklch(0.22 0.012 250);
  --text-muted:  oklch(0.50 0.012 250);
  --accent:      #30c5d8;
  --accent-text: #04181b;
  --card-bg:     #ffffff;
  --header-bg:   rgba(255,255,255,0.85);
  --code-bg:     oklch(0.975 0.004 250);
  --code-text:   oklch(0.25 0.012 250);
  --note-bg:     oklch(0.94 0.03 200);
  --warn-bg:     oklch(0.94 0.05 70);
  --note-label:  oklch(0.40 0.09 200);
  --warn-label:  oklch(0.42 0.13 55);
  --shadow-lg:   0 24px 60px rgba(0,0,0,0.12);
  --font-sans:   'Schibsted Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   10px;
  --radius-xl:   12px;
  --radius-2xl:  14px;
}

[data-theme="dark"] {
  --bg:         oklch(0.16 0.012 250);
  --bg-alt:     oklch(0.20 0.012 250);
  --border:     oklch(0.30 0.012 250);
  --text:       oklch(0.95 0.006 250);
  --text-muted: oklch(0.64 0.012 250);
  --card-bg:    oklch(0.19 0.012 250);
  --header-bg:  oklch(0.16 0.012 250 / 0.85);
  --code-bg:    oklch(0.12 0.01 250);
  --code-text:  oklch(0.90 0.006 250);
  --note-bg:    oklch(0.24 0.05 200);
  --warn-bg:    oklch(0.26 0.06 70);
  --shadow-lg:  0 24px 60px rgba(0,0,0,0.40);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
::selection { background: var(--accent); color: var(--accent-text); }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ── Header ────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 72px; padding: 0 28px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-logo-wrap { display: flex; align-items: center; gap: 12px; }
.header-logo { display: flex; align-items: center; }
.header-logo img { height: 34px; width: auto; }

/* Search — centered column */
.header-search-center { display: flex; justify-content: center; }
.header-search {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 520px; height: 42px;
  padding: 0 16px; border-radius: var(--radius-lg);
  border: 1.5px solid var(--border); background: var(--bg-alt);
  color: var(--text-muted); font-size: 14.5px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.header-search:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.85 0.06 200 / 0.25);
}
.header-search-text { flex: 1; text-align: left; }

/* Right controls group */
.header-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* Icon button (theme toggle, mobile menu) */
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--text); font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--accent); }

/* Keyboard shortcut badge */
.kbd {
  font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-family: var(--font-mono);
  margin-left: auto;
}

/* Language switcher */
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: border-color 0.15s;
}
.lang-btn:hover { border-color: var(--accent); }
.lang-menu-wrap { position: relative; }
.lang-menu {
  position: absolute; top: 42px; right: 0;
  min-width: 150px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}
.lang-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: 7px;
  border: none; background: none;
  color: var(--text); font-weight: 500; font-size: 13.5px;
  text-align: left; transition: background 0.1s;
}
.lang-menu-item:hover,
.lang-menu-item.active { background: var(--bg-alt); }
.lang-menu-item.active { color: var(--accent); font-weight: 600; }

/* ── Body Layout ───────────────────────────────────── */
.body-grid {
  display: grid;
  grid-template-columns: 1fr;        /* home: no sidebar */
  max-width: 1360px;
  margin: 0 auto;
  align-items: start;
}
.body-grid.has-sidebar {
  grid-template-columns: 256px minmax(0, 1fr);
}
.body-grid.has-sidebar.with-toc {
  grid-template-columns: 256px minmax(0, 1fr) 232px;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section { margin-bottom: 14px; }

.cat-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 7px;
  background: none; border: none;
  font-size: 14px; font-weight: 600; color: var(--text);
  text-align: left; margin-bottom: 2px;
  transition: background 0.1s; text-decoration: none;
}
.cat-row:hover,
.cat-row.active { background: var(--bg-alt); }

.art-row {
  display: block; width: 100%;
  padding: 7px 10px 7px 38px; border-radius: 7px;
  font-size: 13.5px; color: var(--text-muted); font-weight: 400;
  text-decoration: none; transition: background 0.1s, color 0.1s;
}
.art-row:hover { background: var(--bg-alt); color: var(--text); }
.art-row.active { background: var(--bg-alt); color: var(--accent); font-weight: 600; }

/* ── Sidebar: Subcategories ────────────────────────── */
.sidebar-subcats {
  margin: 3px 0 4px 12px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-subcat { display: flex; flex-direction: column; }

.subcat-row {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-decoration: none; margin-top: 5px; margin-bottom: 1px;
  transition: background 0.1s, color 0.1s;
}
.subcat-row:hover { background: var(--bg-alt); color: var(--text); }
.subcat-row.active { color: var(--accent); background: var(--bg-alt); }

.subcat-art-row {
  display: block; padding: 5px 8px 5px 26px;
  border-radius: 6px; font-size: 13px;
  color: var(--text-muted); text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.subcat-art-row:hover { background: var(--bg-alt); color: var(--text); }
.subcat-art-row.active { background: var(--bg-alt); color: var(--accent); font-weight: 600; }

/* ── Category Page: Subcategory Cards ──────────────── */
.subcat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-bottom: 36px;
}
.subcat-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.subcat-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(48,197,216,0.10); }
.subcat-card-header { display: flex; align-items: center; gap: 10px; }
.subcat-card-title {
  font-weight: 600; font-size: 15px; color: var(--text);
  text-decoration: none; transition: color 0.1s;
}
.subcat-card-title:hover { color: var(--accent); }
.subcat-card-articles {
  display: flex; flex-direction: column; gap: 5px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.subcat-card-art-link {
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: color 0.1s;
}
.subcat-card-art-link:hover { color: var(--accent); }
.subcat-card-count { font-size: 12.5px; color: var(--accent); font-weight: 500; }

/* Category badge — letter / emoji / image */
.badge {
  display: flex; align-items: center; justify-content: center;
  flex: none; font-weight: 700; color: #04181b;
}
.badge-xs { width: 16px; height: 16px; font-size: 9px;  border-radius: 4px; }
.badge-sm { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
.badge-lg { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }

.badge-emoji { background: var(--bg-alt); color: var(--text); }

.badge-img-xs  { width: 16px; height: 16px; border-radius: 4px;  object-fit: cover; flex: none; display: block; }
.badge-img-sm  { width: 20px; height: 20px; border-radius: 5px;  object-fit: cover; flex: none; display: block; }
.badge-img-lg  { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; display: block; }

/* ── Main Content ──────────────────────────────────── */
.main {
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 760px;
}
/* Home page: no sidebar, center the wider content column */
.main-home {
  min-width: 0;
  padding: 48px 48px 90px;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

/* ── Table of Contents (right panel on article page) ─ */
.toc {
  position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
  padding: 40px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.toc-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 10px;
  text-transform: uppercase;
}
.toc-link {
  font-size: 13px; color: var(--text-muted);
  padding: 5px 0 5px 10px;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.toc-link:hover  { color: var(--accent); border-left-color: var(--accent); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* ── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.1s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-muted); }

/* ── Hero (homepage) ───────────────────────────────── */
.hero {
  padding: 16px 0 44px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}
.hero-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 14px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: 42px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 14px; line-height: 1.15;
}
.hero-sub {
  font-size: 17px; color: var(--text-muted); line-height: 1.6;
  max-width: 620px; margin: 0 0 26px;
}
.hero-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 480px; width: 100%; height: 48px;
  padding: 0 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-alt);
  cursor: pointer; transition: border-color 0.15s;
}
.hero-search:hover { border-color: var(--accent); }
.hero-search span { color: var(--text-muted); font-size: 15px; }

/* Category grid (homepage) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.cat-card {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; padding: 20px;
  border-radius: var(--radius-xl); border: 1px solid var(--border);
  background: var(--card-bg); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cat-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(48,197,216,0.12); }
.cat-card-title { font-weight: 600; font-size: 16px; color: var(--text); }
.cat-card-desc  { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.cat-card-count { font-size: 13px; color: var(--text-muted); }

/* Popular articles list (homepage) */
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); margin: 0 0 14px;
  text-transform: uppercase;
}
.popular-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
}
.popular-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
  text-decoration: none; transition: background 0.1s;
}
.popular-row:hover { background: var(--bg-alt); }
.popular-title { color: var(--text); font-weight: 500; font-size: 14.5px; }
.popular-cat   { color: var(--text-muted); font-size: 13px; }

/* ── Category Page ─────────────────────────────────── */
.cat-header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.cat-h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.cat-desc { font-size: 15.5px; color: var(--text-muted); line-height: 1.6; margin: 14px 0 32px; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.article-card {
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; padding: 18px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--card-bg); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.article-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(48,197,216,0.10); }
.article-card-title { font-weight: 600; font-size: 15.5px; color: var(--text); }
.article-card-desc  { font-size: 13px; color: var(--text-muted); }
.article-card-cta   { font-size: 12.5px; color: var(--accent); font-weight: 500; }

/* ── Article Page ──────────────────────────────────── */
.article-h1 {
  font-size: 32px; font-weight: 700; letter-spacing: -0.015em;
  margin: 0; line-height: 1.2;
}
.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 14px; color: var(--text-muted);
  margin: 20px 0 0; padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-meta-item { display: flex; align-items: center; gap: 6px; }
.article-meta-item strong { color: var(--text); font-weight: 600; }
.article-meta-icon { font-size: 13px; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); flex: none; }

/* Prose: headings — scroll-margin-top offsets the sticky header (72px) + breathing room */
.prose h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
  margin: 32px 0 14px; color: var(--text);
  scroll-margin-top: 88px;
}
.prose h3 {
  font-size: 17px; font-weight: 700; margin: 24px 0 10px; color: var(--text);
  scroll-margin-top: 88px;
}
.prose h4 { scroll-margin-top: 88px; }
.prose p {
  font-size: 15.5px; line-height: 1.75; color: var(--text);
  margin: 0 0 14px; text-wrap: pretty;
}
.prose ul, .prose ol {
  margin: 0 0 16px; padding-left: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.prose li { font-size: 15.5px; line-height: 1.6; color: var(--text); }

/* Inline code */
.prose code {
  font-family: var(--font-mono); font-size: 13.5px;
  background: var(--bg-alt); color: var(--accent);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code blocks */
.prose pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  overflow-x: auto; margin: 0 0 16px;
}
.prose pre code {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: var(--code-text); background: none; border: none; padding: 0;
  border-radius: 0;
}

/* Blockquote → styled callout */
.prose blockquote {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--note-bg); font-size: 14.5px;
  line-height: 1.6; color: var(--text); margin: 0 0 16px;
  border: none;
}
.prose blockquote p { margin: 0; font-size: 14.5px; }
.prose blockquote strong { color: var(--note-label); font-size: 11.5px; letter-spacing: 0.06em; }

/* Tables */
.prose table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); margin: 0 0 16px;
}
.prose th {
  text-align: left; padding: 10px 14px;
  background: var(--bg-alt); color: var(--text-muted);
  font-weight: 600; font-size: 12.5px; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}
.prose td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.prose tr:last-child td { border-bottom: none; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose a:hover { opacity: 0.8; }

/* Search result highlighting */
.prose mark, mark {
  background: oklch(0.92 0.12 85); color: var(--text);
  padding: 1px 2px; border-radius: 2px;
}
[data-theme="dark"] mark {
  background: oklch(0.40 0.12 85); color: var(--text);
}

/* ── Search Modal ──────────────────────────────────── */
.search-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 50;
}
.search-panel {
  position: fixed; top: 12vh; left: 50%;
  transform: translateX(-50%);
  width: min(560px, 92vw); max-height: 60vh;
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 51; display: flex; flex-direction: column; overflow: hidden;
}
.search-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.search-icon { font-size: 16px; color: var(--text-muted); }
.search-input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 16px; color: var(--text); font-family: var(--font-sans);
}
.search-input::placeholder { color: var(--text-muted); }
.search-results { overflow-y: auto; padding: 8px; }
.search-hint {
  padding: 20px 14px; font-size: 13.5px;
  color: var(--text-muted); text-align: center;
}
.search-result-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border-radius: 8px;
  text-decoration: none; transition: background 0.1s;
}
.search-result-row:hover { background: var(--bg-alt); }
.search-result-title { font-size: 14.5px; font-weight: 500; color: var(--text); }
.search-result-sub   { font-size: 12.5px; color: var(--text-muted); }
.search-result-excerpt { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Mobile Drawer ─────────────────────────────────── */
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 82vw; max-width: 320px;
  background: var(--bg); z-index: 41;
  display: flex; flex-direction: column;
  box-shadow: 2px 0 24px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.mobile-drawer-title { font-weight: 700; font-size: 15px; color: var(--text); }
.mobile-drawer-body { padding: 12px; overflow-y: auto; flex: 1; }
.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
}
.mobile-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── Search: Rate Limit Warning ────────────────────── */
.search-rate-limit {
  margin: 4px; padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--warn-bg); color: var(--warn-label);
  font-size: 14px; text-align: center;
}

/* ── Site Footer (corporate, always visible) ───────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding: 56px 28px 52px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-logo-link { display: inline-flex; }
.footer-logo-img { height: 30px; width: auto; }
.footer-brand-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.7;
  max-width: 300px;
}

/* Footer newsletter */
.footer-newsletter { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.footer-newsletter-label { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.footer-newsletter-form { display: flex; gap: 8px; }
.footer-newsletter-input {
  flex: 1; min-width: 0; height: 38px;
  padding: 0 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 13.5px; font-family: var(--font-sans);
  outline: none; transition: border-color 0.15s;
}
.footer-newsletter-input:focus { border-color: var(--accent); }
.footer-newsletter-input::placeholder { color: var(--text-muted); }
.footer-newsletter-btn {
  height: 38px; padding: 0 16px; border-radius: var(--radius-md);
  border: none; background: var(--accent); color: var(--accent-text);
  font-size: 13.5px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s;
}
.footer-newsletter-btn:hover { opacity: 0.88; }
.footer-newsletter-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.footer-newsletter-msg {
  font-size: 13px; min-height: 18px;
}
.footer-newsletter-msg.success { color: oklch(0.55 0.15 150); }
.footer-newsletter-msg.error   { color: var(--warn-label); }

/* Footer columns */
.footer-col { display: flex; flex-direction: column; gap: 14px; }
.footer-col-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text); margin-bottom: 2px;
}
.footer-link {
  font-size: 14px; color: var(--text-muted); text-decoration: none;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }

/* Products column */
.footer-product-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; padding: 4px 0;
  transition: opacity 0.15s;
}
.footer-product-link:hover { opacity: 0.72; }
.footer-product-icon { width: 45px; height: 45px; object-fit: contain; border-radius: 6px; flex: none; }
.footer-product-link span { font-size: 14px; font-weight: 500; color: var(--text); }

/* Footer bottom bar */
.footer-bottom {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.footer-copyright { font-size: 13px; color: var(--text-muted); }
.footer-legal-links { display: flex; align-items: center; gap: 20px; }
.footer-legal-link {
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  transition: color 0.15s;
}
.footer-legal-link:hover { color: var(--text); }

/* ── 404 Page ──────────────────────────────────────── */
.not-found {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; text-align: center;
  padding: 40px 20px; gap: 16px;
}
.not-found h1 { font-size: 96px; font-weight: 700; color: var(--border); line-height: 1; }
.not-found h2 { font-size: 24px; font-weight: 700; }
.not-found p  { color: var(--text-muted); }
.not-found a  { color: var(--accent); font-weight: 600; }

/* ── FAQ Accordion ─────────────────────────────────── */
.faq-section { margin-top: 48px; }
.faq-section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); text-transform: uppercase;
  margin: 0 0 16px;
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.faq-item:has(.faq-answer:not([hidden])) {
  border-color: var(--accent);
}

.faq-trigger {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%; padding: 16px 18px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 15px;
  font-weight: 500; color: var(--text); text-align: left;
  transition: color 0.15s;
}
.faq-trigger:hover { color: var(--accent); }
.faq-trigger[aria-expanded="true"] { color: var(--accent); }

.faq-icon {
  flex: none; width: 20px; height: 20px;
  border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1),
              background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Smooth height animation via CSS grid trick */
.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4,0,0.2,1);
}
.faq-answer-wrap.open {
  grid-template-rows: 1fr;
}
.faq-answer-inner { overflow: hidden; }

.faq-answer {
  padding: 0 18px 16px;
  font-size: 14.5px; line-height: 1.7;
  color: var(--text-muted);
}
.faq-answer p   { margin: 0 0 8px; font-size: 14.5px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a   { color: var(--accent); text-decoration: underline; }
.faq-answer code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg-alt); color: var(--accent);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}

/* ── Utilities ─────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Responsive ────────────────────────────────────── */

/* Tablet + Mobile: sidebar/TOC → mobile drawer, hamburger visible */
@media (max-width: 1099px) {
  .sidebar { display: none; }
  .body-grid.has-sidebar,
  .body-grid.has-sidebar.with-toc { grid-template-columns: minmax(0, 1fr); }
  .mobile-menu-btn { display: flex !important; }
}
@media (min-width: 1100px) {
  .mobile-menu-btn { display: none !important; }
}

/* TOC: only show at large screens */
@media (max-width: 1339px) {
  .toc { display: none; }
}
@media (min-width: 1340px) {
  .body-grid.has-sidebar.with-toc { grid-template-columns: 256px minmax(0, 1fr) 232px; }
}

/* Mobile phones */
@media (max-width: 767px) {
  .header { gap: 8px; padding: 0 16px; height: 64px; }
  .header-logo img { max-width: 110px; }
  .header-right { gap: 6px; }
  /* Hamburger: flat, no card */
  .mobile-menu-btn { background: transparent; border-color: transparent; font-size: 20px; }
  /* Lang: flag only */
  .lang-label { display: none; }
  /* Search as full input bar in center column */
  .header-search-center { display: flex; }
  .header-search { width: 100%; max-width: none; height: 38px; font-size: 13.5px; }
  .header-search .kbd { display: none; }
  .header-search-text { font-size: 13px; }

  .main { padding: 24px 18px 60px; }
  .main-home { padding: 28px 18px 60px; }
  .hero h1 { font-size: 30px; }
  .article-h1, .cat-h1 { font-size: 26px; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 20px 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { padding: 16px 20px; }
  .footer-newsletter-form { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal-links { gap: 12px; flex-wrap: wrap; }
}

/* ── Reading progress bar ──────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 3px; width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* ── Smooth transitions ────────────────────────────── */
body, .header, .sidebar, .main, .cat-card, .article-card {
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
