/* ============================================================
   AK-26 · Pärnu Hariduskeskus · PARK
   Ühine stiilileht. Värvid ja mõõdud on kõik :root muutujates.
   ============================================================ */

:root {
  /* Pärnu Hariduskeskuse brändivärvid: süvasinine + fuksia */
  --sea-950: #001a33;
  --sea-900: #00284f;
  --sea-800: #003b70;
  --sea-700: #0b4f8c;
  --sea-600: #1466a8;
  --accent: #da1073;
  --accent-soft: #f7a9cd;
  --paper: #f7f4ee;
  --card: #ffffff;
  --ink: #14242f;
  --muted: #5b6b78;
  --line: rgba(0, 59, 112, .14);
  --wrap: 1120px;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 59, 112, .12);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--sea-700); }
a:hover { color: var(--sea-600); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: .7em 1.1em;
  border-radius: 10px;
  background: var(--sea-900);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px);
}

/* ---------- Päis ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 244, 238, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 8px 30px rgba(0, 59, 112, .09); }

code {
  padding: .1em .38em;
  border-radius: 5px;
  background: rgba(0, 59, 112, .06);
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: .92em;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sea-900);
  text-decoration: none;
  line-height: 1.1;
  flex-shrink: 0;
}
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-block;
  padding: .5em .85em;
  border-radius: 999px;
  color: var(--sea-800);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: rgba(0, 59, 112, .07); color: var(--sea-900); }
.nav a.active { background: var(--sea-900); color: #fff; }
.nav a.nav-cta { background: var(--accent); color: #fff; }
.nav a.nav-cta:hover { background: #b60b5e; color: #fff; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--sea-900);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: .7em .9em; border-radius: 10px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- Kangelane ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #eef6ff;
  background:
    radial-gradient(900px 520px at 88% -10%, #1466a8 0%, transparent 62%),
    radial-gradient(700px 420px at 0% 110%, #0b4f8c 0%, transparent 60%),
    linear-gradient(160deg, var(--sea-900), var(--sea-800) 55%, var(--sea-700));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 4px);
  opacity: .6;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(48px, 7vw, 86px);
  padding-bottom: clamp(64px, 9vw, 118px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero h1 {
  margin: .3em 0 .28em;
  font-size: clamp(44px, 7vw, 82px);
  line-height: .95;
  letter-spacing: -.025em;
  font-weight: 800;
}
.hero h1 span { color: var(--accent); }

.hero-sub {
  margin: 0 0 .4em;
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--accent-soft);
}

.hero-lead {
  max-width: 54ch;
  margin: 0;
  color: #c6dbea;
  font-size: clamp(16px, 1.6vw, 19px);
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.4em;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary {
  background: linear-gradient(180deg, #ec2b8c, var(--accent));
  color: #fff;
  box-shadow: 0 12px 30px rgba(218, 16, 115, .3);
}
.btn-primary:hover { color: #fff; filter: brightness(1.06); }

.btn-ghost {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.btn-outline {
  border-color: var(--line);
  background: #fff;
  color: var(--sea-800);
}
.btn-outline:hover { border-color: var(--sea-700); color: var(--sea-900); }

/* Kangelase kaart */
.hero-card {
  position: relative;
  padding: clamp(20px, 2.6vw, 32px);
  border-radius: 22px;
  border: 1px solid rgba(247, 169, 205, .38);
  background: linear-gradient(165deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.hero-card .tag {
  display: inline-block;
  padding: .35em .8em;
  border-radius: 999px;
  background: rgba(218, 16, 115, .16);
  border: 1px solid rgba(218, 16, 115, .45);
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-card h2 {
  margin: .55em 0 .1em;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: .01em;
}
.hero-card p { margin: 0; color: #c6dbea; font-size: 15px; }

.stars {
  display: flex;
  gap: 10px;
  margin: 22px 0;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: .2em;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.stat-row strong {
  display: block;
  font-size: clamp(22px, 2.2vw, 28px);
  color: var(--accent-soft);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-row span { font-size: 12px; color: #b9d0e0; letter-spacing: .04em; }

.hero-card .btn { width: 100%; }

/* ---------- Sektsioonid ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-tight { padding: clamp(32px, 4vw, 52px) 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }

.section-head { max-width: 68ch; margin-bottom: clamp(26px, 3vw, 40px); }
.section-head h2 {
  margin: .25em 0 .35em;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.015em;
}
.section-head p { margin: 0; color: var(--muted); }
.section-head .eyebrow { color: var(--sea-700); }
.section-head .eyebrow::before { background: var(--accent); }

/* Faktid */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.fact {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}
.fact dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact dd { margin: 6px 0 0; font-size: 19px; font-weight: 700; color: var(--sea-900); }

/* Kaardid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 2px 0 rgba(0, 59, 112, .03);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(0, 59, 112, .2); }
.card h3 { margin: 0 0 .35em; font-size: 20px; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

.icon-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 13px;
  background: rgba(0, 59, 112, .06);
  color: var(--sea-700);
}
.icon-badge svg { width: 24px; height: 24px; }

/* Kuldvillaku riba */
.game-band {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(26px, 4vw, 52px);
  border-radius: 24px;
  border: 1px solid rgba(218, 16, 115, .4);
  background:
    radial-gradient(600px 300px at 90% -20%, rgba(218, 16, 115, .18), transparent 60%),
    linear-gradient(160deg, var(--sea-900), var(--sea-800));
  color: #eef6ff;
  box-shadow: 0 26px 60px rgba(0, 59, 112, .28);
}
.game-band h2 {
  margin: .2em 0 .3em;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  color: #fff;
}
.game-band p { margin: 0; max-width: 56ch; color: #c6dbea; }
.game-band .eyebrow { color: var(--accent-soft); }
.game-band .actions { margin-top: 22px; }
.game-band .note { margin-top: 14px; font-size: 13px; color: #a9c3d6; }

.game-badge {
  width: clamp(110px, 14vw, 160px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(247, 169, 205, .45);
  background: radial-gradient(circle at 30% 25%, rgba(247, 169, 205, .24), rgba(247, 169, 205, .04));
  color: var(--accent-soft);
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1;
  box-shadow: inset 0 0 40px rgba(218, 16, 115, .14);
  flex-shrink: 0;
}

/* Tunniplaan */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
table.schedule {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 15.5px;
}
table.schedule caption {
  caption-side: top;
  padding: 16px 20px;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
table.schedule th, table.schedule td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.schedule thead th {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0, 59, 112, .03);
}
table.schedule tbody tr:last-child th,
table.schedule tbody tr:last-child td { border-bottom: 0; }
table.schedule tbody th { font-weight: 700; color: var(--sea-900); white-space: nowrap; }
table.schedule td { color: var(--muted); }
table.schedule td strong { display: block; color: var(--ink); font-weight: 600; }
table.schedule td span { font-size: 13px; }

.chip {
  display: inline-block;
  padding: .2em .65em;
  border-radius: 999px;
  border: 1px solid rgba(0, 59, 112, .16);
  background: rgba(0, 59, 112, .05);
  color: var(--sea-800);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  vertical-align: middle;
}
.chip-accent {
  border-color: rgba(218, 16, 115, .5);
  background: rgba(218, 16, 115, .12);
  color: #9a0b52;
}

.hint { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }

/* Kontakt */
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.contact-card {
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}
.contact-card h3 { margin: 0 0 .6em; font-size: 20px; }
.contact-list { display: grid; gap: 14px; margin: 0; }
.contact-list div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
.contact-list dt { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list dd { margin: 0; font-weight: 600; word-break: break-word; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.placeholder {
  border-bottom: 1px dashed rgba(0, 59, 112, .35);
  cursor: help;
}

/* Jalus */
.site-footer {
  padding: 34px 0;
  background: var(--sea-950);
  color: #a9c3d6;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.site-footer strong { color: #fff; }
.site-footer a { color: var(--accent-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- Mobiil ---------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .game-band { grid-template-columns: 1fr; }
  .game-badge { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .stat-row { gap: 6px; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .card:hover { transform: none; }
}

@media print {
  .site-header, .nav, .actions, .skip-link { display: none !important; }
  body { background: #fff; }
  .hero { background: #fff; color: #000; }
  .hero-card, .game-band { border: 1px solid #ccc; background: #fff; color: #000; box-shadow: none; }
  .hero-lead, .hero-card p, .game-band p { color: #333; }
}

/* ============================================================
   TUNNIPLAAN
   ============================================================ */
.tt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.tt-weeknav { display: flex; align-items: center; gap: 8px; }
.tt-weeklabel {
  min-width: 190px;
  text-align: center;
  font-weight: 800;
  color: var(--sea-900);
  font-variant-numeric: tabular-nums;
}
.tt-weeklabel span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.tt-dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2e9e5b; box-shadow: 0 0 0 4px rgba(46, 158, 91, .15);
  display: inline-block;
}
.tt-dot-live.stale { background: #c9861a; box-shadow: 0 0 0 4px rgba(201, 134, 26, .15); }

.tt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.tt-grid.has-weekend { grid-template-columns: repeat(7, minmax(0, 1fr)); }

.tt-day {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  min-height: 130px;
}
.tt-day.is-today { border-color: rgba(218, 16, 115, .85); box-shadow: 0 0 0 3px rgba(218, 16, 115, .16); }
.tt-day.is-empty { background: rgba(255, 255, 255, .5); }

.tt-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.tt-day-head strong { font-size: 14px; color: var(--sea-900); letter-spacing: .01em; }
.tt-day-head span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-day-head .today-tag {
  padding: .1em .5em;
  border-radius: 999px;
  background: rgba(218, 16, 115, .2);
  color: #9a0b52;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tt-lesson {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.tt-lesson:last-child { border-bottom: 0; padding-bottom: 2px; }
.tt-lesson-bar { border-radius: 4px; background: var(--sea-600); align-self: stretch; min-height: 30px; }
.tt-lesson-body { min-width: 0; }
.tt-time {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.tt-name {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.32;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.tt-meta {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.tt-lesson.is-now .tt-lesson-bar { background: var(--accent); }
.tt-lesson.is-now .tt-time { color: #9a0b52; }
.tt-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 0 .4em;
  border-radius: 999px;
  background: rgba(0, 59, 112, .08);
  color: var(--sea-800);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.tt-empty {
  padding: 26px;
  border: 1px dashed rgba(0, 59, 112, .25);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
}
.tt-hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* Avalehe nädala eelvaade */
.tt-preview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tt-preview .tt-lesson { padding: 7px 0; }
.tt-preview .tt-name { font-size: 13.5px; }
.tt-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sea-700);
  text-decoration: none;
}
.tt-more:hover { text-decoration: underline; }

/* Embed-plokk */
.embed-box {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.embed-box h2 { margin: .2em 0 .4em; font-size: clamp(24px, 2.6vw, 32px); }
.embed-box p { margin: 0 0 12px; color: var(--muted); }
.snippet {
  position: relative;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--sea-950);
  color: #cfe6f6;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.snippet code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.copy-status { font-size: 12.5px; color: #2e7d4f; font-weight: 700; align-self: center; }

/* Avalike sisulehtede (tunniplaan, materjalid) ülaosa */
.page-hero {
  padding: clamp(30px, 5vw, 58px) 0 clamp(22px, 3vw, 34px);
  color: #eef6ff;
  background:
    radial-gradient(700px 300px at 90% -30%, #1466a8 0%, transparent 65%),
    linear-gradient(160deg, var(--sea-900), var(--sea-800));
}
.page-hero h1 { margin: .2em 0 .35em; font-size: clamp(32px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -.02em; }
.page-hero p { margin: 0; max-width: 68ch; color: #c6dbea; }
.page-hero .eyebrow { color: var(--accent-soft); }
.page-hero .actions { margin-top: 22px; }

/* Embed-režiim: ainult tunniplaan, ilma saidi päise ja jalusteta */
body.embed-mode { background: #fff; }
body.embed-mode .site-header,
body.embed-mode .site-footer,
body.embed-mode .skip-link,
body.embed-mode .page-hero,
body.embed-mode .embed-section,
body.embed-mode .tt-hint { display: none !important; }
body.embed-mode .section { padding: 14px 0; }
body.embed-mode .wrap { padding: 0 10px; }
body.embed-mode .tt-toolbar { margin-bottom: 10px; }
body.embed-mode .tt-day { min-height: 90px; }

/* ============================================================
   MATERJALID
   ============================================================ */
.mat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.mat-toolbar .search {
  flex: 1 1 260px;
  min-width: 0;
}
.mat-toolbar select,
.mat-toolbar input[type="search"] {
  width: 100%;
  padding: .7em .9em;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.mat-toolbar select { flex: 0 1 220px; width: auto; min-width: 160px; }
.mat-toolbar input[type="search"]:focus,
.mat-toolbar select:focus { outline: 2px solid rgba(218, 16, 115, .6); outline-offset: 1px; border-color: var(--accent); }

.mat-count { font-size: 13.5px; color: var(--muted); }

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.material-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.material-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(0, 59, 112, .2); }
.material-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.material-card h3 { margin: 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.material-card p { margin: 0; font-size: 14px; color: var(--muted); }
.material-subject { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sea-700); }
.material-desc { flex: 1; }
.material-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.material-foot .date { font-size: 12px; color: var(--muted); }
.material-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.type-pill {
  display: inline-block;
  padding: .22em .6em;
  border-radius: 6px;
  background: rgba(0, 59, 112, .07);
  color: var(--sea-800);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.type-pill.is-html { background: rgba(0, 59, 112, .1); color: var(--sea-700); }

.empty-state {
  padding: 44px 24px;
  border: 1px dashed rgba(0, 59, 112, .25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .55);
  text-align: center;
}
.empty-state h2 { margin: 0 0 .4em; font-size: 24px; }
.empty-state p { margin: 0 auto; max-width: 46ch; color: var(--muted); }

/* Faili vaataja */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(6, 27, 44, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal.open { display: grid; }
.modal-card {
  width: min(1100px, 100%);
  height: min(780px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-body { flex: 1; background: #eef2f5; }
.modal-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.modal-note { padding: 8px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ============================================================
   ÕPETAJA PORTAAL
   ============================================================ */
.portal-wrap { max-width: 980px; }
.portal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.portal-head h1 { margin: .15em 0 .2em; font-size: clamp(28px, 3.4vw, 40px); }
.portal-sub { margin: 0; color: var(--muted); }

.auth-card {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: .2em 0 .35em; font-size: clamp(26px, 3.4vw, 34px); }
.auth-card > p { color: var(--muted); }
.auth-card form { margin-top: 22px; }

.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field small { font-size: 12.5px; color: var(--muted); }
.field input[type="text"],
.field input[type="password"],
.field input[type="file"],
.field textarea {
  width: 100%;
  padding: .7em .85em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field textarea:focus { outline: 2px solid rgba(218, 16, 115, .65); outline-offset: 1px; border-color: var(--accent); }
.field input[type="file"] { padding: .55em .6em; background: rgba(0, 59, 112, .03); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--sea-700); }

.alert {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 14.5px;
}
.alert-ok { background: #eaf7ef; border-color: #bfe4cd; color: #1d6b3f; }
.alert-error { background: #fdf0ee; border-color: #f1c9c2; color: #8f2c1c; }

.portal-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}
.panel {
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.panel h2 { margin: 0 0 14px; font-size: 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.count-badge {
  min-width: 30px;
  padding: .1em .55em;
  border-radius: 999px;
  background: var(--sea-900);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.materials-panel { margin-top: 4px; }
.materials-panel .empty { color: var(--muted); font-size: 14.5px; }

.inline-form { display: inline; margin: 0; }

.btn-small { padding: .55em .95em; font-size: 13.5px; }
.btn-danger { background: #fff; border-color: #e6b6ae; color: #a23524; }
.btn-danger:hover { background: #fdf0ee; color: #8f2c1c; }

.mat-list { display: grid; gap: 10px; margin-top: 8px; }
.mat-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.mat-main { min-width: 0; }
.mat-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mat-title strong { font-size: 16px; overflow-wrap: anywhere; }
.mat-meta { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.mat-desc { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.mat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.mat-edit { margin-top: 10px; }
.mat-edit summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--sea-700);
  width: fit-content;
}
.mat-edit form { margin-top: 12px; }
.panel-lead { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.password-panel { max-width: 560px; }
.file-badge {
  display: inline-block;
  padding: .18em .45em;
  border-radius: 5px;
  background: rgba(0, 59, 112, .08);
  color: var(--sea-800);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}

@media (max-width: 880px) {
  .portal-grid { grid-template-columns: 1fr; }
  .tt-grid, .tt-grid.has-weekend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-preview .tt-day:nth-child(n+5) { display: none; }
  .embed-box { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tt-grid, .tt-grid.has-weekend { grid-template-columns: 1fr; }
  .tt-preview { grid-template-columns: 1fr; }
  .tt-preview .tt-day:nth-child(n+4) { display: none; }
  .tt-weeklabel { min-width: 0; flex: 1; }
  .materials-grid { grid-template-columns: 1fr; }
  .mat-toolbar select { flex: 1 1 100%; }
}

@media print {
  .tt-toolbar .btn, .tt-status, .embed-box { display: none !important; }
  .tt-grid, .tt-grid.has-weekend { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .tt-day { break-inside: avoid; box-shadow: none; }
  .site-footer { display: none !important; }
}
