/* Сайт учителя. Порядок: токены, шрифты, основа, типографика, каркас,
   шапка, меню, подвал, навигация раздела, крошки, главная, блоки содержимого,
   просмотр галереи, формы, утилиты, движение. */

/* ---------- Токены ---------- */
:root {
  --ink: #1b2338;
  --ochre: #d4932a;          /* только фон и линии */
  --ochre-text: #8c5a10;     /* текст на светлом: 5.2:1 на --paper */
  --paper: #f1f2ef;
  --paper-2: #e6e8e3;        /* фон наведения и выбранного пункта */
  --field: #fbfbfa;          /* фон полей ввода */
  --line: rgba(27, 35, 56, .14);
  --line-strong: rgba(27, 35, 56, .45);
  --muted: #5d6375;
  --error: #9b1c1c;
  --paper-muted: #aab0bf;    /* вторичный текст на --ink: 7.2:1 */
  --line-on-ink: rgba(241, 242, 239, .2);
  --ink-deep: #0f1422;       /* фон просмотра галереи */

  --font-text: "Golos Text", "Segoe UI", Arial, sans-serif;
  --font-display: "Unbounded", Verdana, sans-serif;

  --text-sm: .875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);

  --gutter: clamp(1rem, 4vw, 2rem);
  --page-width: 75rem;
  --measure: 65ch;
  --radius: 2px;
}

/* ---------- Шрифты (Fontsource 5.3.0, OFL, см. fonts/OFL.txt) ---------- */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-400.a82793f97f91.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-text-latin-400.4b88b42724af.woff2") format("woff2");
  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: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-500.97abfef86e34.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/golos-text-latin-500.b0c19f244d45.woff2") format("woff2");
  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: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-600.894768c4c711.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/golos-text-latin-600.2938437410d6.woff2") format("woff2");
  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: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/unbounded-cyrillic-500.5fe6bc946a85.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/unbounded-latin-500.51f5c98b19e8.woff2") format("woff2");
  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: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/unbounded-cyrillic-700.f058c40ba90f.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/unbounded-latin-700.6547c9c92dc8.woff2") format("woff2");
  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; }

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; }

::selection { background: var(--ochre); color: var(--ink); }

/* Фокус: охристый контур и тёмное кольцо под ним, чтобы контур читался
   и на светлом фоне (охра на --paper даёт только 2.3:1). Это не тень блока. */
:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ink);
}

[hidden] { display: none !important; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin-bottom: 1.5rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 2rem 0 .75rem;
}

p, ul, ol, dl, table, figure { margin: 0 0 1rem; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .25em; }

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--ochre);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { color: var(--ochre-text); text-decoration-thickness: 2px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

small, .meta { font-size: var(--text-sm); color: var(--muted); }

/* ---------- Каркас ---------- */
.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 2rem 4rem;
}

.layout__main > * { max-width: var(--measure); }
/* Шире строки текста только блоки с классом .wide: галерея и таблица */
.layout__main > .wide { max-width: none; }

.layout__aside { margin-top: 3rem; }

@media (min-width: 1024px) {
  .layout:has(> .layout__aside) {
    grid-template-columns: 14rem minmax(0, 1fr);
    grid-template-areas: "aside main";
    column-gap: 4rem;
  }
  .layout:has(> .layout__aside) > .layout__main { grid-area: main; }
  .layout__aside {
    grid-area: aside;
    margin-top: 0;
    padding-top: .25rem;
  }
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: .5rem .75rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { top: .5rem; }

/* ---------- Шапка ----------
   По умолчанию (узкий экран и .no-js) меню идёт списком под строкой с именем.
   В строку оно встаёт только с JS от 860px: перенос в «Ещё» делает site.js. */
.site-header { border-bottom: 1px solid var(--line); }

.site-header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  min-height: 4rem;
  padding-block: .75rem;
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-logo:hover { color: var(--ink); }

.menu-toggle {
  display: none;
  font: 500 var(--text-sm)/1 var(--font-text);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: .55rem .85rem;
  cursor: pointer;
}
.menu-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

.site-header__panel {
  flex: 1 0 100%;
  border-top: 1px solid var(--line);
  padding-bottom: 1rem;
}

/* ---------- Меню: список ---------- */
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }

