/* Intellektor - дизайн-система школы.
   Тёплая бумага, чернила, одна печатная краска. Язык официального документа.
   Правило: цвета только токенами, хардкод hex в разметке запрещён. */

/* IBM Plex, самохостинг. Сабсеты по диапазонам: базовая латиница, расширенная
   (эстонские õ ä ö ü š ž) и кириллица для русской витрины. Всего ~156 КБ,
   браузер тянет только те файлы, чьи символы встретились на странице. */
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-lat-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-ext-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-cyr-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-lat-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-ext-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/plex-sans-cyr-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: "Marcellus";
  src: url("/assets/fonts/marcellus-lat-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Marcellus";
  src: url("/assets/fonts/marcellus-ext-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ── Токены ─────────────────────────────────────────────────────────── */
:root {
  --paper:  #FBFAF7;   /* полотно */
  --sheet:  #FFFFFF;   /* лист документа: карточки, блоки данных */
  --sunken: #F4F1EA;   /* вложенные врезки */

  --ink:    #14181D;   /* заголовки          17.1 на paper */
  --body:   #343B44;   /* основной текст     10.9 */
  --muted:  #5C6570;   /* подписи, сноски     5.7 */

  --line:        #D9D6CD;  /* волосяные линейки - чистый декор */
  --line-strong: #14181D;  /* правило под заголовком документа */
  --seal:        #4A2668;  /* единственный акцент: ссылки, печать, фокус - «Мрамор», 21.09 */
  --seal-hover:  #5D3480;

  --sans:  "Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Marcellus", Georgia, "Times New Roman", serif;

  --wrap: 960px;   /* витрина */
  --doc:  68ch;    /* документ */
  --gut:  24px;
}
@media (min-width: 720px) { :root { --gut: 40px; } }

/* ── База ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 400 17px/1.65 var(--sans);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { color: var(--ink); margin: 0 0 .5em; font-family: var(--serif); font-weight: 400; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 24px; line-height: 1.3; margin-top: 2em; }
h3 { font-size: 18px; line-height: 1.4; font-family: var(--sans); font-weight: 600; margin-top: 1.6em; }
p, li { margin: 0 0 .9em; }
ul, ol { padding-left: 1.3em; }
strong { font-weight: 600; color: var(--ink); }
abbr[title] { text-decoration: underline dotted; cursor: help; }

a { color: var(--seal); text-decoration: underline; text-underline-offset: 2px; transition: color .15s; }
a:hover { color: var(--seal-hover); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--seal); outline-offset: 3px; border-radius: 2px;
}

/* Русские заголовки - гротеском: у Marcellus кириллицы нет */
html.lang-ru h1, html.lang-ru h2 { font-family: var(--sans); }

/* ── Каркас ─────────────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
main  { padding: 40px 0 64px; }
.lede { font-size: 19px; color: var(--ink); max-width: var(--doc); }
main > .wrap > *:not(.factbox):not(table):not(.doc) { max-width: var(--doc); }

/* ── Шапка ──────────────────────────────────────────────────────────── */
.top { border-bottom: 1px solid var(--line); background: var(--sheet); }
.top .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.logo { display: block; height: 44px; width: auto; flex: none; }
.logo a { display: block; text-decoration: none; }

.nav { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--body); text-decoration: none; padding: 6px 0; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--seal); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--seal); }

.lang { display: flex; gap: 2px; flex: none; margin-left: 4px; }
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; font-size: 14px; font-weight: 600;
  color: var(--muted); text-decoration: none; letter-spacing: .04em;
}
.lang a:hover { color: var(--seal); }
.lang a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--seal); }

/* ── Компоненты ─────────────────────────────────────────────────────── */

/* линейка под заголовком документа - тот же жест, что в логотипе */
.rule { height: 1.5px; background: var(--line-strong); border: 0; margin: 0 0 28px; max-width: var(--doc); }

/* обязательные данные § 12 lg 1 одним блоком */
.factbox {
  background: var(--sheet); border: 1px solid var(--line); border-radius: 4px;
  padding: 24px var(--gut); margin: 28px 0;
}
.factbox h2 { margin-top: 0; font-size: 20px; }
.factbox dl { display: grid; grid-template-columns: 1fr; gap: 4px 28px; margin: 0; }
@media (min-width: 720px) { .factbox dl { grid-template-columns: 210px 1fr; } }
.factbox dt {
  font: 500 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding-top: 6px;
}
.factbox dd { margin: 0 0 14px; }
.factbox dd:last-child { margin-bottom: 0; }

