/* ============================================================================
   school-math.org — оформление сайта.

   Одна тема на весь сайт: корневые страницы и раздел «Семинар» выглядят
   одинаково. Ничего из вордпресса здесь не используется.

   Порядок: шрифты → переменные → база → шапка → страницы → карточки →
   календарь → текст записи → комментарии → подвал → адаптив → печать.
   ========================================================================= */

/* ------------------------------------------------------------------ шрифты */
/* Literata и Golos Text (SIL Open Font License 1.1), лежат рядом в fonts/ */
@font-face {
    font-family: 'Literata';
    src: url('/assets/fonts/literata-cyrillic.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0400-04FF, U+0460-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: 'Literata';
    src: url('/assets/fonts/literata-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB, U+2212;
}
@font-face {
    font-family: 'Literata';
    src: url('/assets/fonts/literata-italic-cyrillic.woff2') format('woff2');
    font-weight: 400 600;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0400-04FF, U+0460-052F;
}
@font-face {
    font-family: 'Literata';
    src: url('/assets/fonts/literata-italic-latin.woff2') format('woff2');
    font-weight: 400 600;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
    font-family: 'Golos Text';
    src: url('/assets/fonts/golos-text-cyrillic.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0400-04FF, U+0460-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
    font-family: 'Golos Text';
    src: url('/assets/fonts/golos-text-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB, U+2212;
}

/* --------------------------------------------------------------- переменные */
:root {
    --paper:       #fbfaf7;
    --paper-warm:  #f4f1e9;
    --card:        #ffffff;

    --ink:         #17191c;
    --ink-soft:    #3b424a;
    --muted:       #6f7681;

    --line:        #e4ded1;
    --line-soft:   #efebe1;

    --accent:      #a53a22;   /* кирпичный: акценты, даты, активные состояния */
    --accent-dark: #822c17;
    --accent-soft: #fbefe9;

    --radius:      14px;
    --radius-sm:   9px;
    --shadow-sm:   0 1px 2px rgba(23, 25, 28, .05);
    --shadow-md:   0 2px 4px rgba(23, 25, 28, .04), 0 14px 30px -18px rgba(23, 25, 28, .28);

    --step:        clamp(1rem, 0.7rem + 1.2vw, 1.6rem);
    --font-text:   'Golos Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-display:'Literata', Georgia, 'Times New Roman', serif;

    /* «миллиметровка» — лёгкий математический фон для шапок разделов */
    --grid-paper:
        linear-gradient(to right, rgba(23, 25, 28, .045) 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(to bottom, rgba(23, 25, 28, .045) 1px, transparent 1px) 0 0 / 26px 26px;
}

/* --------------------------------------------------------------------- база */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.0625rem;
    line-height: 1.68;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.015em;
    margin: 0 0 0.6em;
    text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

.visually-hidden, .screen-reader-text {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink); color: #fff; padding: 0.8rem 1.2rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container {
    width: 100%;
    max-width: 1140px;
    margin-inline: auto;
    padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}
.container--narrow { max-width: 780px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.9rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.section-title {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.55rem);
    margin: 0 0 1.2rem;
}

/* кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); }

.link-more {
    font-weight: 500;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    padding-bottom: 1px;
}
.link-more::after { content: ' →'; }
.link-more:hover { border-bottom-color: currentColor; }

.chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink-soft);
    text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--draft { border-style: dashed; color: var(--muted); }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { margin-bottom: 0.55rem; line-height: 1.45; }
.link-list a { text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list .small { display: block; }

/* ------------------------------------------------------------------- шапка */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 68px;
    padding-block: 0.7rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-right: auto;
}
.brand__mark {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    transition: background-color .2s ease;
}
.brand:hover .brand__mark { background: var(--accent); }
.brand__text { display: flex; flex-direction: column; }
.brand__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.brand__tagline { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-list a {
    position: relative;
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--ink-soft);
    padding-block: 0.35rem;
    white-space: nowrap;
}
.nav-list a:hover { color: var(--accent); }
.nav-list a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav-list a[aria-current="page"]::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -0.1rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.search-mini { display: flex; align-items: center; }
.search-mini input {
    width: 8.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line);
    border-right: none;
    border-radius: 999px 0 0 999px;
    background: var(--card);
    font: inherit;
    font-size: 0.9rem;
    transition: width .2s ease, border-color .2s ease;
}
.search-mini input:focus { width: 11rem; outline: none; border-color: var(--accent); }
.search-mini button {
    display: grid;
    place-items: center;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 999px 999px 0;
    background: var(--card);
    color: var(--ink-soft);
    cursor: pointer;
}
.search-mini button:hover { color: var(--accent); }
.search-mini input:focus + button { border-color: var(--accent); }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font: inherit;
    font-size: 0.9rem;
    color: var(--ink);
    cursor: pointer;
}
.nav-toggle__bars { display: grid; gap: 3px; }
.nav-toggle__bars i { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }

/* ------------------------------------------------------ шапка страницы */
.page-head {
    position: relative;
    padding-block: clamp(2.4rem, 1.6rem + 3vw, 4.2rem) clamp(1.8rem, 1.2rem + 2vw, 3rem);
    background-color: var(--paper-warm);
    background-image: var(--grid-paper);
    border-bottom: 1px solid var(--line);
    margin-bottom: clamp(2rem, 1.4rem + 2vw, 3.4rem);
    overflow: hidden;
}
.page-head::after {          /* мягкое затухание «миллиметровки» книзу */
    content: '';
    position: absolute; inset: auto 0 0 0; height: 55%;
    background: linear-gradient(to bottom, transparent, var(--paper-warm));
    pointer-events: none;
}
.page-head > .container { position: relative; z-index: 1; }

.page-head__title {
    font-size: clamp(1.9rem, 1.35rem + 2.4vw, 3.1rem);
    margin: 0 0 0.5rem;
    max-width: 20ch;
}
.page-head--post .page-head__title { max-width: 24ch; }
.page-head__lead {
    max-width: 62ch;
    color: var(--ink-soft);
    font-size: 1.08rem;
    margin: 0.8rem 0 0;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin: 1.2rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}
.post-meta a { color: var(--muted); }

/* ------------------------------------------------------------- карточки */
.event-list { display: grid; gap: 1.1rem; }
.event-list--tight { gap: 0.8rem; }

.event-card {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: clamp(1rem, 0.6rem + 1.4vw, 1.8rem);
    padding: clamp(1.1rem, 0.8rem + 1vw, 1.6rem);
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.event-card:hover {
    border-color: var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.event-card__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-dark);
    text-decoration: none;
    line-height: 1.1;
    height: max-content;
}
.event-card__day {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.event-card__month { font-size: 0.82rem; text-transform: lowercase; }
.event-card__year { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }

.event-card__title {
    font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
    margin: 0 0 0.5rem;
}
.event-card__title a { text-decoration: none; }
.event-card__title a:hover { color: var(--accent); }

.event-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.8rem;
    margin: 0 0 0.7rem;
    font-size: 0.88rem;
    color: var(--muted);
}
.event-card__excerpt {
    margin: 0 0 0.8rem;
    color: var(--ink-soft);
    max-width: 68ch;
}
.event-card__more { margin: 0; }

.empty-state {
    padding: clamp(1.5rem, 1rem + 2vw, 3rem);
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.empty-state .btn { margin-right: 0.5rem; }

/* --------------------------------------------------------- главная раздела */
.home-events {
    margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
    padding-block: clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem);
    background: var(--paper-warm);
    border-top: 1px solid var(--line);
}

.next-event {
    padding: clamp(1.4rem, 1rem + 1.6vw, 2.2rem);
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: clamp(1.8rem, 1.4rem + 1.4vw, 2.8rem);
}
.next-event__title { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 2rem); margin: 0 0 0.4rem; }
.next-event__title a { text-decoration: none; }
.next-event__date { color: var(--accent-dark); font-weight: 500; margin: 0 0 0.8rem; }
.next-event__excerpt { color: var(--ink-soft); max-width: 70ch; }

