/* ===== Paleta + typografie (decentní, profesionální) ===================== */
:root{
  --bg:        #f7f8fa;
  --surface:   #ffffff;
  --surface-2: #f1f3f6;
  --text:      #1f2937;
  --muted:     #6b7280;
  --primary:   #2b6cb0;
  --primary-10:#e7f0fa;
  --border:    #e5e7eb;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(0,0,0,.06);

  --container: 1100px;
  --s1:.5rem; --s2:.75rem; --s3:1rem; --s4:1.5rem; --s5:2rem; --s6:3rem;

  /* barvy štítků */
  --video:    #e11d48;  /* červená */
  --playlist: #2563eb;  /* modrá */
  --cyklus:   #059669;  /* zelená */
}

/* Dark mode podle systému */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#121418; --surface:#1a1d22; --surface-2:#161a1f;
    --text:#e9edf3; --muted:#b9c1cc; --border:#2a2f36;
    --primary:#86b3e6; --primary-10:#0b223d; --shadow:none;

    --video:#fb7185; --playlist:#60a5fa; --cyklus:#34d399;
  }
}

/* ===== Reset + typografie ================================================ */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.65; color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
h1,h2,h3{font-family:"EB Garamond", Georgia, "Times New Roman", serif}
h1,h2,h3{line-height:1.2; margin:0 0 var(--s3)}
h1{font-size:clamp(2rem, 1.3rem + 2.5vw, 3rem)}
h2{font-size:clamp(1.6rem, 1.1rem + 1.2vw, 2.2rem)}
h3{font-size:1.25rem}
p{margin:0 0 var(--s3)}
.lead{font-size:1.125rem; color:var(--muted)}
a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}
.muted{color:var(--muted)}
code{background:var(--surface-2); padding:.1rem .3rem; border-radius:6px}

/* ===== Layout ============================================================= */
.container{max-width:var(--container); margin-inline:auto; padding:0 var(--s3)}
.section{padding: var(--s6) 0}
.section--alt{background:var(--surface-2)}
.section-title{margin-bottom:.35rem}
.section-subtitle{
  margin:-.2rem 0 var(--s4); color:var(--muted); font-style:italic;
}

/* ===== Header ============================================================= */
.site-header{
  position: sticky; top:0; z-index:20; backdrop-filter:saturate(130%) blur(8px);
  background: color-mix(in oklab, var(--surface), transparent 20%);
  border-bottom:1px solid var(--border);
}
.header__inner{
  display:flex; align-items:center; justify-content:center; /* zarovnání doprostřed */
  padding-block:.7rem;
}
.nav{display:flex; gap:var(--s3); align-items:center; flex-wrap:wrap}

/* ===== Hero (bez obrázku) + zvýrazněný název/podtitul ==================== */
.hero{padding: clamp(1.8rem, 3vw, 3rem) 0}
.hero__inner{display:grid; gap:var(--s4); align-items:center}
.hero__inner--noimg{grid-template-columns: 1fr}

.site-title{
  font-size: clamp(2.2rem, 1.2rem + 3vw, 3.4rem);
  letter-spacing:.3px;
  position:relative;
  margin-bottom:.15em;
}
.site-title::after{
  content:"";
  display:block;
  width: clamp(120px, 30%, 240px);
  height: 4px;
  margin-top:.35em;
  border-radius:999px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--primary), white 20%), color-mix(in oklab, var(--primary), black 5%));
  opacity:.9;
}

.subtitle{
  font-size: clamp(1.05rem, .6rem + 1vw, 1.35rem);
  font-style: italic;
  color: color-mix(in oklab, var(--text), var(--muted) 35%);
  font-weight: 600;
  letter-spacing: .15px;
  margin-bottom:.9em;
}

/* Úvodní dlouhý text (citace) */
.intro-quote{
  margin: 0;
  padding: 1rem 1.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-wrap: balance;
}
.intro-quote p{ margin: .6rem 0; }

/* ===== Speciální zvýraznění sekce Seznam ===================== */
.section--accent{
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--primary-10), white 70%), transparent 50%),
    var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section--accent .section-title{
  position: relative;
  padding-bottom: .3rem;
}
.section--accent .section-title::after{
  content:"";
  position:absolute; left:0; bottom:-2px;
  width: 120px; height: 3px; border-radius:999px;
  background: color-mix(in oklab, var(--primary), black 8%);
  opacity:.7;
}

/* ===== Grid přednášek ===================================================== */
.grid{
  display:grid; gap:var(--s4);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1000px){ .grid{grid-template-columns: repeat(2, 1fr)} }
@media (max-width: 640px){ .grid{grid-template-columns: 1fr} }

.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
  overflow:hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover{ transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }

.thumb{position:relative; display:block; overflow:hidden}
.thumb img{
  width:100%; height:auto; display:block;
  aspect-ratio: 16 / 9; object-fit: cover; object-position: center;
  background: #ddd;
  transform: scale(1.001);
  transition: transform .25s ease;
}
.thumb:hover img{ transform: scale(1.03); }

