/* =============================================================
   Slovenčina portál — zdieľané štýly
   Dizajn: paper, sépia, Cormorant Garamond, decentné, tlačiteľné
   Použitie: dashboard + 42 podstránok pracovných listov
   ============================================================= */

/* ========== CSS PROMENNÉ ========== */
:root {
  /* Paper / ink */
  --paper: #f5f0e6;
  --paper-warm: #ebe3d2;
  --paper-shadow: #d9cfb8;
  --ink: #1a1614;
  --line: #3a322b;
  --muted: #6b5d50;
  --gold: #a8843e;

  /* Default accent — bordová (literatúra) */
  --accent: #8b1a1a;
  --accent-deep: #5c0e0e;
  --accent-bright: #c2410c;
  --accent-soft: rgba(139, 26, 26, 0.08);
  --accent-fade: rgba(139, 26, 26, 0.04);

  /* Typografia */
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --container-max: 1180px;
  --container-pad: 32px;
  --base-font: 19px;
  --line-height: 1.6;
}

/* ========== KATEGÓRIE — accent farby ========== */
body[data-category="literatura"] {
  --accent: #8b1a1a;
  --accent-deep: #5c0e0e;
  --accent-bright: #c2410c;
  --accent-soft: rgba(139, 26, 26, 0.08);
  --accent-fade: rgba(139, 26, 26, 0.04);
}

body[data-category="jazyk"] {
  --accent: #1e3a5f;
  --accent-deep: #142940;
  --accent-bright: #2c5282;
  --accent-soft: rgba(30, 58, 95, 0.08);
  --accent-fade: rgba(30, 58, 95, 0.04);
}

body[data-category="styl"] {
  --accent: #2d5a3d;
  --accent-deep: #1d3d28;
  --accent-bright: #3f7a54;
  --accent-soft: rgba(45, 90, 61, 0.08);
  --accent-fade: rgba(45, 90, 61, 0.04);
}

body[data-category="osp"] {
  --accent: #a8843e;
  --accent-deep: #7d6228;
  --accent-bright: #c79b48;
  --accent-soft: rgba(168, 132, 62, 0.10);
  --accent-fade: rgba(168, 132, 62, 0.05);
}

body[data-category="info"] {
  --accent: #6b5d50;
  --accent-deep: #4a3f37;
  --accent-bright: #8a7a6b;
  --accent-soft: rgba(107, 93, 80, 0.10);
  --accent-fade: rgba(107, 93, 80, 0.05);
}

/* ========== RESET ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  line-height: var(--line-height);
  font-size: var(--base-font);
  background-image:
    radial-gradient(circle at 20% 30%, var(--accent-fade) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168, 132, 62, 0.05) 0%, transparent 50%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========== PAPER GRAIN ========== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

::selection { background: var(--accent); color: var(--paper); }

/* ========== LAYOUT ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
  z-index: 2;
}

main.container { padding-top: 40px; padding-bottom: 80px; }

/* ========== BREADCRUMB ========== */
.breadcrumb {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 18px var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
  z-index: 3;
  border-bottom: 1px solid rgba(58, 50, 43, 0.12);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb span { color: var(--ink); }

.breadcrumb .sep {
  margin: 0 10px;
  color: var(--paper-shadow);
}

/* ========== NAV BACK ========== */
.nav-back {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
  background: var(--paper);
}

.nav-back:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ========== HERO ========== */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: linear-gradient(180deg, transparent 0%, rgba(26, 22, 20, 0.03) 100%);
  z-index: 2;
}

.hero-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-meta::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--ink);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--muted);
  margin-top: 24px;
  max-width: 62ch;
  line-height: 1.45;
}