.home-events__grid {
    display: grid;
    gap: clamp(1.6rem, 1.2rem + 2vw, 3rem);
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
}

/* ---------------------------------------------------------------- календарь */
.calendar-layout {
    display: grid;
    gap: clamp(1.6rem, 1.2rem + 2vw, 3rem);
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    align-items: start;
    margin-bottom: 4rem;
}

.year-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: clamp(1.4rem, 1rem + 1.4vw, 2.2rem);
}
.year-strip__item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.year-strip__item:hover { border-color: var(--accent); color: var(--accent); }
.year-strip__item.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.year-strip__count { font-size: 0.75rem; opacity: .65; }

.calendar {
    padding: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.calendar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.calendar__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}
.calendar__nav {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    text-decoration: none;
    color: var(--ink-soft);
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.calendar__nav:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.calendar__nav.is-disabled { opacity: .3; }

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar__wd {
    text-align: center;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding-bottom: 0.4rem;
}
.calendar__day {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 9px;
    font-size: 0.92rem;
    color: var(--ink-soft);
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.calendar__day.is-empty { visibility: hidden; }
.calendar__day.is-today { box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.calendar__day.has-event {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 600;
}
.calendar__day.has-event::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
}
a.calendar__day.has-event:hover { background: var(--accent); color: #fff; }
a.calendar__day.has-event:hover::after { background: #fff; }

.calendar__more { margin: 0.9rem 0 0; font-size: 0.9rem; }
.calendar__more a { text-decoration: none; color: var(--accent); }

.calendar--compact { padding: 1rem; }
.calendar--compact .calendar__day { font-size: 0.85rem; border-radius: 7px; }
.calendar--compact .calendar__title { font-size: 1rem; }

.callout {
    margin-top: 1.6rem;
    padding: 1.2rem 1.4rem;
    background: var(--accent-soft);
    border-radius: var(--radius);
}
.callout__label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin: 0 0 0.4rem;
}
.callout__title { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 0.3rem; }
.callout__title a { text-decoration: none; }

/* ------------------------------------------------------------ текст записи */
.entry-content {
    font-size: 1.09rem;
    line-height: 1.72;
    color: var(--ink-soft);
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.25em; }
.entry-content strong, .entry-content b { color: var(--ink); font-weight: 600; }
.entry-content h2, .entry-content h3, .entry-content h4 {
    color: var(--ink);
    margin: 2em 0 0.7em;
}
.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.35rem; }
.entry-content h4 { font-size: 1.15rem; }
.entry-content a { color: var(--accent-dark); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.entry-content a:hover { color: var(--accent); }
.entry-content ul, .entry-content ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
    margin: 1.6em 0;
    padding: 0.2em 0 0.2em 1.3em;
    border-left: 3px solid var(--accent);
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
}
.entry-content hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.5em 0;
}
.entry-content img { border-radius: var(--radius-sm); }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.6em; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.96rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 0.6em 0.8em; text-align: left; }
.entry-content th { background: var(--paper-warm); }

