/* ЭКОМАРКА — общий стиль «лёгких» страниц: статья блога (article.php),
   городская страница (city.php), 404 (404.php).
   Чистый собственный CSS на СЕМАНТИЧЕСКИЕ теги, которые отдаёт Parsedown,
   чтобы любая новая статья оформлялась автоматически без ручной разметки.
   Подключается последним в inc/_header.php (после tilda-grid и шрифта). */

:root {
  --eco-primary: #1a7f64;
  --eco-primary-dark: #156b54;
  --eco-primary-light: #e8f5f1;
  --eco-accent: #ff6b35;
  --eco-text: #2d3436;
  --eco-text-soft: #52616b;
  --eco-muted: #8a949b;
  --eco-bg: #ffffff;
  --eco-bg-soft: #f6f8f7;
  --eco-border: #e6eae8;
  --eco-col: 760px;        /* ширина текстовой колонки */
}

* { box-sizing: border-box; }

body.t-body {
  margin: 0;
  font-family: 'TildaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--eco-text);
  background: var(--eco-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====== ШАПКА ====== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--eco-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.site-header__logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .5px;
  color: var(--eco-accent);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__logo span { color: var(--eco-primary); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
}
.site-nav a {
  color: var(--eco-text-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color .2s;
}
.site-nav a:hover { color: var(--eco-primary); }
.site-header__phone {
  color: var(--eco-primary);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header__phone:hover { color: var(--eco-accent); }

/* ====== ОСНОВНАЯ КОЛОНКА ====== */
main.t-container { flex: 1 0 auto; }
main.article-page,
main.city-page {
  max-width: var(--eco-col);
  margin: 0 auto;
  padding: 48px 20px 64px;
}

/* Заголовок статьи / лид / дата */
.article-page h1,
.city-page h1 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--eco-text);
  margin: 0 0 16px;
}
.lead {
  font-size: 21px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--eco-text-soft);
  margin: 0 0 18px;
}
.article-date {
  display: inline-block;
  font-size: 14px;
  color: var(--eco-muted);
  margin: 0 0 28px;
}

/* ====== ТИПОГРАФИКА ТЕЛА: семантические теги Parsedown ====== */
.article-body { font-size: 18px; line-height: 1.8; color: var(--eco-text); }

.article-body h2 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--eco-text);
  margin: 42px 0 14px;
}
.article-body h3 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--eco-text);
  margin: 30px 0 10px;
}
.article-body h2:first-child,
.article-body h3:first-child { margin-top: 0; }

.article-body p { margin: 0 0 18px; }

.article-body a {
  color: var(--eco-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(26, 127, 100, .4);
  transition: color .2s, text-decoration-color .2s;
}
.article-body a:hover {
  color: var(--eco-primary-dark);
  text-decoration-color: var(--eco-primary);
}
.article-body strong { font-weight: 700; color: var(--eco-text); }
.article-body em { font-style: italic; }

.article-body ul,
.article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin: 0 0 8px; line-height: 1.7; }
.article-body li::marker { color: var(--eco-primary); }
.article-body ul ul, .article-body ol ol,
.article-body ul ol, .article-body ol ul { margin: 8px 0; }

.article-body blockquote {
  margin: 24px 0;
  padding: 6px 20px;
  border-left: 4px solid var(--eco-primary);
  background: var(--eco-primary-light);
  border-radius: 0 8px 8px 0;
  color: var(--eco-text-soft);
  font-style: italic;
}
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border-radius: 12px;
}

/* Таблицы (Parsedown поддерживает markdown-таблицы) */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  font-size: 16px;
  display: block;
  overflow-x: auto;           /* адаптив: скролл на узких экранах */
}
.article-body th,
.article-body td {
  border: 1px solid var(--eco-border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.article-body thead th {
  background: var(--eco-primary-light);
  color: var(--eco-primary-dark);
  font-weight: 700;
}
.article-body tbody tr:nth-child(even) { background: var(--eco-bg-soft); }

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--eco-bg-soft);
  border: 1px solid var(--eco-border);
  border-radius: 5px;
  padding: .1em .4em;
}
.article-body pre {
  background: var(--eco-bg-soft);
  border: 1px solid var(--eco-border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 22px 0;
}
.article-body pre code { background: none; border: 0; padding: 0; }
.article-body hr { border: 0; border-top: 1px solid var(--eco-border); margin: 32px 0; }

/* Доп. секция на city.php */
.areas-covered {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--eco-border);
}

