/* ===== Tips & Chips — styles ===== */

/* --- Design tokens: light (default) --- */
:root {
  --bg: #FAEEDA;
  --bg-alt: #F3E2C4;
  --text: #412402;
  --muted: #854F0B;
  --accent: #EF9F27;
  --accent-2: #BA7517;
  --border: #E0C896;
  --card-bg: #FFFFFF;

  /* logo color hooks */
  --logo-tri-fill: #EF9F27;
  --logo-tri-shadow: #BA7517;
  --logo-stroke: #FAC775;
  --logo-node: #633806;
  --logo-node-core: #FAC775;
  --logo-text-1: #412402; /* TRICKS */
  --logo-text-2: #BA7517; /* & */
  --logo-text-3: #EF9F27; /* CHIPS */
  --logo-claim: #854F0B;
  --logo-spark: #EF9F27;

  --maxw: 720px;
  --font-display: "Alfa Slab One", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Design tokens: dark --- */
:root[data-theme="dark"] {
  --bg: #111111;
  --bg-alt: #1A1A1A;
  --text: #FAEEDA;
  --muted: #BA7517;
  --accent: #FAC775;
  --accent-2: #EF9F27;
  --border: #3A2A12;
  --card-bg: #1E1A14;

  --logo-tri-fill: #BA7517;
  --logo-tri-shadow: #412402;
  --logo-stroke: #EF9F27;
  --logo-node: #1A0A00;
  --logo-node-core: #FAC775;
  --logo-text-1: #FAC775;
  --logo-text-2: #EF9F27;
  --logo-text-3: #EF9F27;
  --logo-claim: #BA7517;
  --logo-spark: #BA7517;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .5px;
}

/* Section rhythm: alternating tint, centered content column */
.section {
  padding: 64px 20px;
}
.section:nth-of-type(even) {
  background: var(--bg-alt);
}
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section h2 {
  font-size: clamp(28px, 5vw, 40px);
  color: var(--accent-2);
  margin: 0 0 20px;
}
.section p { margin: 0 0 16px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}
a { color: var(--accent-2); }

/* ===== Sdílená navigace ===== */
.site-nav {
  /* position: sticky;
  top: 0;
  z-index: 10; */
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.site-nav__brand {
  font-family: var(--font-display);
  color: var(--accent-2);
  text-decoration: none;
  letter-spacing: 1px;
}
.site-nav__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  flex-grow: 1;
}
.site-nav__links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.site-nav__links a.is-active { color: var(--accent-2); }

/* ===== Obsahové stránky (mimo landing) ===== */
.page .section h1 {
  font-size: clamp(28px, 5vw, 40px);
  color: var(--accent-2);
  margin: 0 0 20px;
}
.empty-state { color: var(--muted); }
.cta { font-weight: 700; }

/* Theme toggle */
.hero { position: relative; }
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, transform .15s ease;
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero {
  background: var(--bg);
  padding: 40px 20px 56px;
  text-align: center;
}
.hero__inner { max-width: 520px; margin: 0 auto; }
.logo { width: 100%; height: auto; display: block; }
.logo__wordmark {
  text-align: center;
  font-family: var(--font-display);
}
.logo__wordmark span { display: block; line-height: 1; }
.logo__tricks { font-size: 78px; color: var(--logo-text-1); letter-spacing: 1px; }
.logo__amp    { font-size: 30px; color: var(--logo-text-2); line-height: 1.2; }
.logo__chips  { font-size: 78px; color: var(--logo-text-3); letter-spacing: 1px; }
.logo__claim  { font-size: 12px; color: var(--logo-claim); letter-spacing: 4px; margin-top: 12px; }

/* ===== Hero logo animation: assembly (once) -> ambient (loop) ===== */
.logo__chip { animation: chip-in .7s ease-out both; }
.logo__text { animation: text-in .6s ease-out both 1.0s; }
.logo__net  {
  animation: net-in .5s ease-out both .7s,
             net-pulse 1.8s ease-in-out infinite 1.7s;
}
.logo__spark {
  transform-origin: center;
  animation: spark-in .4s ease-out both 1.1s,
             spark-twinkle 1.6s ease-in-out infinite 1.7s;
}
.logo__mark {
  transform-origin: center;
  animation: mark-bob 3.4s ease-in-out infinite 1.7s;
}
.logo__spark:nth-of-type(2) { animation-delay: 1.1s, 2.0s; }
.logo__spark:nth-of-type(3) { animation-delay: 1.1s, 2.3s; }
.logo__spark:nth-of-type(4) { animation-delay: 1.1s, 2.6s; }

@keyframes chip-in  { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes net-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes spark-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes text-in  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes mark-bob     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes net-pulse    { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes spark-twinkle{ 0%, 100% { opacity: .3; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .logo__chip, .logo__net, .logo__spark, .logo__mark, .logo__text {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Info rows ("Kdy a kde") */
.info-rows { list-style: none; padding: 0; margin: 0; }
.info-rows li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
}
.info-rows li:last-child { border-bottom: none; }
.info-rows__icon { font-size: 22px; }

/* Role list ("Pro koho") */
.role-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.role-list li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}

/* Topic grid ("Formát & obsah") */
.topic-grid {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.topic-grid__item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .15s ease, border-color .15s ease;
}
.topic-grid__item:hover { transform: translateY(-3px); border-color: var(--accent); }
.topic-grid__emoji { font-size: 24px; }

/* Prize box ("Hodnocení & ceny") */
.prize-box {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 28px 24px;
}
.prize-box__item { font-family: var(--font-display); font-size: clamp(20px, 4vw, 28px); }
.prize-box__sep { color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }

/* Footer */
.site-footer {
  background: var(--bg-alt);
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
}
.site-footer__claim {
  font-family: var(--font-display);
  color: var(--accent-2);
  letter-spacing: 3px;
  font-size: 14px;
  margin: 0 0 6px;
}
.site-footer__meta { color: var(--muted); font-size: 13px; margin: 0; }

/* Scroll reveal */
.section { opacity: 1; }
:root.js .section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
:root.js .section.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  :root.js .section { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 600px) {
  .section { padding: 48px 16px; }
  .logo__tricks, .logo__chips { font-size: 56px; }
  .logo__amp { font-size: 24px; }
  .info-rows li { font-size: 16px; }
  .theme-toggle { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px; }
  .site-nav { gap: 10px; flex-direction: column; }
}

/* ===== Program / sloty ===== */
.program { list-style: none; padding: 0; margin: 24px 0; }
.slot {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.slot:last-child { border-bottom: none; }
.slot__time { font-family: var(--font-display); color: var(--accent-2); min-width: 64px; }
.slot__body { display: flex; flex-direction: column; }
.slot__title { font-weight: 700; }
.slot__meta { color: var(--muted); font-size: 14px; }
.slot__description { margin-top: 4px; color: var(--muted); font-size: 14px; }
.event-winner { color: var(--accent-2); }
.event-recap { margin-top: 24px; }

/* ===== Embed formuláře ===== */
.form-embed { margin: 24px 0; }
.form-embed iframe {
  width: 100%;
  min-height: 1200px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}

/* ===== Archiv ===== */
.archive-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 14px; }
.event-card__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}
.event-card__link:hover { transform: translateY(-3px); border-color: var(--accent); }
.event-card__date { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.event-card__title { font-family: var(--font-display); font-size: 20px; }
.event-card__winner { color: var(--accent-2); font-size: 14px; }

/* ===== Hlasování / QR ===== */
.voting-qr { margin: 24px auto; max-width: 280px; }
.voting-qr svg {
  width: 100%;
  height: auto;
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.voting-results {
  margin: 16px 0 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.voting-results iframe {
  display: block;
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 0;
}

/* ===== Print / PDF: one section per page ===== */
@media print {
  @page { size: A4 portrait; margin: 14mm; }

  /* Force the light palette regardless of the active theme */
  :root, :root[data-theme="dark"] {
    --bg: #FAEEDA; --bg-alt: #FAEEDA; --text: #412402; --muted: #854F0B;
    --accent: #EF9F27; --accent-2: #BA7517; --border: #E0C896; --card-bg: #FFFFFF;
    --logo-tri-fill: #EF9F27; --logo-tri-shadow: #BA7517; --logo-stroke: #FAC775;
    --logo-node: #633806; --logo-node-core: #FAC775;
    --logo-text-1: #412402; --logo-text-2: #BA7517; --logo-text-3: #EF9F27;
    --logo-claim: #854F0B; --logo-spark: #EF9F27;
  }

  html, body { background: #fff !important; }

  /* Reveal everything and freeze all animation to its final state */
  :root.js .section { opacity: 1 !important; transform: none !important; }
  .logo__chip, .logo__net, .logo__spark, .logo__mark, .logo__text {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .theme-toggle, .site-nav { display: none !important; }

  /* Each block on its own page, never split across pages */
  .hero, .section, .site-footer {
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .site-footer { break-after: auto; page-break-after: auto; }

  /* Vertically center the short content on each page */
  .hero, .section {
    min-height: calc(100vh - 28mm);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
