/* ==========================================================================
   Bajtovňa – base.css
   Spoločné štýly pre stránky BEZ frameworku (index, clanok-flex, zmeny).
   Mobile-first. Rozloženie rieši výlučne Flexbox a CSS Grid.
   Štýly pre konkrétnu šírku obrazovky načítava js/responsive-css.js
   zo súborov css/dyn/screen-480.css, -768, -1024 a -1440.
   ========================================================================== */

/* ---------- 1. Dizajn tokeny (podľa 00_styly.png) ---------- */
:root {
  --primary: #14213d;
  --primary-soft: #1f2f55;
  --accent: #0f766e;
  --accent-dark: #0b5c56;
  --highlight: #f59e0b;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-2: #4b5563;
  --border: #d5dce7;

  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --radius: 8px;
  --space: 8px;              /* spacing len násobky 8 */
  --container: 100%;
  --gutter: 16px;
  --header-h: 56px;
}

/* ---------- 2. Reset a základ ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;       /* 17 px */
  line-height: 1.65;          /* 28 px */
  color: var(--text);
  background: var(--bg);
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}

/* ---------- 3. Prístupnosť ---------- */
:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 300;
  padding: 12px 16px;
  min-height: 44px;
  background: var(--highlight);
  color: var(--primary);
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

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

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

/* ---------- 4. Hlavička a navigácia (Flexbox) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #fff;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--container);
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1;
}

.nav-toggle {
  display: none;                 /* zapína ho len css/dyn/screen-480.css */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after  { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { transform: translateY(-7px) rotate(-45deg); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--highlight); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--highlight); }

/* ---------- 5. Hlavné rozloženie ---------- */
.layout {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
}

.stream {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}

/* ---------- 6. Kategória, meta ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {                 /* nie len farba: kategória má aj symbol */
  content: "";
  width: 8px;
  height: 8px;
  background: currentColor;
}

.meta {
  font-size: .875rem;              /* 14 px */
  line-height: 1.43;
  color: var(--text-2);
}

/* ---------- 7. Hlavný článok (hero na home) ---------- */
.hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-figure img {
  width: min(100%, 400px);
  aspect-ratio: 540 / 500;
  margin: 0 auto 16px;
  object-fit: cover;
  border-radius: var(--radius);
}
.hero h1,
.hero h2 {
  font-size: 1.75rem;
  line-height: 1.2;
}
.hero h1 a,
.hero h2 a { text-decoration: none; }
.hero h1 a:hover,
.hero h2 a:hover { color: var(--accent); text-decoration: underline; }
.lead {
  max-width: 62ch;
  font-size: 1.0625rem;
  color: var(--text-2);
}

/* ---------- 8. Karty článkov (Grid) ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.cards > li { display: flex; }

.card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card-media {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.card-media img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 16px;
}
.card-title {
  font-size: 1.25rem;              /* 20 px */
  line-height: 1.4;                /* 28 px */
}
.card-title a { text-decoration: none; }
.card-title a::after {             /* celá karta je klikateľná */
  content: "";
  position: absolute;
  inset: 0;
}
.card-title a:hover { color: var(--accent); }
.card .meta { margin-top: auto; padding-top: 8px; }
.card:focus-within { outline: 3px solid var(--highlight); outline-offset: 2px; }
.card a:focus-visible { outline: none; }

/* ---------- 9. Najpopulárnejšie ---------- */
.popular {
  align-self: start;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.popular-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
}
.popular-list {
  display: grid;
  gap: 16px;
  counter-reset: poradie;
}
.popular-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.popular-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--highlight);
  color: var(--primary);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9375rem;
}
.popular-list a {
  display: block;
  padding: 4px 0;
  font-weight: 700;
  font-size: .9375rem;
  line-height: 1.45;
  text-decoration: none;
}
.popular-list a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 10. Článok (clanok-flex.html) ---------- */
.version-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px;
  font-size: .9375rem;
  color: var(--text-2);
  background: #e6f2f1;
  border: 1px solid #b9dcd8;
  border-radius: var(--radius);
}
.version-switch strong { color: var(--primary); }
.version-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--accent-dark);
}