.card__body{padding:var(--s4)}
.meta{color:var(--muted); font-size:.95rem; margin:.25rem 0 var(--s3)}
.note{color:var(--muted); font-size:.95rem; margin:.25rem 0 var(--s3); font-style: italic}

/* ===== Badge + YouTube ikona ============================================== */
.badge{
  position:absolute; top:8px; right:8px;
  color:#fff; font-size:.8rem; padding:.25em .55em; border-radius:.5em;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.badge--video   { background: color-mix(in oklab, var(--video), black 10%); }
.badge--playlist{ background: color-mix(in oklab, var(--playlist), black 10%); }
.badge--cyklus  { background: color-mix(in oklab, var(--cyklus), black 10%); }

.yt-icon{
  position:absolute; bottom:8px; right:8px;
  background:#ff0000; color:#fff; font-weight:700;
  border-radius:50%; width:28px; height:28px;
  display:flex; align-items:center; justify-content:center;
  font-size:.9rem; box-shadow:0 2px 6px rgba(0,0,0,.4);
}

/* ===== Seznam všech přednášek (akordeon) ================================= */
.section--archive{ background: var(--surface-2); }
.accordion{ display:flex; flex-direction:column; gap: 12px; }

.acc{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.acc[open]{
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--primary), var(--border) 70%);
  background: var(--surface);
}

.acc > summary{
  list-style: none;
  cursor: pointer;
  padding: .95rem 1rem;
  display: flex; align-items: center; gap: .6rem;
  user-select: none;
  font-weight: 600;
  color: var(--text);

  justify-content: flex-start;
}
.acc > summary::-webkit-details-marker{ display:none; }
.acc > summary::after{
  content: "▸";
  margin-left: .5rem;
  font-size: 1rem;
  transform: rotate(0deg);
  transition: transform .15s ease, opacity .15s ease;
  opacity: .65;
}
.acc[open] > summary::after{ transform: rotate(90deg); opacity: 1; }

.year-badge{
  display:inline-block;
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  background: color-mix(in oklab, var(--primary), white 80%);
  color: color-mix(in oklab, var(--primary), black 10%);
  border: 1px solid color-mix(in oklab, var(--primary), white 65%);
  padding: .12rem .5rem;
  border-radius: .6rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.04) inset;
}

.acc-list{
  margin: 0; padding: 0 1rem 1rem 1.45rem;
}
.acc-list li{ margin:.38rem 0; }

/* Seznam otázek v roce 2017 */
.acc-body{ padding: 0 1rem 1rem 1.2rem; }
.qa-list{ margin: .4rem 0 0 0; padding-left: 1.1rem; }
.qa-list li{ margin:.45rem 0; }

/* Dva sloupce pro delší roky */
@media (min-width: 900px){
  .acc-list.two-cols{
    columns: 2; column-gap: 2rem;
  }
  .acc-list.two-cols li{ break-inside: avoid; }
}

/* ===== Tlačítka =========================================================== */
.btn{
  display:inline-block; padding:.7rem 1rem; border-radius:10px;
  border:1px solid var(--border); background:var(--surface); color:inherit;
  transition:.15s transform ease, .15s background ease, .15s border ease;
}
.btn:hover{transform: translateY(-1px)}
.btn--primary{
  background:var(--primary); border-color: color-mix(in oklab, var(--primary), black 12%);
  color:white;
}
.btn--ghost{background:transparent}

/* ===== Footer ============================================================= */
.site-footer{
  border-top:1px solid var(--border); background:var(--surface);
  padding: var(--s5) 0;
}
.footer__inner{
  display:flex; align-items:center; justify-content:space-between; gap:var(--s3);
}
.footer-nav{display:flex; gap: var(--s3)}
@media (max-width: 700px){ .footer__inner{flex-direction:column} }

/* ===== Přístupnost ======================================================== */
:focus-visible{outline:3px solid color-mix(in oklab, var(--primary), white 55%); outline-offset:2px}

/* ===== Mobile header toggle (collapsible top bar) ========================= */
.header-toggle{
  display:none;
  position: fixed; top: 8px; right: 10px; z-index: 25;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--primary);
  color: #fff; font-size: 20px; line-height: 1; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
@media (max-width: 800px){
  .header-toggle{ display:flex; align-items:center; justify-content:center; }
  .site-header{ transition: transform .22s ease; }
  .site-header.collapsed{ transform: translateY(calc(-100% + 12px)); }
  /* Nudge content so it's still reachable when collapsed */
  body{ scroll-padding-top: 60px; }
}
/* Improve hit-area and visibility in dark mode */
@media (prefers-color-scheme: dark){
  .header-toggle{ border-color: rgba(255,255,255,.18); box-shadow:none; }
}