/* ========== TOGGLE KEY BUTTON (sticky) ========== */
.toggle-key-btn {
  position: fixed;
  top: 20px;
  right: 40px;
  z-index: 100;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(26, 22, 20, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-key-btn .icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

.toggle-key-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

body.show-keys .toggle-key-btn {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

/* ========== CONTENT SECTION (číslované) ========== */
.content-section {
  padding: 64px 0;
  border-bottom: 1px solid rgba(58, 50, 43, 0.18);
  counter-increment: section-counter;
  position: relative;
}

.content-section:last-of-type { border-bottom: none; }

main.container { counter-reset: section-counter; }

.content-section > h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 32px;
  max-width: 22ch;
  color: var(--ink);
  position: relative;
  padding-top: 8px;
}

.content-section > h2::before {
  content: counter(section-counter, upper-roman);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 18px;
}

.content-section h2 em {
  font-style: italic;
  color: var(--accent);
}

/* H3, H4 */
h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 44px 0 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

h4 {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 12px;
  font-weight: 500;
}

h5 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  margin: 20px 0 10px;
  color: var(--ink);
}

/* ========== TYPOGRAFIA ========== */
p {
  margin-bottom: 18px;
  max-width: 75ch;
}

p strong { color: var(--ink); font-weight: 600; }

ul, ol {
  margin: 18px 0 18px 28px;
  max-width: 75ch;
}

li {
  margin-bottom: 8px;
  line-height: 1.55;
}

ul li::marker { color: var(--accent); }
ol li::marker { color: var(--accent); font-family: var(--mono); font-size: 0.9em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover { color: var(--accent-deep); }

/* ========== FILL (medzera na doplnenie) ========== */
.fill {
  display: inline-block;
  min-width: 80px;
  padding: 1px 10px;
  margin: 0 2px;
  border-bottom: 2px dashed var(--accent);
  background: var(--paper-warm);
  cursor: pointer;
  font-style: italic;
  color: transparent;
  font-weight: 500;
  transition: all 0.25s ease;
  border-radius: 2px 2px 0 0;
  user-select: none;
  position: relative;
  vertical-align: baseline;
}

.fill::after {
  content: '\00A0\00A0\00A0\00A0\00A0\00A0\00A0\00A0\00A0\00A0';
  color: transparent;
}

.fill::before {
  content: '?';
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  position: absolute;
  top: -10px;
  right: -4px;
  background: var(--accent);
  color: var(--paper);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.25s ease;
}

.fill:hover {
  background: var(--paper-shadow);
}

.fill:hover::before {
  transform: scale(1.15);
  background: var(--accent-deep);
}

/* Revealed state — kľúč zobrazený */
.fill.revealed,
body.show-keys .fill {
  background: var(--accent-soft);
  border-bottom: 2px solid var(--accent);
  color: var(--accent-deep);
  cursor: default;
}

.fill.revealed::after,
body.show-keys .fill::after {
  content: attr(data-answer);
  color: var(--accent-deep);
}

.fill.revealed::before,
body.show-keys .fill::before {
  content: '\2713';
  background: var(--ink);
}

.fill[data-answer=""] {
  border-bottom-style: dotted;
}

.fill[data-answer=""].revealed::after,
body.show-keys .fill[data-answer=""]::after {
  content: '— kľúč nedostupný —';
  font-style: italic;
  color: var(--muted);
  font-size: 0.85em;
}

/* ========== ANSWER KEY (collapsible block) ========== */
.answer-key {
  margin: 48px 0 0;
  padding: 32px 36px;
  background: var(--ink);
  color: var(--paper);
  border-left: 4px solid var(--accent);
  position: relative;
}

.answer-key[hidden] { display: none; }

body.show-keys .answer-key[hidden] { display: block; }

.answer-key h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--accent-bright);
  margin: 0 0 18px;
}

.answer-key h4 {
  color: var(--gold);
  margin-top: 20px;
}

.answer-key p,
.answer-key li {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
}

.answer-key ol,
.answer-key ul {
  margin-left: 22px;
}

.answer-key strong {
  color: var(--accent-bright);
  font-weight: 600;
}

.answer-key em {
  color: var(--gold);
  font-style: italic;
}

/* ========== EXCERPT (citácia / ukážka) ========== */
.excerpt {
  margin: 36px 0;
  padding: 28px 36px 28px 32px;
  border-left: 3px solid var(--accent);
  background: var(--paper-warm);
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  position: relative;
  max-width: 80ch;
}

.excerpt::before {
  content: '\201E';
  font-family: var(--serif);
  font-size: 72px;
  color: var(--accent);
  position: absolute;
  top: -8px;
  left: 12px;
  line-height: 1;
  opacity: 0.25;
  font-style: italic;
}

