/* Scribi Blog — статьи и каталог. Подключается ПОСЛЕ ../styles.css. */

/* ===== Reading progress bar ===== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--amber);
  z-index: 100;
  transition: width 0.1s ease;
}

/* ===== Blog header (compact, для статей и каталога) ===== */
.blog-header {
  background: var(--cream);
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(250, 246, 238, 0.92);
}
.blog-header .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.blog-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.blog-header .brand-mark { width: 36px; }
.blog-header .nav { display: flex; gap: 22px; font-size: 15px; }
.blog-header .nav a { color: var(--ink-soft); }
.blog-header .nav a:hover { color: var(--amber); }
@media (max-width: 700px) {
  .blog-header .nav { display: none; }
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  padding: 22px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); border-bottom: 1px dashed transparent; }
.breadcrumb a:hover { color: var(--amber); border-color: var(--amber-soft); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb span:last-child { color: var(--ink); }

/* ===== Blog index — hero ===== */
.blog-hero {
  padding: 50px 0 30px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}
.blog-hero h1 {
  font-size: clamp(38px, 4.8vw, 60px);
  margin-bottom: 14px;
}
.blog-hero p.lead {
  max-width: 720px;
  margin: 0 0 0;
}

/* ===== Rubrics nav ===== */
.rubrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.rubric-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.rubric-pill:hover {
  border-color: var(--amber);
  color: var(--ink);
  transform: translateY(-1px);
}
.rubric-pill.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.rubric-pill .icon { font-size: 14px; }

/* ===== Article cards grid ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 36px 0 80px;
}
@media (max-width: 1000px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .articles-grid { grid-template-columns: 1fr; } }

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--rule);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: var(--ink);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.article-card .card-image {
  background: var(--cream-warm);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.article-card .card-image img {
  max-height: 80%;
  max-width: 70%;
  object-fit: contain;
}
.article-card .card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.article-card .card-rubric {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}
.article-card h2 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}
.article-card .card-excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}
.article-card .card-meta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
}
.article-card .card-meta .read-time::before { content: "⏱ "; opacity: 0.6; }

/* ===== Article page ===== */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
}
.article-meta-top {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0 18px;
  font-size: 14px;
  color: var(--muted);
}
.article-rubric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cream-warm);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-rubric.amber { background: var(--amber); color: var(--ink); }

.article-title {
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 700;
  margin: 6px 0 18px;
  line-height: 1.05;
}
.article-lead {
  font-size: 21px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 30px;
}

/* ===== TOC ===== */
.article-toc {
  background: var(--cream-warm);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 28px 0 36px;
  border: 1px solid var(--rule);
}
.article-toc h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-body);
}
.article-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.article-toc li {
  counter-increment: toc;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
}
.article-toc li:last-child { border-bottom: none; }
.article-toc li::before {
  content: counter(toc, decimal-leading-zero);
  display: inline-block;
  width: 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  font-weight: 600;
}
.article-toc a {
  color: var(--ink-soft);
  font-size: 16px;
  border-bottom: none;
}
.article-toc a:hover { color: var(--amber); }
.article-toc li.active a { color: var(--ink); font-weight: 600; }
.article-toc li.active::before { color: var(--ink); }

