/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --bg:           #fffbeb;
  --bg-alt:       #fef3c7;
  --surface:      #fffcf0;
  --border:       #fde68a;
  --border-mid:   #fcd34d;
  --text:         #1c1917;
  --text-muted:   #78716c;
  --text-faint:   #a8a29e;
  --accent:       #f59e0b;
  --accent-dark:  #d97706;
  --accent-text:  #92400e;
  --nav-bg:       rgba(255,251,235,0.96);
  --radius:       12px;
  --radius-sm:    8px;

  --warn-bg:      #fef3c7;
  --warn-border:  #fcd34d;
  --warn-text:    #92400e;
  --danger-bg:    #fee2e2;
  --danger-border:#fca5a5;
  --danger-text:  #7f1d1d;
  --success-bg:   #f0fdf4;
  --success-border:#86efac;
  --success-text: #14532d;
}

[data-theme="dark"] {
  --bg:           #1c1917;
  --bg-alt:       #292524;
  --surface:      #292524;
  --border:       #44403c;
  --border-mid:   #57534e;
  --text:         #fafaf9;
  --text-muted:   #a8a29e;
  --text-faint:   #78716c;
  --accent:       #fbbf24;
  --accent-dark:  #f59e0b;
  --accent-text:  #fbbf24;
  --nav-bg:       rgba(28,25,23,0.96);

  --warn-bg:      #1c1108;
  --warn-border:  #78350f;
  --warn-text:    #fcd34d;
  --danger-bg:    #1c0808;
  --danger-border:#7f1d1d;
  --danger-text:  #fca5a5;
  --success-bg:   #052e16;
  --success-border:#14532d;
  --success-text: #86efac;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--bg-alt); }
.nav-links a.active { color: var(--accent-dark); }

.nav-spacer { flex: 1; }

.theme-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .hamburger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 57px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; padding: 0.6rem 0.75rem; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-main { text-align: center; flex: 1; }
.footer a { color: var(--text-faint); text-decoration: underline; }
.footer a:hover { color: var(--accent); }

/* ── Page containers ──────────────────────────────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem; }
.page-wide  { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border-mid); }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; font-weight: 650; line-height: 1.4; margin-top: 1.75rem; margin-bottom: 0.5rem; }
h4 { font-size: 0.95rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.4rem; }

.page-subtitle { font-size: 1.05rem; color: var(--text-muted); margin-top: 0.5rem; margin-bottom: 2.5rem; }

/* ── Article body ─────────────────────────────────────────────────────────── */
.article-meta {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 0.4rem;
  margin-bottom: 2.5rem;
}

.article-body p { margin-bottom: 1rem; }
.article-body p:last-child { margin-bottom: 0; }

.article-body ul, .article-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}
.article-body li { margin-bottom: 0.35rem; }
.article-body li:last-child { margin-bottom: 0; }

.article-body strong { font-weight: 650; }
.article-body em { font-style: italic; }

.article-body a { color: var(--accent-dark); text-decoration: underline; }
.article-body a:hover { color: var(--accent); }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}
.article-body th {
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border-mid);
  color: var(--text);
}
.article-body td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.article-body tr:last-child td { border-bottom: none; }
.article-body td strong { color: var(--text); }