.excerpt p { margin-bottom: 14px; max-width: none; }
.excerpt p:last-child { margin-bottom: 0; }

.excerpt cite {
  display: block;
  margin-top: 18px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ========== META (pod nadpisom) ========== */
.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.meta span { display: inline-flex; align-items: center; gap: 8px; }

.meta span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ========== INFO CARD ========== */
.info-card {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  padding: 28px 32px;
  margin: 32px 0;
  position: relative;
}

.info-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 28px;
  border-top: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
}

.info-card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 28px;
  height: 28px;
  border-bottom: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
}

.info-card > h3:first-child,
.info-card > h4:first-child { margin-top: 0; }

.info-card p:last-child { margin-bottom: 0; }

/* ========== TASK BLOCK ========== */
.task {
  background: linear-gradient(135deg, var(--accent-fade) 0%, rgba(168, 132, 62, 0.04) 100%);
  border-left: 4px solid var(--accent);
  padding: 22px 28px;
  margin: 28px 0;
  position: relative;
}

.task-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}

.task p { margin-bottom: 10px; }
.task p:last-child { margin-bottom: 0; }

/* ========== TABULKY ========== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-family: var(--serif);
  background: var(--paper);
  border: 1px solid var(--line);
}

thead {
  background: var(--ink);
  color: var(--paper);
}

th {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 14px 16px;
  text-align: left;
  border-right: 1px solid rgba(168, 132, 62, 0.3);
}

th:last-child { border-right: none; }

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(58, 50, 43, 0.12);
  border-right: 1px solid rgba(58, 50, 43, 0.08);
  vertical-align: top;
  line-height: 1.5;
}

td:last-child { border-right: none; }

tbody tr:nth-child(even) { background: rgba(168, 132, 62, 0.04); }
tbody tr:hover { background: var(--accent-fade); }
tbody tr:last-child td { border-bottom: none; }

/* ========== SOURCE LINK ========== */
.source-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.source-link::before {
  content: '\2737';
  font-size: 12px;
  color: var(--accent);
}

.source-link:hover {
  background: var(--accent-soft);
}

.source-link[href*="wikipedia"]::before { content: '\2734'; }
.source-link[href*="youtube"]::before,
.source-link[href*="youtu.be"]::before { content: '\25B6'; }

/* ========== YOUTUBE EMBED ========== */
.video-embed {
  margin: 32px 0;
  background: var(--ink);
  border: 1px solid var(--line);
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-embed iframe,
.video-embed lite-youtube {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* ========== DEFINITION LIST ========== */
.definition,
dl.definition-list {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 20px;
  margin: 18px 0;
}

dl.definition-list dt,
.definition dt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
  margin-top: 14px;
}

dl.definition-list dt:first-child,
.definition dt:first-child { margin-top: 0; }

dl.definition-list dd,
.definition dd {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
  margin-left: 0;
}

/* ========== FOOTER ========== */
.page-footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 40px 0;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  z-index: 2;
}

.page-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.page-footer a {
  color: var(--paper);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.page-footer a:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent-bright);
}

.page-footer span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 240, 230, 0.5);
}

/* ========== SEARCH MODAL ========== */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 20, 0.85);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(4px);
}

.search-modal.open { display: flex; }

.search-modal-inner {
  width: min(640px, 92vw);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  padding: 24px;
}