.site-nav__item { border-bottom: 1px solid var(--line); }

.site-nav a {
  display: block;
  padding: .7rem 0;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.site-nav a:hover { color: var(--ochre-text); }
.site-nav a.is-active {
  text-decoration: underline;
  text-decoration-color: var(--ochre);
  text-decoration-thickness: 2px;
  text-underline-offset: .35em;
}
.site-nav a[aria-current="page"] { font-weight: 600; }

.site-nav .site-nav__sub { padding: 0 0 .5rem 1rem; }
.site-nav__sub a { padding: .35rem 0; font-weight: 400; color: var(--muted); }

.site-nav__toggle,
.site-nav__more-button { display: none; }

.site-nav__more { border-bottom: 0; }

.site-search {
  display: flex;
  margin-top: 1rem;
}

/* ---------- Меню: строка (JS, от 860px) ---------- */
@media (max-width: 859.98px) {
  .js .menu-toggle { display: inline-block; }
  .js .menu-toggle[aria-expanded="false"] + .site-header__panel { display: none; }
}

@media (min-width: 860px) {
  .js .site-header__bar { flex-wrap: nowrap; }

  .js .site-logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .js .site-header__panel {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 0;
    padding-bottom: 0;
  }

  .js .site-nav { flex: 1 1 0; min-width: 0; }

  .js .site-nav__list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    column-gap: 1.25rem;
  }
  /* До первой раскладки из site.js лишние пункты не налезают на имя */
  .js .site-nav__list[data-nav-primary]:not([data-fitted]) { overflow: hidden; }

  .js .site-nav__list > .site-nav__item {
    flex: none;
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 0;
  }

  .js .site-nav__list > .site-nav__item > a {
    padding: .4rem 0;
    font-size: .9375rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .js .site-nav__list > .site-nav__item > a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
  .js .site-nav__list > .site-nav__item > a.is-active { text-decoration: none; border-bottom-color: var(--ochre); }

  .js .site-nav__toggle,
  .js .site-nav__more-button {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--ink);
    cursor: pointer;
    font: 500 .9375rem/1.6 var(--font-text);
  }
  /* Цель нажатия не меньше 24×24 px; отрицательные поля сохраняют прежний шаг строки */
  .js .site-nav__toggle {
    justify-content: center;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: .4rem 0;
    margin-inline: -.125rem -.25rem;
    color: var(--muted);
  }
  .js .site-nav__more-button { padding: .4rem 0; }
  .js .site-nav__more-button:hover { border-bottom-color: var(--line-strong); }
  .js .site-nav__more:has(.is-active) > .site-nav__more-button { border-bottom-color: var(--ochre); }

  .js .site-nav__toggle::before,
  .js .site-nav__more-button::after {
    content: "";
    width: .4em;
    height: .4em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-.15em) rotate(45deg);
    transition: transform .15s ease-out;
  }
  .js .site-nav__more-button::after { margin-left: .45em; }
  .js [data-dropdown][aria-expanded="true"]::before,
  .js [data-dropdown][aria-expanded="true"]::after { transform: translateY(.1em) rotate(-135deg); }

  /* Выпадающие списки */
  .js .site-nav__sub,
  .js .site-nav__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    z-index: 20;
    min-width: 15rem;
    max-width: 22rem;
    padding: .375rem 0;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-top: 2px solid var(--ink);
  }
  .js .site-nav__sub { left: 0; }
  .js .site-nav__dropdown { right: 0; max-height: calc(100vh - 6rem); overflow-y: auto; }
  .js [data-dropdown][aria-expanded="true"] + ul { display: block; }

  .js .site-nav__sub a,
  .js .site-nav__dropdown a {
    padding: .45rem 1rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
  }
  .js .site-nav__sub a:hover,
  .js .site-nav__dropdown a:hover { background: var(--paper-2); color: var(--ink); }
  .js .site-nav__sub a.is-active,
  .js .site-nav__dropdown a.is-active {
    text-decoration: none;
    border-left: 2px solid var(--ochre);
    padding-left: calc(1rem - 2px);
  }

  /* Внутри «Ещё» подпункты раскрыты сразу, без своих кнопок */
  .js .site-nav__dropdown .site-nav__item { display: block; border-bottom: 0; }
  .js .site-nav__dropdown .site-nav__toggle { display: none; }
  .js .site-nav__dropdown .site-nav__sub {
    display: block;
    position: static;
    min-width: 0;
    max-width: none;
    padding: 0 0 .25rem .75rem;
    border: 0;
  }
  .js .site-nav__dropdown .site-nav__sub a { font-size: var(--text-sm); font-weight: 400; color: var(--muted); padding-block: .3rem; }

  .js .site-search { flex: none; margin-top: 0; }
  .js .site-search__input { width: 10rem; }
}