.article {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.article h1 {
  font-size: 1.75rem;
  line-height: 1.2;
}
.byline {
  font-size: .875rem;
  color: var(--text-2);
}
.article-figure img {
  width: min(100%, 400px);
  aspect-ratio: 540 / 500;
  margin: 0 auto;
  object-fit: cover;
  border-radius: var(--radius);
}
.article-figure figcaption {
  margin-top: 8px;
  font-size: .875rem;
  text-align: center;
  color: var(--text-2);
}
.article-lead {
  max-width: 70ch;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.6;
}
.article-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 70ch;               /* max. ~75 znakov na riadok */
}
.article-body h2 {
  margin-top: 16px;
  font-size: 1.375rem;
}
.article-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--accent-dark);
}

/* ---------- 11. Tlačidlá a formulárové prvky ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: max(44px, 2.75em);
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--highlight); outline-offset: 3px; }

input[type="range"] {
  width: min(100%, 16em);
  min-height: 44px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- 12. Päta ---------- */
.site-footer {
  flex-shrink: 0;
  padding: 16px var(--gutter);
  background: var(--primary);
  color: #fff;
  font-size: .875rem;
  text-align: center;
}
.site-footer p + p { margin-top: 4px; color: #c4cde0; font-size: .8125rem; }
.site-footer code { font-family: ui-monospace, Consolas, monospace; color: var(--highlight); }

/* ---------- 13. sekcia_zmena (zmeny.html) ----------
   Všetko vnútri sekcie je v jednotkách em, aby sa škálovalo spolu
   s premennou --zmena-scale, ktorú nastavuje js/text-size.js. */
#sekcia_zmena {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  font-size: calc(1.0625rem * var(--zmena-scale, 1));
  line-height: 1.6;
  min-width: 0;
}
#sekcia_zmena h1 { font-size: 1.75em; line-height: 1.2; }
#sekcia_zmena h2 { font-size: 1.35em; }
#sekcia_zmena h3 { font-size: 1.1em; line-height: 1.35; }
#sekcia_zmena .intro { max-width: 60ch; color: var(--text-2); }

.panel {
  padding: 1.25em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75em;
}
.size-controls { display: flex; flex-direction: column; gap: .75em; }
.size-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75em 1em;
}
.size-buttons { display: flex; gap: .5em; }
.size-slider { display: flex; flex-wrap: wrap; align-items: center; gap: .5em .75em; }
.size-slider output { min-width: 3.5em; font-weight: 700; color: var(--primary); }
.hint { font-size: .875em; color: var(--text-2); }
kbd {
  display: inline-block;
  padding: 0 .4em;
  font: inherit;
  font-size: .9em;
  font-weight: 700;
  color: var(--primary);
  background: #eef1f6;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
}

.changes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1em;
}
.change {
  display: flex;
  flex-direction: column;
  gap: .4em;
  padding: 1em 1.1em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75em;
}
.change-head {
  display: flex;
  align-items: center;
  gap: .6em;
}
.change-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.75em;
  height: 1.75em;
  border-radius: 50%;
  background: var(--highlight);
  color: var(--primary);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9em;
}
.change p { font-size: .9em; color: var(--text-2); }
.change .who { font-size: .8em; color: var(--accent-dark); font-weight: 700; }

.extras { display: grid; gap: .5em; padding-left: 1.25em; list-style: disc; }
.extras li { padding-left: .25em; }

.compare { display: grid; grid-template-columns: 1fr; gap: 1em; }
.compare figure { display: flex; flex-direction: column; gap: .5em; }
.compare img { width: 100%; border: 1px solid var(--border); border-radius: .5em; }
.compare figcaption { font-size: .875em; color: var(--text-2); }

.zoom-figure { display: flex; flex-direction: column; align-items: flex-start; gap: .75em; }
.zoom-thumb {
  display: block;
  width: min(45vw, 22em, 60vh);   /* 2× zväčšenie sa vždy zmestí na obrazovku */
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border-radius: .75em;
  cursor: zoom-in;
}

/* ---------- 14. Pohyb ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