.search-modal input {
  width: 100%;
  font-family: var(--serif);
  font-size: 22px;
  padding: 12px 4px;
  border: none;
  border-bottom: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search-modal input:focus { border-bottom-color: var(--accent); }

.search-results {
  margin-top: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.search-result {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(58, 50, 43, 0.12);
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.search-result:hover,
.search-result.selected {
  background: var(--accent-soft);
}

.search-result-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}

.search-result-cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.search-hint {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
  text-align: right;
}

/* ========== BOOKMARK BTN ========== */
.bookmark-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(26, 22, 20, 0.08);
}

.bookmark-btn:hover {
  background: var(--ink);
  color: var(--accent-bright);
}

.bookmark-btn.active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

/* ========== KEYBOARD HINT ========== */
.kbd-hint {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 80;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid rgba(58, 50, 43, 0.2);
  padding: 8px 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

body:not(.presentation) .kbd-hint:not(.show) { opacity: 0; }
.kbd-hint.show { opacity: 0.85; }

kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  border-radius: 2px;
  margin: 0 2px;
  letter-spacing: 0;
}

/* ============================================================
   PRESENTATION MODE — učiteľ na projektore
   ============================================================ */
body.presentation {
  --base-font: 25px;
  --container-max: 1400px;
}

body.presentation { font-size: var(--base-font); }

body.presentation .breadcrumb,
body.presentation .nav-back,
body.presentation .bookmark-btn,
body.presentation .kbd-hint { display: none; }

body.presentation .toggle-key-btn {
  font-size: 13px;
  padding: 12px 22px;
}

body.presentation .hero { padding: 60px 0 50px; }
body.presentation .hero h1 { font-size: clamp(56px, 8vw, 110px); }
body.presentation .hero-sub { font-size: 28px; }

body.presentation .content-section { padding: 48px 0; }
body.presentation .content-section > h2 { font-size: clamp(40px, 5.5vw, 68px); }
body.presentation h3 { font-size: 36px; margin: 36px 0 18px; }

body.presentation .excerpt { font-size: 24px; }
body.presentation table { font-size: 20px; }

body.presentation .fill { min-width: 110px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --base-font: 18px; --container-pad: 28px; }
}

@media (max-width: 768px) {
  :root { --base-font: 17px; --container-pad: 22px; }

  .hero { padding: 56px 0 44px; }
  .hero h1 { font-size: clamp(36px, 8vw, 56px); }
  .hero-sub { font-size: 18px; }

  .content-section { padding: 48px 0; }
  .content-section > h2 { font-size: clamp(28px, 6vw, 38px); }
  h3 { font-size: 24px; }

  .excerpt { padding: 22px 24px 22px 22px; font-size: 17px; }
  .info-card { padding: 22px 24px; }
  .task { padding: 18px 22px; }
  .answer-key { padding: 24px 24px; }

  /* Mobile FAB — bottom-right floating action button */
  .toggle-key-btn {
    top: auto;
    right: 16px;
    bottom: 16px;
    min-width: 56px;
    min-height: 56px;
    padding: 14px 20px;
    border-radius: 28px;
    font-size: 12px;
    letter-spacing: 0.14em;
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    box-shadow: 0 6px 20px rgba(26, 22, 20, 0.28);
    gap: 10px;
  }

  .toggle-key-btn .icon {
    width: 18px;
    height: 18px;
  }

  .toggle-key-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(26, 22, 20, 0.3);
  }

  body.show-keys .toggle-key-btn {
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 26, 26, 0.4);
  }

  /* Larger tap targets for breadcrumb/footer */
  .breadcrumb a {
    display: inline-block;
    padding: 8px 4px;
    min-height: 44px;
    line-height: 28px;
  }

  .page-footer a {
    display: inline-block;
    padding: 10px 6px;
    min-height: 44px;
    line-height: 24px;
  }

  /* Larger fill tap target on mobile */
  .fill {
    min-width: 90px;
    padding: 4px 12px;
  }

  .bookmark-btn {
    width: 48px;
    height: 48px;
    bottom: 16px;
    /* Bookmark stays at right:16, but FAB needs to clear it */
    right: 16px;
  }

  /* When both FAB and bookmark exist, FAB is the priority — bookmark moves left */
  body[data-slug] .bookmark-btn {
    right: auto;
    left: 16px;
  }

  .kbd-hint { display: none; }

  table { font-size: 14px; }
  th, td { padding: 10px 10px; }

  .page-footer .container { flex-direction: column; text-align: center; }
  .page-footer .container > * { line-height: 1.4; }
}

@media (max-width: 480px) {
  :root { --base-font: 16px; --container-pad: 18px; }

  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: clamp(30px, 9vw, 44px); }

  .breadcrumb { font-size: 10px; padding: 14px var(--container-pad); }
  .breadcrumb .sep { margin: 0 6px; }

  .meta { font-size: 10px; gap: 14px; }

  ul, ol { margin-left: 22px; }

  .toggle-key-btn {
    font-size: 11px;
    padding: 13px 18px;
  }
}

