/* ================= Статьи и новости (18.11.2026) =================
   Публичные /stati, /novosti и чтение в кабинете (/app/news). Цвета — из общих переменных сайта и кабинета
   (--text, --line, --accent…), поэтому работает в светлой и тёмной теме и там, и там. */

.blog { max-width: 1120px; margin: 0 auto; padding: 18px 24px 64px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--text-3); margin: 6px 0 18px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.blog-head { margin-bottom: 28px; }
.blog-head h1 { margin: 0 0 10px; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; }
.blog-head > p { margin: 0; max-width: 640px; font-size: 18px; line-height: 1.5; color: var(--text-2); }
.blog-tabs { display: flex; gap: 6px; margin-top: 20px; }
.blog-tabs a { height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; background: var(--bg); }
.blog-tabs a[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; overflow: hidden; background: var(--bg); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.post-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 16px 34px -22px rgba(0, 0, 0, .35); transform: translateY(-2px); }
.post-card.lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.pc-img { display: block; aspect-ratio: 1200 / 630; background: color-mix(in srgb, var(--text) 6%, var(--bg)); overflow: hidden; }
.post-card.lead .pc-img { aspect-ratio: auto; min-height: 100%; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }
.pc-ph .i { width: 40px; height: 40px; }
.pc-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.post-card.lead .pc-body { padding: 32px 34px; justify-content: center; }
.pc-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-3); }
.pc-pin { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; }
.post-card h2, .post-card h3 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; }
.post-card.lead h2 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.03em; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card:hover h2 a, .post-card:hover h3 a { color: var(--accent); }
.pc-ex { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card.lead .pc-ex { font-size: 16.5px; -webkit-line-clamp: 4; }

.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 30px 0 0; font-size: 15px; color: var(--text-2); }
.pager a { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.blog-empty { padding: 40px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--text-2); }
.blog-empty a { color: var(--accent); }

.blog-cta { margin: 44px 0 0; display: flex; align-items: center; gap: 24px; padding: 28px 32px; border-radius: 20px; background: var(--text); color: var(--bg); }
.blog-cta h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; color: inherit; }
.blog-cta p { margin: 0; opacity: .78; font-size: 15.5px; line-height: 1.5; }
.blog-cta div { flex: 1; }
.blog-cta .btn { flex: none; }

