/* comments.css — стили виджета комментариев. */
.cmts-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 14px;
  color: #fff;
}
.cmts-list { display: flex; flex-direction: column; gap: 10px; }
.cmts-empty {
  color: #64748b; font-size: .9rem; padding: 16px 0;
  text-align: center;
}
.cmt {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 11px 14px;
}
.cmt-meta { font-size: .82rem; color: #8891aa; margin-bottom: 6px; }
.cmt-meta b { color: #e8eaf0; }
.cmt-admin {
  font-size: .68rem; background: rgba(99, 102, 241, .2); color: #a5b4fc;
  padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.cmt-date { color: #64748b; margin-left: 10px; }
.cmt-body {
  color: #e8eaf0; font-size: .92rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.cmt-actions {
  margin-top: 6px; display: flex; gap: 12px; font-size: .76rem;
}
.cmt-actions a { color: #64748b; text-decoration: none; }
.cmt-actions a:hover { color: #f87171; text-decoration: underline; }

.cmt-form { margin-top: 16px; }
.cmt-input {
  width: 100%; box-sizing: border-box;
  background: rgba(0, 0, 0, .35);
  border: 1.5px solid rgba(255, 255, 255, .10);
  border-radius: 12px; padding: 11px 14px;
  color: #fff; font-size: .92rem; font-family: inherit;
  resize: vertical; outline: none; min-height: 76px;
}
.cmt-input:focus { border-color: #60a5fa; }
.cmt-btn {
  margin-top: 8px;
  padding: 10px 22px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-weight: 600; font-size: .9rem;
  cursor: pointer;
}
.cmt-btn:disabled { opacity: .5; cursor: not-allowed; }
.cmt-err { color: #f87171; font-size: .82rem; margin-top: 6px; min-height: 1em; }
.cmts-locked {
  background: rgba(255, 255, 255, .03);
  border: 1px dashed rgba(255, 255, 255, .10);
  border-radius: 12px; padding: 14px;
  text-align: center; color: #8891aa; font-size: .9rem;
  margin-top: 14px;
}
.cmts-locked a { color: #60a5fa; }

.cmt-asname {
  color: #64748b; font-size: .78rem; margin: 6px 0;
}
.cmt-asname b { color: #cbd5e1; font-weight: 600; }
.cmt-asname a { color: #60a5fa; text-decoration: none; margin-left: 4px; }
.cmt-asname a:hover { text-decoration: underline; }

/* Модалка «Как вас называть?» ------------------------------------------- */
.cmt-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 16px;
  animation: cmtFadeIn .15s ease-out;
}
@keyframes cmtFadeIn { from { opacity: 0 } to { opacity: 1 } }
.cmt-modal {
  background: linear-gradient(180deg, #1a1f2e, #131724);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 24px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  animation: cmtSlideUp .2s ease-out;
}
@keyframes cmtSlideUp { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
.cmt-modal-title {
  margin: 0 0 8px; font-size: 1.15rem; color: #fff; font-weight: 700;
}
.cmt-modal-hint {
  margin: 0 0 16px; color: #8891aa; font-size: .85rem; line-height: 1.45;
}
.cmt-modal-input {
  width: 100%; box-sizing: border-box;
  background: rgba(0, 0, 0, .35);
  border: 1.5px solid rgba(255, 255, 255, .10);
  border-radius: 10px; padding: 11px 14px;
  color: #fff; font-size: .95rem; font-family: inherit;
  outline: none;
}
.cmt-modal-input:focus { border-color: #60a5fa; }
.cmt-modal-err {
  color: #f87171; font-size: .8rem; margin-top: 6px; min-height: 1em;
}
.cmt-modal-buttons {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
}
.cmt-modal-cancel, .cmt-modal-save {
  padding: 10px 18px; border: 0; border-radius: 10px;
  font-weight: 600; font-size: .9rem; font-family: inherit;
  cursor: pointer;
}
.cmt-modal-cancel {
  background: rgba(255, 255, 255, .06); color: #cbd5e1;
}
.cmt-modal-cancel:hover { background: rgba(255, 255, 255, .10); }
.cmt-modal-save {
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
}
.cmt-modal-save:disabled { opacity: .5; cursor: not-allowed; }


/* ======= LIGHT THEME (data-theme=stu) overrides ======= */
[data-theme="stu"] .cmts-title{color:#14233b}
[data-theme="stu"] .cmts-empty{color:#6b7d97}
[data-theme="stu"] .cmt{background:#ffffff;border:1px solid #d7e6f7}
[data-theme="stu"] .cmt-meta{color:#6b7d97}
[data-theme="stu"] .cmt-meta b{color:#14233b}
[data-theme="stu"] .cmt-admin{background:var(--accent-soft,rgba(47,111,224,.10));color:var(--accent-strong,#2560c8)} /* kp-20260926-212: был #a5b4fc на белом, 1.99:1 */
[data-theme="stu"] .cmt-date{color:#6b7d97}
[data-theme="stu"] .cmt-body{color:#14233b}
[data-theme="stu"] .cmt-actions a{color:#6b7d97}
[data-theme="stu"] .cmt-actions a:hover{color:#dc2626}
[data-theme="stu"] .cmt-form .cmt-input{background:#fff;border-color:#d7e6f7;color:#14233b}
[data-theme="stu"] .cmt-form .cmt-input:focus{border-color:#2f80ed}
[data-theme="stu"] .cmt-form .cmt-input::placeholder{color:#9aafcc}
[data-theme="stu"] .cmts-locked{background:#f3f8ff;border-color:#d7e6f7;color:#6b7d97}
[data-theme="stu"] .cmts-locked a{color:#2f80ed}
[data-theme="stu"] .cmt-asname{color:#6b7d97}
[data-theme="stu"] .cmt-asname b{color:#3a4d6b}
[data-theme="stu"] .cmt-asname a{color:#2f80ed}
[data-theme="stu"] .cmt-modal{background:#ffffff;border-color:#d7e6f7}
[data-theme="stu"] .cmt-modal-title{color:#14233b}
[data-theme="stu"] .cmt-modal-hint{color:#6b7d97}
[data-theme="stu"] .cmt-modal-input{background:#fff;border-color:#d7e6f7;color:#14233b}
[data-theme="stu"] .cmt-modal-input:focus{border-color:#2f80ed}
[data-theme="stu"] .cmt-modal-input::placeholder{color:#9aafcc}
[data-theme="stu"] .cmt-modal-cancel{background:rgba(20,35,59,.06);color:#3a4d6b}
[data-theme="stu"] .cmt-modal-cancel:hover{background:rgba(20,35,59,.10)}
/* kp-20261019-269/271 (theme-parity 19.10): #6b7d97 на --bg #e5edfa давал 3.56, ссылка #2f80ed 3.28,
   рамка поля 1.18 к белому. Текст -> var(--muted) (5.2:1 на --bg), ссылки -> var(--accent) (5.0:1), рамка поля -> #7a8ea9 (3.4:1; токена под рамку поля нет). Токены вместо литералов: kp-20261020-150. */
[data-theme="stu"] .cmt-asname,[data-theme="stu"] .cmt-meta,[data-theme="stu"] .cmt-date,
[data-theme="stu"] .cmt-actions a,[data-theme="stu"] .cmt-modal-hint{color:var(--muted)}
[data-theme="stu"] .cmt-asname a{color:var(--accent)}
/* kp-20261019-273: «изменить» в строке «как <имя> · изменить» - ссылка в тексте, цвет от --muted отличается на 1.05:1 (axe link-in-text-block): отличаем подчеркиванием. */
[data-theme="stu"] .cmt-asname a{text-decoration:underline;text-underline-offset:2px}
[data-theme="stu"] .cmt-form .cmt-input,[data-theme="stu"] .cmt-modal-input{border-color:#7a8ea9}

/* === fix: mobile .feature-art overflow ==========================================
   На mobile (<=540px) .feature становится flex-column; .feature-art=80x80px,
   но .paper-art=88x106px — переполняет контейнер и drop-shadow темнит область. */
@media (max-width:540px){
  .paper-art{width:66px;height:76px;padding:9px 8px;gap:4px}
  .paper-art .tip{display:none}
  .feature-art{filter:drop-shadow(0 3px 8px rgba(0,0,0,.22))}
}
/* === fix: чипы .pill на /m/ в СВЕТЛОЙ теме (аудит 2026-08-11) ====================
   .pill и .pill.cat лежат в инлайновом <style> каждой /m/-страницы (813 файлов) и
   захардкожены под тёмную тему: категория даёт #BFDBFE на светлом фоне (контраст ~1.6:1),
   дата — тёмный текст на rgba(0,0,0,.5). В светлой теме оба нечитаемы.
   Правим здесь, а не в 813 html: comments.css — единственный CSS, который грузят ВСЕ
   страницы с .pill (tokens.css есть только у 758). Цвета хардкодом, как в блоках
   .cmt-modal выше: у части старых /m/ (aesop-*) токенов темы на странице нет. */
[data-theme="stu"] .pill{background:rgba(20,35,59,.06);border-color:#c2d8f0;color:#3a4d6b}
[data-theme="stu"] .pill.cat{background:rgba(47,128,237,.12);border-color:rgba(47,128,237,.38);color:#164c9d}

/* === fix: заголовок под обложкой /m/ (kp-20261008-49) =========================
   На обложках уже есть текст: затемнение не спасает от наложения букв.
   Общий CSS применяется и к старым статическим страницам, и к новым выпускам.
   html усиливает селектор против более позднего светлого инлайна шаблона. */
.hero:not(.no-img) > .hero-meta{position:static;background:var(--surface)}
.hero:not(.no-img) .hero-vignette{display:none}
html .hero:not(.no-img) > .hero-meta > .hero-title{color:var(--text);text-shadow:none}
.hero:not(.no-img) .hero-pills .pill{background:var(--surface-2);border-color:var(--line-2);color:var(--text-2);backdrop-filter:none;-webkit-backdrop-filter:none}
.hero:not(.no-img) .hero-pills .pill.cat{color:var(--text)}
/* === fix: заголовок .hero-title без обложки в светлой теме (kp-20260926-208) =====
   Шаблон новых /m/-лендингов (с 17.08.2026) держит в инлайне .hero-title{color:#fff} и,
   в отличие от старого, не вшивает светлый блок [data-theme=stu] .hero-title{color:var(--text)}.
   .hero.no-img в светлой теме заливается var(--surface) = белый, и название выпуска
   пропадало (белое на белом). */
[data-theme="stu"] .hero.no-img .hero-title{color:var(--text)}
/* === fix: контраст текста на /m/ по axe (аудит 2026-08-11) =======================
   Все цвета посчитаны на реальных фонах страницы и дают >=5:1 при пороге 4.5.
   Было -> стало (контраст): .fav-post-btn #f59e0b 1.82 -> #8a5200 5.42;
   киккер «Читаем рассказ» #c26a24 3.65 -> #8a4a10 6.42; киккер «Упражнения»
   #1f8a5f 4.05 -> #15694a 6.25; .cmts-empty/.cmts-locked #6b7d97 3.56 -> #4d5d75 5.68;
   ссылка «войдите в аккаунт» #2f80ed 3.62 -> #1b5fc4 5.65; .age-rating #8891aa 3.90
   -> #aab4c9 5.89 (плашка тёмная в обеих темах, поэтому без префикса темы).
   В ТЁМНОЙ теме те же элементы уже проходили, кроме .cmts-empty (4.04) — ей отдельная строка.
   link-in-text-block: mailto-ссылка в тексте отличалась только цветом (1.05:1 к соседнему
   тексту) — добавлено подчёркивание, это требование «не полагаться на цвет». */
[data-theme="stu"] .fav-post-btn{color:#8a5200!important;border-color:#8a5200!important}
[data-theme="stu"] .cmts-empty,[data-theme="stu"] .cmts-locked{color:#4d5d75}
[data-theme="stu"] .cmts-locked a{color:#1b5fc4}
[data-theme="dop"] .cmts-empty,[data-theme="dop"] .cmts-locked{color:#8496b0}
.age-rating{color:#aab4c9!important}
.wrap a[href^="mailto:"],.cmts-locked a{text-decoration:underline}
/* === fix: шапка материала стала <nav> (axe region, аудит 2026-08-11) =============
   serve.php меняет <header class="hdr" id="hdr"> на <nav class="hdr" id="hdr">, чтобы
   «← Все материалы» + лого лежали в настоящем лендмарке navigation, а не вне лендмарков.
   Вся вёрстка держится на классе .hdr и переезд тега не замечает — КРОМЕ одного правила
   во встроенном <style> самих /m/.html: [data-theme="stu"] header{background:...!important},
   которое красило светлую шапку по ИМЕНИ тега. Повторяем ту же заливку для nav.hdr:
   специфичность 0,2,1 против 0,1,1 у исходного правила, поэтому порядок файлов не важен. */
[data-theme="stu"] nav.hdr{background:linear-gradient(135deg,#ffffff,#eef5ff)!important}

/* === fix: тач-таргеты и кегль на мобильных /m/ (аудит 2026-09-06) ================
   Общий override для существующих статических /m/-страниц: сами HTML не
   перегенерируются, а comments.css грузят все страницы и он идёт ПОСЛЕ их
   инлайнового <style>. Кнопка «<- Все материалы» и иконки соцсетей в футере
   дорастают до 44px тач-таргета, мелкие подписи (.pill, .h2, .feature-kicker)
   получают кегль 12px. */
@media (max-width:480px){
  .hdr .back{min-height:44px}
  .footer-soc a{width:44px;height:44px}
  .pill,.h2,.feature-kicker{font-size:12px}
}