@media (max-width: 360px) {
  :root { --container-pad: 14px; }
  .hero h1 { font-size: 28px; }
}

/* ============================================================
   PRINT — A4, čierno-biele, kľúč inline
   ============================================================ */
@media print {
  @page {
    size: A4;
    margin: 18mm 16mm;
  }

  :root {
    --base-font: 11pt;
    --paper: #ffffff;
    --paper-warm: #fafafa;
    --paper-shadow: #f0f0f0;
    --ink: #000000;
    --line: #333333;
    --muted: #555555;
    --accent: #000000;
    --accent-deep: #000000;
    --accent-bright: #333333;
    --gold: #555555;
    --accent-soft: #f5f5f5;
    --accent-fade: #fafafa;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
    line-height: 1.45;
    background-image: none !important;
  }

  body::before { display: none !important; }

  .breadcrumb,
  .nav-back,
  .toggle-key-btn,
  .bookmark-btn,
  .kbd-hint,
  .search-modal,
  .video-embed,
  .page-footer { display: none !important; }

  .container { max-width: 100%; padding: 0; }

  main.container { padding: 0; }

  .hero {
    padding: 0 0 18pt;
    border-bottom: 1pt solid black;
    page-break-after: avoid;
  }

  .hero h1 {
    font-size: 28pt;
    color: black;
    page-break-after: avoid;
  }

  .hero h1 em { color: black; font-style: italic; }
  .hero-sub { font-size: 13pt; color: #333; }
  .hero-meta { font-size: 8pt; }
  .hero-meta::before { background: black; }

  .content-section {
    padding: 16pt 0;
    border-bottom: 0.5pt solid #888;
    page-break-inside: avoid;
  }

  .content-section > h2 {
    font-size: 18pt;
    color: black;
    page-break-after: avoid;
  }

  .content-section > h2::before {
    color: black;
    font-size: 9pt;
  }

  h3 {
    font-size: 14pt;
    page-break-after: avoid;
    color: black;
  }

  h4 { font-size: 9pt; color: #555; }

  /* Fills — show answers inline */
  .fill {
    background: transparent !important;
    border: none !important;
    border-bottom: 1pt solid black !important;
    color: black !important;
    font-style: italic;
    font-weight: 500;
    padding: 0 4pt !important;
  }

  .fill::before { display: none !important; }

  .fill::after {
    content: attr(data-answer) !important;
    color: black !important;
  }

  .fill[data-answer=""]::after {
    content: "______________" !important;
    color: black !important;
  }

  .answer-key,
  .answer-key[hidden] {
    display: block !important;
    background: white !important;
    color: black !important;
    border: 1pt solid black !important;
    border-left: 3pt solid black !important;
    padding: 12pt 14pt !important;
    page-break-inside: avoid;
    margin-top: 18pt;
  }

  .answer-key h3,
  .answer-key h4,
  .answer-key p,
  .answer-key li,
  .answer-key strong,
  .answer-key em { color: black !important; }

  .info-card,
  .task {
    background: #f8f8f8 !important;
    border: 0.5pt solid #888 !important;
    padding: 10pt 12pt !important;
    page-break-inside: avoid;
  }

  .info-card::before,
  .info-card::after { display: none !important; }

  .excerpt {
    background: #f8f8f8 !important;
    border-left: 2pt solid black !important;
    padding: 10pt 14pt !important;
    page-break-inside: avoid;
  }

  .excerpt::before { color: #999 !important; }

  table {
    border: 0.5pt solid black !important;
    page-break-inside: avoid;
    font-size: 9.5pt;
  }

  thead { background: #ddd !important; color: black !important; }
  th, td { color: black !important; border-color: #888 !important; padding: 6pt 8pt; }

  a {
    color: black !important;
    text-decoration: underline !important;
  }

  a[href]:after {
    content: "" !important;
  }

  .source-link::before { color: black !important; }

  p, li { orphans: 3; widows: 3; }
  h2, h3, h4, h5 { break-after: avoid; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 32px 0;
  opacity: 0.4;
}

.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-italic { font-style: italic; }
.text-mono { font-family: var(--mono); }