/* ── Callouts ─────────────────────────────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid;
}
.callout-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.callout p { margin: 0; font-size: 0.9rem; line-height: 1.6; }
.callout p + p { margin-top: 0.5rem; }

.callout-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}
.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.callout-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

/* ── Cards / grids ────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 1rem;
}
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-grid-5 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(245,158,11,0.08); }
.card-title { font-weight: 600; font-size: 0.95rem; color: var(--text); margin-bottom: 0.25rem; }
.card-desc  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.card-num   { font-size: 1.75rem; font-weight: 800; color: var(--border); margin-bottom: 0.5rem; line-height: 1; }

/* Numbered list cards */
.num-list { display: flex; flex-direction: column; gap: 0.75rem; }
.num-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.num-card:hover { border-color: var(--accent); }
.num-card-n { font-size: 1.5rem; font-weight: 800; color: var(--border-mid); flex-shrink: 0; line-height: 1.2; }
.num-card-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.num-card-desc  { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}
.badge-amber  { background: var(--warn-bg);    color: var(--warn-text);    }
.badge-green  { background: var(--success-bg); color: var(--success-text); }
.badge-red    { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-stone  { background: var(--bg-alt);     color: var(--text-muted);   }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #1c1917;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Article nav (prev/next) ──────────────────────────────────────────────── */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.article-nav a {
  flex: 1;
  display: block;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
  font-size: 0.875rem;
}
.article-nav a:hover { border-color: var(--accent); }
.article-nav .nav-label { font-size: 0.75rem; color: var(--text-faint); margin-bottom: 0.2rem; }
.article-nav .nav-title { font-weight: 600; }
.article-nav .next { text-align: right; }
.article-nav .spacer { flex: 1; }

/* ── Path comparison cards ────────────────────────────────────────────────── */
.path-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  background: var(--surface);
  margin-bottom: 1.25rem;
}
.path-card-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.path-num { font-size: 2.5rem; font-weight: 900; color: var(--border-mid); line-height: 1; }
.path-title { font-size: 1.15rem; font-weight: 700; }
.path-short { font-size: 0.82rem; }
.path-desc { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 0.95rem; }
.path-pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.pros-cons-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 0.5rem; }
.pros-cons-list { list-style: none; }
.pros-cons-list li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.pros-cons-list li .icon { flex-shrink: 0; margin-top: 0.1rem; }
@media (max-width: 560px) { .path-pros-cons { grid-template-columns: 1fr; } }

/* ── Schools list ─────────────────────────────────────────────────────────── */
.oblast-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.school-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.6rem;
  transition: border-color 0.15s;
}
.school-card:hover { border-color: var(--border-mid); }
.school-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.school-meta { font-size: 0.82rem; color: var(--text-muted); }
.school-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.school-link { font-size: 0.8rem; color: var(--accent-dark); text-decoration: none; margin-top: 0.3rem; display: inline-block; }
.school-link:hover { color: var(--accent); }

/* ── Checklist items (for focus/habits articles) ──────────────────────────── */
.checklist { list-style: none; margin: 0.75rem 0 1rem; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-mid);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Zayavlenie (form) ────────────────────────────────────────────────────── */
.doc-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.doc-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-mid);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  padding: 0.1rem 0.2rem;
  outline: none;
  width: 100%;
}
.doc-input:focus { border-bottom-color: var(--accent); }
.doc-input::placeholder { color: var(--text-faint); }

@media print {
  /* Hide everything — future design changes are automatically excluded */
  body * { visibility: hidden !important; }

  /* Reveal only the document and reset it to a clean white sheet */
  .doc-wrapper,
  .doc-wrapper * { visibility: visible !important; }

  html, body { margin: 0 !important; padding: 0 !important; background: white !important; }

  .doc-wrapper {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 2cm !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: white !important;
    color: black !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 11pt !important;
    line-height: 1.7 !important;
  }

  /* Input fields: underline only, no placeholder text */
  .doc-input {
    border: none !important;
    border-bottom: 1px solid #000 !important;
    background: transparent !important;
    color: black !important;
  }
  .doc-input::placeholder { color: transparent !important; }
}

/* ── Homepage hero ────────────────────────────────────────────────────────── */
.hero { margin-bottom: 3rem; }
.hero h1 { font-size: 2.5rem; }
@media (max-width: 600px) { .hero h1 { font-size: 1.85rem; } }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.75rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.75rem; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.78rem; }
.font-bold  { font-weight: 700; }
.placeholder-page { color: var(--text-faint); font-style: italic; }