/* видео из Rutube и YouTube вставлены с жёсткими width/height — тянем по месту */
.entry-content iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius-sm);
    margin: 1.8em 0;
    background: var(--paper-warm);
}

/* остатки вордпресс-разметки в старых записях */
.entry-content .wp-block-embed__wrapper { margin: 0; }
.entry-content .alignwide, .entry-content .alignfull { max-width: 100%; }
.entry-content .has-extra-large-font-size { font-size: 1.35rem; line-height: 1.5; }

/* --------------------------------------------------- навигация по записям */
.post-nav {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 3rem 0 0;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}
.post-nav__link {
    display: block;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--card);
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.post-nav__link:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.post-nav__link--next { text-align: right; }
.post-nav__label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }
.post-nav__title { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }

/* ------------------------------------------------------------- пагинация */
.pagination-wrapper { margin: 3rem 0 4rem; }
.pagination-wrapper .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
}
.pagination-wrapper .page-numbers {
    display: grid;
    place-items: center;
    min-width: 2.4rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: 0.92rem;
    text-decoration: none;
    color: var(--ink-soft);
}
.pagination-wrapper a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination-wrapper .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pagination-wrapper .page-numbers.dots { border: none; background: none; }

/* ------------------------------------------------------------ комментарии */
.comments-wrapper { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

.comment-reply-title { font-size: 1.5rem; margin: 0 0 1.5rem; }

.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list > li { margin-bottom: 1.6rem; }
.comment-list .children { margin: 1.2rem 0 0 1.2rem; padding-left: 1.2rem; border-left: 2px solid var(--line-soft); }

.comment-body {
    padding: 1.1rem 1.3rem;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.8rem; margin-bottom: 0.5rem; }
.comment-author-name { font-weight: 600; }
.comment-metadata time { font-size: 0.85rem; color: var(--muted); }
.comment-content { color: var(--ink-soft); }
.comment-content p { margin: 0 0 0.7em; }
.comment-reply { margin-top: 0.6rem; }
.comment-reply-link { font-size: 0.88rem; color: var(--accent); text-decoration: none; }
.comment-reply-link:hover { text-decoration: underline; }

.comment-respond { margin-top: 2.5rem; }
.comment-form p { margin: 0 0 1.2rem; }
.comment-form label { display: block; font-size: 0.92rem; font-weight: 500; margin-bottom: 0.4rem; }
.comment-form label .note, .comment-form label .required { font-weight: 400; color: var(--muted); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea,
.search-form input[type="search"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
}
.comment-form textarea { resize: vertical; min-height: 9rem; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); }

.comment-form .submit {
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent); }