/* --- статья --- */
.post { max-width: 1120px; }
.post-head { max-width: 780px; }
.post-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.post-head h1 { margin: 0 0 14px; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -.04em; font-weight: 700; }
.post-lead { margin: 0 0 14px; font-size: 19px; line-height: 1.55; color: var(--text-2); }
.post-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--text-3); }
.post-cover { margin: 26px 0 30px; border-radius: 20px; overflow: hidden; aspect-ratio: 1200 / 630; background: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-layout { display: block; }
.post-layout.has-toc { display: grid; grid-template-columns: 240px minmax(0, 780px); gap: 48px; align-items: start; }
.post-toc { position: sticky; top: 24px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); font-size: 14px; background: var(--bg); }
.post-toc b { display: block; margin-bottom: 8px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.post-toc ol { margin: 0; padding: 0 0 0 18px; display: grid; gap: 7px; }
.post-toc a { color: var(--text-2); text-decoration: none; line-height: 1.35; }
.post-toc a:hover { color: var(--accent); }

.post-body { max-width: 780px; font-size: 18px; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.05em; }
.post-body h2 { margin: 1.9em 0 .55em; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; scroll-margin-top: 20px; }
.post-body h3 { margin: 1.5em 0 .45em; font-size: 21px; line-height: 1.3; letter-spacing: -.015em; scroll-margin-top: 20px; }
.post-body h4 { margin: 1.3em 0 .4em; font-size: 18px; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body ul, .post-body ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.post-body li { margin: .3em 0; }
.post-body li::marker { color: var(--accent); }
.post-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--text-2); font-size: 19px; }
.post-body figure { margin: 1.6em 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 14px; display: block; }
.post-body figcaption { margin-top: 8px; font-size: 14.5px; color: var(--text-3); text-align: center; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 16px; display: block; overflow-x: auto; }
.post-body th, .post-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body th { background: color-mix(in srgb, var(--text) 5%, var(--bg)); }
.post-body code { padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--text) 7%, var(--bg)); font-size: .9em; }
.post-body mark { background: color-mix(in srgb, #ffd54a 55%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.post-note { margin: 1.5em 0; padding: 18px 20px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size: 17px; }
.post-note > :last-child { margin-bottom: 0; }
.post-body a.post-btn, .pe-body a.post-btn { display: inline-flex; align-items: center; height: 50px; padding: 0 24px; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 16.5px; text-decoration: none; margin: .4em 0; }
.post-body a.post-btn:hover { background: var(--accent-hover, var(--accent)); }

.post-foot { max-width: 780px; margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.post-layout.has-toc + .post-foot { margin-left: 288px; }
.post-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14.5px; color: var(--text-2); }
.post-share a, .post-share button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); text-decoration: none; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.post-share a:hover, .post-share button:hover { border-color: var(--accent); color: var(--accent); }
.post-related { margin-top: 48px; }
.post-related > h2 { margin: 0 0 18px; font-size: 26px; letter-spacing: -.03em; }
.post-admin-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin: 6px 0 4px; border-radius: 12px; background: #fff4d6; color: #5c4300; font-size: 14.5px; }
.post-admin-bar span { flex: 1; }

@media (max-width: 1000px) {
  .post-layout.has-toc { display: block; }
  .post-toc { position: static; margin-bottom: 26px; }
  .post-layout.has-toc + .post-foot { margin-left: 0; }
  .post-grid, .post-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .blog { padding: 10px 16px 48px; }
  .post-grid, .post-grid.three { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .post-card.lead { display: flex; }
  .post-card.lead .pc-img { aspect-ratio: 1200 / 630; }
  .post-card.lead .pc-body { padding: 18px 20px 22px; }
  .blog-head > p { font-size: 16.5px; }
  .post-lead { font-size: 17px; }
  .post-body { font-size: 17px; line-height: 1.65; }
  .post-body h2 { font-size: 23px; }
  .post-body h3 { font-size: 19px; }
  .post-cover { margin: 18px -16px 22px; border-radius: 0; }
  .blog-cta { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .blog-cta .btn { width: 100%; justify-content: center; }
}

/* --- кабинет: «Новости и статьи» --- */
.news-page { max-width: 980px; display: grid; gap: 18px; }
.news-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.news-bar form { margin: 0 0 0 auto; }
.news-list { display: grid; gap: 12px; }
.news-item { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 14px; border-radius: 16px; background: var(--bg);
  border: 1px solid var(--line); transition: border-color .15s; }
.news-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.news-item.new { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg)); }
.ni-img { border-radius: 11px; overflow: hidden; aspect-ratio: 1200 / 630; background: var(--bg-input); }
.ni-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ni-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 4px 4px 4px 0; }
.ni-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); }
.ni-new { display: inline-flex; height: 21px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
.ni-kind { font-weight: 600; color: var(--text-2); }
.ni-t h2 { margin: 0; font: 700 18px/1.3 Arial, "Helvetica Neue", Helvetica, sans-serif; letter-spacing: -.01em; }
.ni-t h2 a { color: var(--text); text-decoration: none; }
.ni-t h2 a::after { content: ""; position: absolute; inset: 0; }
.news-item:hover h2 a { color: var(--accent); }
.ni-t p:not(.ni-meta) { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-read { max-width: 1120px; }
.news-read .post-head h1 { font-size: clamp(26px, 3.4vw, 40px); }
.news-read .post-cover { margin: 20px 0 26px; }
.news-read-foot { max-width: 780px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 700px) {
  .news-item { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .ni-img { aspect-ratio: 1; }
  .ni-t h2 { font-size: 16px; }
  .ni-t p:not(.ni-meta) { -webkit-line-clamp: 2; font-size: 14px; }
  .news-read .post-cover { margin: 14px 0 18px; border-radius: 14px; }
}
.post-admin-bar a:not(.btn) { color: #7a2e00; }
/* 20.11.2026: в тёмной теме фирменный цвет светлеет — кнопка в статье берёт «кнопочный» вариант, белый текст читается */
.post-body a.post-btn, .pe-body a.post-btn { background: var(--ac-btn, var(--accent)); }
.post-body a.post-btn:hover, .pe-body a.post-btn:hover { background: var(--ac-btn-hover, var(--accent-hover, var(--accent))); }