/* ---------- Подвал ---------- */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: var(--paper);
  font-size: .9375rem;
}

.site-footer__grid {
  display: grid;
  gap: 1.5rem 3rem;
  padding-block: 2.5rem 1.75rem;
}

@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) auto; }
}

.site-footer p { margin: 0 0 .375rem; color: var(--paper-muted); }

.site-footer .site-footer__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--paper);
}

.site-footer__text { max-width: var(--measure); }

.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--paper); text-decoration-thickness: 2px; }

.site-footer__links { list-style: none; margin: 0; padding: 0; }

.site-footer .site-footer__legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-on-ink);
  font-size: var(--text-sm);
}

/* ---------- Навигация раздела ---------- */
.section-nav { font-size: .9375rem; line-height: 1.4; }

.section-nav a { display: block; color: var(--ink); text-decoration: none; }
.section-nav a:hover { color: var(--ochre-text); }

.section-nav__title {
  font-family: var(--font-display);
  font-weight: 500;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--ink);
}

.section-nav ul { list-style: none; margin: 0; padding: 0; }
.section-nav > ul { margin-top: .5rem; }
.section-nav li { margin: 0; }
.section-nav li a {
  padding: .4rem 0 .4rem .75rem;
  border-left: 2px solid transparent;
}
.section-nav li li a { padding-left: 1.5rem; font-size: var(--text-sm); }
.section-nav li li li a { padding-left: 2.25rem; }
.section-nav li a.is-active { border-left-color: var(--ochre); }
.section-nav a[aria-current="page"] { font-weight: 600; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { font-size: var(--text-sm); color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline: .5em; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration-color: var(--line-strong); }
.breadcrumbs a:hover { color: var(--ink); }

/* ---------- Главная ----------
   Первый экран, полоса плиток и цитата стоят в одной колонке шириной
   с шапку. --home-pad выравнивает текст плиток и цитаты по тексту первого экрана. */
.home {
  --home-pad: 0px;
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding: 0 var(--gutter) 4rem;
}

.hero {
  display: grid;
  margin-inline: calc(-1 * var(--gutter));
  background: var(--ink);
  color: var(--paper);
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.25rem var(--gutter) 2rem;
}

.hero__title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.875rem, 1.1rem + 2.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.02em;
}

.hero__subtitle {
  margin: 0;
  max-width: 44ch;
  color: var(--paper-muted);
}

.hero__photo {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--paper-2);
}
.hero__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiles {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.tiles li { margin: 0; }
.tiles li + li { border-top: 1px solid var(--line); }

.tile {
  display: block;
  height: 100%;
  padding: 1.125rem var(--home-pad) 1.25rem;
  border-top: 2px solid transparent;
  color: var(--ink);
  text-decoration: none;
}
.tile:hover { color: var(--ink); background: var(--paper-2); border-top-color: var(--ochre); }

.tile__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
}
.tile__caption {
  display: block;
  margin-top: .35rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--muted);
}