.comment-reply-to { font-size: 0.9rem; color: var(--muted); }
.comment-reply-to .cancel-reply {
    background: none; border: none; padding: 0;
    color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline;
}

.comment-flash {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.comment-flash--ok    { background: #edf7f0; border: 1px solid #b8ddc6; color: #1d5233; }
.comment-flash--error { background: var(--accent-soft); border: 1px solid #e8b7a8; color: var(--accent-dark); }

.comments-closed { color: var(--muted); font-size: 0.95rem; }

/* поле-ловушка для ботов: не display:none — так его заполняют охотнее */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.search-form { display: flex; gap: 0.6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.search-form input[type="search"] { flex: 1 1 14rem; width: auto; }

/* ------------------------------------------------------------------ подвал */
.site-footer {
    margin-top: clamp(3rem, 2rem + 3vw, 5rem);
    padding-block: clamp(2.2rem, 1.8rem + 2vw, 3.4rem);
    background: var(--ink);
    color: #d8d5cd;
}
.site-footer a { color: #f2efe8; text-decoration-color: rgba(242, 239, 232, .35); }
.site-footer a:hover { color: #fff; text-decoration-color: currentColor; }
.site-footer .muted { color: #9a978f; }

.site-footer__inner {
    display: grid;
    gap: clamp(1.4rem, 1rem + 1.6vw, 2.6rem);
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
}
.site-footer__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.8rem;
}
.site-footer p { font-size: 0.92rem; }
.site-footer .link-list { font-size: 0.92rem; }
.site-footer .post-count { color: #8b887f; }

.post-count { color: var(--muted); font-size: 0.85em; }

/* ------------------------------------------------------------------ адаптив */
@media (max-width: 1000px) {
    .calendar-layout { grid-template-columns: 1fr; }
    .home-events__grid { grid-template-columns: 1fr; }
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }

    .site-header__inner { flex-wrap: wrap; row-gap: 0; }

    .site-nav {
        display: none;
        order: 3;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        padding: 0.8rem 0 1.2rem;
        border-top: 1px solid var(--line-soft);
        margin-top: 0.7rem;
    }
    body.nav-open .site-nav { display: flex; }

    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-list li + li { border-top: 1px solid var(--line-soft); }
    .nav-list a { display: block; padding: 0.75rem 0.2rem; font-size: 1rem; }
    .nav-list a[aria-current="page"]::after { left: -0.6rem; right: auto; top: 0.9rem; bottom: 0.9rem; width: 3px; height: auto; }

    .search-mini input, .search-mini input:focus { width: 100%; flex: 1; }
    .search-mini { width: 100%; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }

    .brand__tagline { display: none; }

    .event-card { grid-template-columns: 60px 1fr; gap: 0.9rem; padding: 1rem; }
    .event-card__day { font-size: 1.4rem; }
    .event-card__month { font-size: 0.72rem; }
    .event-card__year { display: none; }

    .calendar__day { font-size: 0.85rem; }
    .calendar__grid { gap: 2px; }

    .post-nav__link--next { text-align: left; }

    .site-footer__inner { grid-template-columns: 1fr; }

    .entry-content { font-size: 1.03rem; }
}

/* -------------------------------------------------------------- деликатность */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

@media print {
    .site-header, .site-footer, .post-nav, .comments-wrapper, .calendar, .nav-toggle { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .page-head { background: none; border: none; padding-block: 0 1rem; }
    a { text-decoration: none; color: #000; }
}
