/* Közös stílus az egész oldalhoz: világos és sötét mód, mobil-első elrendezés. */
:root {
  --bg: #f4f7ff; --card: #ffffff; --ink: #0f1b3d; --muted: #5a6788; --line: #dfe6f7;
  --brand: #3366ff; --brand-ink: #ffffff; --tint: #e8eeff;
  --shadow: 0 1px 2px rgba(20,40,110,.06), 0 8px 24px rgba(20,40,110,.08);
  --blob1: rgba(51,102,255,.22); --blob2: rgba(24,160,255,.18);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1226; --card: #141d38; --ink: #eef2ff; --muted: #9aa8cc; --line: #243257; --tint: #1d2b57; --brand: #6b8cff; --brand-ink: #0b1226;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --blob1: rgba(51,102,255,.35); --blob2: rgba(24,160,255,.22); }
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.4;
  background-image: radial-gradient(60vmax 40vmax at 100% -10%, var(--blob1), transparent 60%), radial-gradient(50vmax 40vmax at -10% 110%, var(--blob2), transparent 60%);
  background-attachment: fixed;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
main { max-width: 560px; margin: 0 auto; }
main.wide { max-width: 1080px; }
header { margin: 3vh 0 22px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); background: var(--tint); padding: 4px 12px; border-radius: 999px; }
h1 { margin: 14px 0 6px; font-size: clamp(2rem, 8.5vw, 3rem); line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
header p { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 42ch; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 12px 8px 6px; margin-left: -6px; border-radius: 10px; min-height: 44px; }
.back svg { width: 20px; height: 20px; }
.back:hover { color: var(--brand); }

/* főoldal: nagy kártyák */
nav { display: grid; gap: 12px; }
a.card {
  display: grid; grid-template-columns: 52px 1fr 20px; align-items: center; gap: 16px; padding: 16px 18px; min-height: 84px;
  background: var(--card); color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { border-color: var(--brand); transform: translateY(-2px); }
a.card:active { transform: translateY(0); }
.ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); }
.ic svg { width: 26px; height: 26px; }
.tx b { display: block; font-size: 1.1rem; line-height: 1.25; letter-spacing: -.01em; }
.tx span { display: block; margin-top: 2px; font-size: .92rem; color: var(--muted); }
.go { width: 20px; height: 20px; color: var(--muted); }
a.card:hover .go { color: var(--brand); }

/* szűrő */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; min-height: 40px; white-space: nowrap;
}
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* anyagok */
.docs { display: grid; grid-template-columns: 1fr; gap: 12px; }
.doc { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.cover { display: block; align-self: start; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.18); line-height: 0; }
.cover img { width: 100%; height: auto; aspect-ratio: 198 / 281; object-fit: cover; }
.info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.num { font-size: .8rem; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.doc h2 { margin: 2px 0 2px; font-size: 1.15rem; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.kind { margin: 0; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; padding: 0; }
.tag { font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--tint); padding: 3px 10px; border-radius: 999px; }
.tag.nat { color: var(--brand); }
.dl {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 700;
}
.dl svg { width: 18px; height: 18px; flex: none; }
.dl small { font-weight: 500; opacity: .85; font-size: .8rem; }
.dl:hover { filter: brightness(1.08); }
@media (min-width: 640px) { .docs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .docs { grid-template-columns: repeat(3, 1fr); } .doc { grid-template-columns: 1fr; } .cover { max-width: 140px; } }
@media (prefers-reduced-motion: reduce) { a.card { transition: none; } }

/* érettségi oldal */
.upd { margin-top: 8px !important; font-size: .9rem !important; }
.topics { display: grid; grid-template-columns: 1fr; gap: 12px; }
.topic { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.topic h2 { margin: 0 0 12px; font-size: 1.15rem; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.lvls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lvl {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 8px; border-radius: 12px;
  text-decoration: none; font-weight: 700; text-align: center; line-height: 1.2; color: var(--brand-ink); background: var(--brand);
}
.lvl svg { width: 18px; height: 18px; }
.lvl small { font-weight: 500; font-size: .8rem; opacity: .85; }
.lvl.e { background: var(--ink); color: var(--bg); }
.lvl:hover { filter: brightness(1.12); }
.lvl.none { background: transparent; border: 1px dashed var(--line); min-height: 64px; }
#topics[data-show="k"] .lvl.e, #topics[data-show="e"] .lvl.k, #topics[data-show="k"] .lvl.none, #topics[data-show="e"] .lvl.none { display: none; }
#topics[data-show="k"] .lvls, #topics[data-show="e"] .lvls { grid-template-columns: 1fr; }
@media (min-width: 720px) { .topics { grid-template-columns: repeat(2, 1fr); } }
.lvl.none::after { content: "Nincs feltöltve"; color: var(--muted); font-weight: 500; font-size: .85rem; }

/* ismétlő feladatlapok */
.grps { display: grid; gap: 14px; }
.grp { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.grp h2 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 1.2rem; line-height: 1.25; letter-spacing: -.01em; }
.grp .lv { font-size: .8rem; font-weight: 700; color: var(--brand); background: var(--tint); padding: 3px 10px; border-radius: 999px; letter-spacing: 0; }
.grp .cnt { margin: 4px 0 12px; color: var(--muted); font-size: .9rem; }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.nums a {
  display: grid; place-items: center; min-height: 48px; border-radius: 12px; text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--brand); background: var(--tint); border: 1px solid transparent; transition: background .12s, color .12s;
}
.nums a:hover { background: var(--brand); color: var(--brand-ink); }
.nums a:visited { color: var(--muted); }
.nums a:visited:hover { color: var(--brand-ink); }
@media (min-width: 720px) { .nums { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); } }