/* врезка: правовое основание, пояснение */
.note {
  border-left: 2px solid var(--seal); padding: 2px 0 2px 18px; margin: 22px 0;
  color: var(--muted); font-size: 15px; max-width: var(--doc);
}
.note p:last-child { margin-bottom: 0; }

/* русская строка на эстонском документе */
.ru-note {
  background: var(--sunken); border-radius: 4px; padding: 14px 18px; margin: 0 0 28px;
  font-size: 15px; color: var(--muted); max-width: var(--doc);
}
.ru-note p { margin: 0; }

/* ссылка на файл */
.filelink { display: inline-flex; align-items: baseline; gap: 9px; font-weight: 500; }
.filelink .meta { color: var(--muted); font-weight: 400; font-size: 14px; }

/* юрдокумент: нумерация висит слева, каждый пункт - якорь */
.doc { max-width: var(--doc); }
.doc h2 { font-size: 20px; }
.doc section { margin-bottom: 2em; }
.doc p[id] { scroll-margin-top: 90px; }
.doc .p { display: grid; grid-template-columns: 3.6em 1fr; gap: 0 4px; margin: 0 0 .7em; }
.doc .p > .n { color: var(--muted); font-variant-numeric: tabular-nums; }

/* метка «(на эстонском)» у ссылок на юрдокументы - видна только в RU */
.et-only { display: none; }
html.lang-ru .et-only, html[data-pref="ru"] .et-only {
  display: inline-block; margin-left: .4em; padding: 1px 5px;
  font-size: 11px; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 2px; vertical-align: 1px;
}


/* список программ */
.progs { list-style: none; padding: 0; margin: 20px 0 0; max-width: var(--doc); }
.progs li { border-top: 1px solid var(--line); padding: 16px 0; }
.progs li:last-child { border-bottom: 1px solid var(--line); }
.progs a { font-family: var(--serif); font-size: 19px; text-decoration: none; display: block; margin-bottom: 4px; }
.progs a:hover { text-decoration: underline; }
.progs .meta { display: block; font-size: 14px; color: var(--muted); }
.progs .d { display: block; margin-top: 6px; font-size: 15px; }
html.lang-ru .progs a { font-family: var(--sans); font-weight: 600; font-size: 18px; }

/* юрдокумент: висячая нумерация, якорь на каждом пункте */
.doc h1 { font-size: 26px; }
.doc .meta { color: var(--muted); font-size: 14px; margin: -14px 0 24px; }
.doc .p { display: grid; grid-template-columns: 3.4em 1fr; gap: 0 6px; margin: 0 0 .7em; scroll-margin-top: 90px; }
.doc .p.sub { grid-template-columns: 4.2em 1fr; }
.doc .p > .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }
.doc section { margin-bottom: 2.2em; }
.doc h2 { scroll-margin-top: 90px; }

/* ── Подвал ─────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background: var(--sheet); margin-top: 56px; }
.foot .wrap { padding-top: 32px; padding-bottom: 40px; font-size: 15px; color: var(--muted); }
.foot h2 {
  font: 500 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.foot-cols { display: grid; gap: 28px; }
@media (min-width: 720px) { .foot-cols { grid-template-columns: 1fr 1fr; gap: 40px; } }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot .rekvisiidid p { margin: 0 0 4px; }

/* ── Печать: она же основа PDF ──────────────────────────────────────── */
@media print {
  :root { --paper: #fff; --sheet: #fff; }
  @page { margin: 20mm; }
  body { font-size: 11pt; line-height: 1.5; }
  .top .nav, .lang, .foot, .ru-note { display: none !important; }
  .top { border: 0; }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; page-break-after: avoid; }
  h3 { page-break-after: avoid; }
  .factbox, .doc section { page-break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  main a[href^="http"]::after,
  main a[href^="/"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* полный текст õppekava на странице программы (25.09.2026) */
.oppekava { margin-top: 2.6em; }
.oppekava-tekst h2 { font-size: 20px; margin: 1.8em 0 .6em; }
.oppekava-tekst h2 .n { color: var(--muted); margin-right: .45em; font-variant-numeric: tabular-nums; }
.oppekava-tekst h3 { font-size: 17px; margin: 1.5em 0 .5em; }
.oppekava-tekst .kv strong { font-weight: 600; }
.oppekava-tekst ul.num { list-style: decimal; padding-left: 1.4em; }
.oppekava-tekst .tbl { overflow-x: auto; margin: 0 0 1.2em; -webkit-overflow-scrolling: touch; }
.oppekava-tekst table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; line-height: 1.45; }
.oppekava-tekst th, .oppekava-tekst td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.oppekava-tekst th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom-color: var(--ink); }
.oppekava-tekst .q { font-style: normal; }