.home-quote {
  margin: 0;
  padding: 2.25rem var(--home-pad) 2.5rem;
}
.home-quote blockquote { margin: 0; }
.home-quote p {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  line-height: 1.4;
  text-wrap: balance;
}
.home-quote figcaption { margin-top: .75rem; font-size: var(--text-base); }

.home__body {
  padding: 2.5rem var(--home-pad) 0;
  border-top: 1px solid var(--line);
}
.home__body > :first-child { margin-top: 0; }

@media (min-width: 720px) {
  .tiles { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .tiles li + li { border-top: 0; border-left: 1px solid var(--line); }
  .tile { padding-right: 1.5rem; }
  .tiles li:not(:first-child) .tile { padding-left: max(1.5rem, var(--home-pad)); }
}

@media (min-width: 860px) {
  .home { --home-pad: clamp(1.75rem, 3vw, 2.75rem); }
  .hero { margin-inline: 0; }
  /* Высоту задаёт текст; с фото — не ниже полосы, в которой фото читается */
  .hero--photo { grid-template-columns: 1.15fr 1fr; min-height: clamp(17rem, 26vw, 22rem); }
  .hero__text { padding: 2.75rem var(--home-pad) 2.25rem; }
  .hero__photo { aspect-ratio: auto; }
}

/* ---------- Блоки содержимого ---------- */
/* Общие правила только для области содержимого, чтобы не задеть формы */
:where(.layout__main, .home) figure { margin: 0; }
:where(.layout__main, .home) figcaption { margin-top: .5rem; font-size: var(--text-sm); line-height: 1.45; color: var(--muted); }

.figure,
.gallery,
.documents,
.video,
.quote,
.table-scroll,
.note { margin-block: 2rem; }

.figure img { display: block; width: 100%; height: auto; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  list-style: none;
  padding: 0;
}
.gallery li { margin: 0; }
.gallery a { display: block; background: var(--paper-2); }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.gallery a:hover img { opacity: .88; }
.gallery figcaption { margin-top: .35rem; }

@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
}

.documents h2 { margin-top: 0; }
.documents__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.documents__list li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: .875rem;
  align-items: baseline;
  margin: 0;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.documents__ext {
  grid-row: span 2;
  align-self: start;
  margin-top: .2rem;
  padding: .3rem 0;
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.documents__list a { font-weight: 500; }
.documents__meta { font-size: var(--text-sm); color: var(--muted); }

@media (min-width: 720px) {
  .documents__list li { grid-template-columns: 3rem minmax(0, 1fr) auto; }
  .documents__ext { grid-row: auto; }
  .documents__meta { white-space: nowrap; }
}

.video iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--ink);
}

.quote blockquote { margin: 0; }
.quote p {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.45;
}
.quote figcaption { font-size: var(--text-base); }

/* Кавычки вынесены за край текста */
.quote__mark { color: var(--ochre-text); }
.quote__mark:first-child { margin-left: -.5em; }
.quote figcaption::before,
.home-quote figcaption::before { content: "— "; }

.table-scroll { overflow-x: auto; }
.table-scroll table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: .9375rem;
  line-height: 1.45;
}
.table-scroll caption {
  padding-bottom: .5rem;
  font-weight: 600;
  text-align: left;
}
.table-scroll th,
.table-scroll td {
  padding: .55rem .75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table-scroll thead th { font-weight: 600; border-bottom: 2px solid var(--ink); }
.table-scroll th:first-child,
.table-scroll td:first-child { padding-left: 0; }
.table-scroll td > :last-child { margin-bottom: 0; }

.note {
  padding: 1rem 1.25rem;
  background: var(--paper-2);
  border-left: 3px solid var(--ochre);
}
.note > :last-child { margin-bottom: 0; }

/* Подразделы и дата под текстом страницы */
.subpages {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.subpages li { margin: 0; border-bottom: 1px solid var(--line); }
.subpages a { display: block; padding: .65rem 0; font-weight: 500; text-decoration: none; }
.subpages a:hover { color: var(--ochre-text); }

.page-updated { margin-top: 2.5rem; }

/* ---------- Просмотр галереи ----------
   <dialog> на весь экран создаёт site.js; без JS ссылки ведут на файл. */
html:has(.lightbox[open]) { overflow: hidden; }

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ink-deep);
  color: var(--paper);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  animation: lightbox-in .15s ease-out;
}
.lightbox::backdrop { background: var(--ink-deep); }