/* ===== Article body ===== */
.article-body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  margin: 56px 0 16px;
  scroll-margin-top: 80px;
  color: var(--ink);
}
.article-body h2:first-child { margin-top: 8px; }
.article-body h3 {
  font-size: 22px;
  margin: 36px 0 12px;
  color: var(--ink);
}
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.article-body li { margin: 6px 0; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body a {
  color: var(--ink);
  border-bottom: 1.5px solid var(--amber-soft);
}
.article-body a:hover { color: var(--amber); }
/* Кнопки внутри статьи не должны наследовать «текстовую» подсветку ссылок */
.article-body a.btn { border-bottom: none; }
.article-body a.btn-primary,
.article-body a.btn-primary:hover { color: var(--cream); }
.article-body a.btn-secondary { color: var(--ink); }
.article-body a.btn-secondary:hover { color: var(--cream); }
/* В .cta-inline кнопка amber-на-ink — текст ink */
.article-body .cta-inline a.btn-primary,
.article-body .cta-inline a.btn-primary:hover { color: var(--ink); }

/* ===== Callout block (Скриби говорит) ===== */
.callout {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  align-items: flex-start;
  background: var(--cream-warm);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 18px 22px 18px 18px;
  margin: 32px 0;
}
.callout img {
  width: 80px;
  height: auto;
}
.callout .callout-body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}
.callout .callout-body strong {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

/* ===== Comparison table ===== */
.compare-table {
  margin: 30px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.compare-table table { width: 100%; border-collapse: collapse; font-size: 16px; }
.compare-table th, .compare-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.compare-table th {
  background: var(--cream-warm);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .yes { color: var(--green); font-weight: 600; }
.compare-table .no  { color: #c25555; }
.compare-table .so  { color: var(--muted); }
.compare-table tr.scribi-row { background: rgba(232, 162, 58, 0.08); }
.compare-table tr.scribi-row td:first-child { font-weight: 700; color: var(--ink); }

/* ===== Inline mini-calculator ===== */
.mini-calc {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 32px 0;
}
.mini-calc h4 {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.mini-calc .calc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.mini-calc input[type="range"] {
  flex: 1;
  min-width: 200px;
  accent-color: var(--amber);
}
.mini-calc .calc-display {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  min-width: 130px;
}
.mini-calc .calc-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 600px) { .mini-calc .calc-results { grid-template-columns: 1fr; } }
.mini-calc .calc-result {
  background: rgba(250, 246, 238, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.mini-calc .calc-result .label { font-size: 12px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.mini-calc .calc-result .value { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 4px; }
.mini-calc .calc-result.win .value { color: var(--amber); }

/* ===== Quick tip box ===== */
.tip {
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}
.tip-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.tip p:last-child { margin-bottom: 0; }

/* ===== Step list (нумерованные шаги) ===== */
.steps-block {
  display: grid;
  gap: 16px;
  margin: 28px 0;
  counter-reset: step;
}
.steps-block .step-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 20px;
  counter-increment: step;
}
.steps-block .step-item::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin-top: 2px;
}
.steps-block .step-item h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
}
.steps-block .step-item p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }

/* ===== Inline CTA block ===== */
.cta-inline {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin: 40px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
}
@media (max-width: 700px) { .cta-inline { grid-template-columns: 1fr; } }
.cta-inline h3 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--cream);
}
.cta-inline p { margin: 0; color: rgba(250, 246, 238, 0.78); font-size: 15px; }
.cta-inline .btn-primary {
  background: var(--amber);
  color: var(--ink);
  white-space: nowrap;
}
.cta-inline .btn-primary:hover { background: var(--amber-soft); }

/* ===== FAQ-mini внутри статьи ===== */
.article-faq { margin: 36px 0; }
.article-faq details {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 10px;
}
.article-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 17px;
  list-style: none;
}
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after {
  content: "+";
  float: right;
  color: var(--amber);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.article-faq details[open] summary::after { content: "−"; }
.article-faq details p { margin: 14px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }

/* ===== Related articles ===== */
.related-section {
  margin: 60px 0 30px;
  padding-top: 30px;
  border-top: 1px solid var(--rule);
}
.related-section h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 18px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--amber-soft);
  color: var(--ink);
}
.related-card span.arrow { color: var(--amber); font-size: 18px; margin-left: auto; }
.related-card span.title { font-weight: 600; font-size: 16px; color: var(--ink); }

/* Богатый вариант related-card: rubric + title + desc вертикально */
.related-card:has(.desc),
.related-card:has(.rubric) {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.related-card span.rubric {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}
.related-card span.desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0.7;
}
.related-card:has(.desc) span.title { font-size: 17px; line-height: 1.3; }