/* ====== ФУТЕР ====== */
.site-footer {
  flex-shrink: 0;
  background: var(--eco-text);
  color: #cdd6d2;
  margin-top: 48px;
}
.site-footer .t-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  text-align: center;
}
.site-footer p { margin: 4px 0; font-size: 15px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ====== АДАПТИВ ====== */
@media (max-width: 600px) {
  body.t-body { font-size: 17px; }
  main.article-page,
  main.city-page { padding: 32px 18px 48px; }
  .article-page h1,
  .city-page h1 { font-size: 27px; }
  .lead { font-size: 18px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 23px; margin-top: 34px; }
  .article-body h3 { font-size: 19px; }
  .site-header__inner { flex-wrap: wrap; gap: 8px 16px; }
  .site-nav { order: 3; width: 100%; gap: 14px; font-size: 14px; }
  .site-header__phone { font-size: 16px; }
}

/* ============================================================
   ОФОРМЛЕННЫЕ БЛОКИ-ВРЕЗКИ
   Директивы ::: в Markdown разворачиваются в эти блоки (см. inc/_markdown.php).
   Типы: note | important | docs | rule | checklist | steps | cta | figure
   ============================================================ */

/* --- Врезка: note / important / docs / rule --- */
.article-callout {
  margin: 26px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--eco-primary);
  border-radius: 0 10px 10px 0;
  background: var(--eco-primary-light);
  color: var(--eco-text);
}
.article-callout > :last-child { margin-bottom: 0; }
.article-callout__title {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 17px;
  color: var(--eco-primary-dark);
}
.article-callout p { margin: 0 0 10px; }
.article-callout ul, .article-callout ol { margin: 0 0 10px; }

.article-callout--note { background: var(--eco-bg-soft); border-left-color: var(--eco-muted); }
.article-callout--note .article-callout__title { color: var(--eco-text); }

.article-callout--docs { background: var(--eco-primary-light); border-left-color: var(--eco-primary); }

.article-callout--important { background: #fff7ed; border-left-color: var(--eco-accent); }
.article-callout--important .article-callout__title { color: #c2410c; }

.article-callout--rule {
  background: linear-gradient(135deg, #eef8f4 0%, #e8f5f1 100%);
  border: 1px solid #cbe7dd;
  border-left: 4px solid var(--eco-primary);
}
.article-callout--rule .article-callout__title { color: var(--eco-primary-dark); }

/* --- Чеклист: зелёные галочки на семантическом списке --- */
.article-checklist {
  margin: 26px 0;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--eco-border);
  border-radius: 12px;
}
.article-checklist > :last-child { margin-bottom: 0; }
.article-checklist .article-callout__title { margin: 0 0 12px; font-weight: 800; font-size: 17px; color: var(--eco-primary-dark); }
.article-checklist ul { list-style: none; margin: 0; padding: 0; }
.article-checklist li { position: relative; padding-left: 32px; margin: 0 0 10px; line-height: 1.6; }
.article-checklist li::before {
  content: "";
  position: absolute;
  left: 6px; top: 4px;
  width: 7px; height: 13px;
  border: solid var(--eco-primary);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* --- Пошаговый блок: нумерованный таймлайн из заголовков h3 --- */
.article-steps {
  counter-reset: step;
  position: relative;
  margin: 28px 0;
  padding-left: 56px;
}
.article-steps::before {
  content: "";
  position: absolute;
  left: 17px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--eco-border);
}
.article-steps > h3 { position: relative; margin: 0 0 6px; font-size: 19px; }
.article-steps > h3:not(:first-child) { margin-top: 26px; }
.article-steps > h3::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -56px; top: -4px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--eco-primary);
  color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.article-steps > :last-child { margin-bottom: 0; }

/* --- Слот/картинка между разделами --- */
.article-figure { margin: 28px 0; }
.article-figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
.article-figure figcaption { margin-top: 8px; font-size: 14px; color: var(--eco-muted); text-align: center; }
.article-figure--placeholder .article-figure__slot {
  min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--eco-border);
  border-radius: 12px;
  background: var(--eco-bg-soft);
  color: var(--eco-muted);
  padding: 24px;
  text-align: center;
}
.article-figure__label { font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; color: var(--eco-primary); }
.article-figure__cap { font-size: 14px; }

/* --- Финальный CTA-блок с кнопками --- */
.article-cta {
  margin: 36px 0 8px;
  padding: 28px 26px;
  background: linear-gradient(135deg, var(--eco-primary-light) 0%, #dff0ea 100%);
  border: 1px solid #cbe7dd;
  border-radius: 16px;
  text-align: center;
}
.article-cta__title { margin: 0 0 10px; font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--eco-text); }
.article-cta__body p { margin: 0 0 18px; color: var(--eco-text-soft); }
.article-cta__body > :last-child { margin-bottom: 0; }
.article-cta a {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 6px 6px 0;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 700; font-size: 16px;
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.article-cta a:first-of-type { background: var(--eco-primary); color: #fff; border: 2px solid var(--eco-primary); }
.article-cta a:first-of-type:hover { background: var(--eco-primary-dark); border-color: var(--eco-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,127,100,.25); }
.article-cta a:not(:first-of-type) { background: #fff; color: var(--eco-primary); border: 2px solid var(--eco-primary); }
.article-cta a:not(:first-of-type):hover { background: var(--eco-primary); color: #fff; }

/* --- Адаптив блоков --- */
@media (max-width: 600px) {
  .article-callout, .article-checklist { padding: 16px 16px; }
  .article-cta { padding: 22px 18px; }
  .article-cta__title { font-size: 19px; }
  .article-cta a { display: flex; width: 100%; margin: 8px 0 0; }
  .article-steps { padding-left: 48px; }
  .article-steps > h3::before { left: -48px; width: 32px; height: 32px; font-size: 15px; }
  .article-steps::before { left: 15px; }
}