.lightbox__figure {
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  min-height: 0;
  padding: 1rem var(--gutter) .75rem;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox__img.is-loading { visibility: hidden; }
.lightbox__caption {
  max-width: var(--measure);
  margin-top: .75rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: center;
  color: var(--paper-muted);
}

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem var(--gutter);
  border-top: 1px solid var(--line-on-ink);
}
.lightbox__count {
  margin-right: auto;
  font-size: var(--text-sm);
  color: var(--paper-muted);
  font-variant-numeric: tabular-nums;
}
.lightbox__button {
  padding: .5rem .9rem;
  font: 500 .9375rem/1.4 var(--font-text);
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
  cursor: pointer;
}
.lightbox__button:hover { background: var(--paper); color: var(--ink); }

@keyframes lightbox-in { from { opacity: 0; } }

/* ---------- Формы и кнопки ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .5rem 1rem;
  font: 500 .9375rem/1.4 var(--font-text);
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--ochre); border-color: var(--ochre); color: var(--ink); }

input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  min-width: 0;
}

.site-search__input {
  flex: 1 1 auto;
  font-size: .9375rem;
  line-height: 1.4;
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.site-search .button { border-radius: 0 var(--radius) var(--radius) 0; }

/* Форма: общая разметка для гостевой книги и обратной связи */
.form { margin-top: 2rem; max-width: 36rem; }
.form__row { margin: 0 0 1rem; }
.form__row > label:not(.form__check) { display: block; margin-bottom: .25rem; font-weight: 500; }
.form input[type="text"], .form input[type="email"], .form input[type="number"],
.form input[type="url"], .form input[type="tel"], .form input[type="date"],
.form input[type="datetime-local"], .form select, .form textarea { width: 100%; }
.form__group { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.form__group legend { padding: 0; margin-bottom: .25rem; font-weight: 500; }
.form textarea { resize: vertical; }
.form__row--check { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.form__check { display: flex; gap: .5rem; align-items: baseline; }
.form__check input { flex: none; margin: 0; }
.form__help { margin: .25rem 0 0; color: var(--muted); font-size: .875rem; }
.form__privacy { margin: .75rem 0 0; font-size: .875rem; }
.form__error, .form__errors { margin: .25rem 0 0; color: var(--error); font-size: var(--text-sm); }
.form__errors { margin: 0 0 1rem; padding: .5rem .75rem; list-style: none; border-left: 3px solid var(--error); }
.form__status { margin: 1.5rem 0 0; padding: .5rem .75rem; border-left: 3px solid var(--ochre); background: var(--paper-2); }

/* Гостевая книга */
.entries { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.entry { padding: 1rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.entry--empty { color: var(--muted); }
.entry__head { margin: 0 0 .25rem; }
.entry__name { font-weight: 600; overflow-wrap: anywhere; }
.entry__date { margin-left: .5rem; color: var(--muted); font-size: var(--text-sm); }
.entry__text, .entry__reply { margin: 0; overflow-wrap: anywhere; }
.entry__reply { margin-top: .5rem; padding-left: .75rem; border-left: 3px solid var(--ochre); }
.entry__reply-label { font-weight: 600; color: var(--ochre-text); }
.pager { display: flex; gap: 1rem; align-items: baseline; margin-top: 1rem; font-size: var(--text-sm); }

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

/* ---------- Движение ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Поиск */
.search-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 1.25rem; }
.search-form input { flex: 1 1 14rem; min-width: 0; }
.search-total { color: var(--muted); font-size: var(--text-sm); }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.search-results a { font-weight: 500; }
.search-results p { margin: .2rem 0 0; color: var(--muted); font-size: var(--text-sm); }