/* ===== Final CTA внутри статьи ===== */
.article-final-cta {
  background: var(--cream-warm);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  margin: 50px 0 0;
  text-align: center;
}
.article-final-cta img {
  width: 120px;
  margin: 0 auto 16px;
}
.article-final-cta h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 10px;
}
.article-final-cta p { color: var(--ink-soft); margin: 0 0 22px; }

/* ===== fade-in анимация при скролле ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== Footer для блога ===== */
.blog-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 40px 0;
  margin-top: 80px;
}
.blog-footer .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.blog-footer a { color: var(--cream); border-bottom: 1px solid rgba(250, 246, 238, 0.3); }
.blog-footer a:hover { color: var(--amber); border-color: var(--amber); }
.blog-footer .footer-nav { display: flex; gap: 22px; font-size: 15px; }
.blog-footer .footer-copy { color: rgba(250, 246, 238, 0.5); font-size: 14px; }

/* ===== Quiz / decision-tree ===== */
.quiz-tree {
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin: 32px 0;
}
.quiz-tree .quiz-step { display: none; }
.quiz-tree .quiz-step.active { display: block; }
.quiz-tree .quiz-question {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 18px;
}
.quiz-tree .quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.quiz-tree .quiz-option {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.quiz-tree .quiz-option:hover {
  border-color: var(--amber);
  background: rgba(217, 144, 88, 0.06);
  transform: translateY(-1px);
}
.quiz-tree .quiz-option strong { display: block; font-weight: 600; margin-bottom: 2px; }
.quiz-tree .quiz-option small { display: block; opacity: 0.7; font-size: 13px; }
.quiz-tree .quiz-result {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.quiz-tree .quiz-result img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.quiz-tree .quiz-result-body { flex: 1; }
.quiz-tree .quiz-result-body h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
}
.quiz-tree .quiz-result-body p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; }
.quiz-tree .quiz-result .btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}
.quiz-tree .quiz-result .btn:hover { background: var(--amber); }
.quiz-tree .quiz-restart {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--ink);
  opacity: 0.6;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}
.quiz-tree .quiz-restart:hover { opacity: 1; color: var(--amber); }

/* ===== Filter-table (пилюли над сравнительной таблицей) ===== */
.filter-table .filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-table .filter-pill {
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
  user-select: none;
}
.filter-table .filter-pill:hover { border-color: var(--amber); }
.filter-table .filter-pill.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.filter-table .filter-pill[data-filter="all"] { font-weight: 600; }
.filter-table .filter-empty {
  display: none;
  padding: 20px;
  text-align: center;
  color: var(--ink);
  opacity: 0.6;
  font-style: italic;
}
.filter-table.is-empty .filter-empty { display: block; }
.filter-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.filter-table th, .filter-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.filter-table th {
  background: var(--cream-warm);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.filter-table tr:last-child td { border-bottom: none; }
.filter-table tbody tr:first-child td {
  background: rgba(232, 162, 58, 0.08);
}
.filter-table tbody tr:first-child td:first-child {
  font-weight: 700;
  color: var(--ink);
}
.filter-table small { display: block; opacity: 0.65; font-size: 12px; margin-top: 2px; }

/* Inline footnote under blocks */
.muted-note {
  margin: 8px 0 28px;
  color: var(--ink);
  opacity: 0.6;
}

/* ===== Speed-bars (наглядное сравнение времени) ===== */
.speed-bars {
  background: var(--cream-warm);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 32px 0;
}
.speed-bars h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.6;
  margin: 0 0 16px;
}
.speed-bars .speed-row { margin-bottom: 14px; }
.speed-bars .speed-row:last-child { margin-bottom: 0; }
.speed-bars .speed-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}
.speed-bars .speed-label strong { font-weight: 600; }
.speed-bars .speed-label .speed-time { font-family: var(--font-display); font-weight: 600; }
.speed-bars .speed-track {
  height: 10px;
  background: rgba(43, 47, 58, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.speed-bars .speed-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.speed-bars .speed-row.win .speed-fill { background: var(--amber); }
