/* =========================================================
   Re:МеталлАвто — стили блога/статей
   Переиспользует токены основного сайта («Галерея металла»).
   Подключается на страницах внутри /articles/.
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #f5f4f2;
  --surface-2: #ecebe7;
  --dark: #0e0e0f;
  --text: #111111;
  --muted: #6b6862;
  --accent: #8b0106;
  --accent-bright: #c0170f;
  --accent-warm: #c0170f;
  --ok: #1f7a4d;
  --line: rgba(20, 16, 14, .12);
  --line-strong: rgba(20, 16, 14, .2);
  --line-dark: rgba(255, 255, 255, .16);
  --line-dark-strong: rgba(255, 255, 255, .3);

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --t-h1: clamp(32px, 5.4vw, 64px);
  --t-h2: clamp(24px, 3.4vw, 40px);
  --t-h3: clamp(19px, 2vw, 26px);
  --t-lead: clamp(17px, 1.5vw, 21px);
  --t-body: 17px;
  --t-label: 11px;

  --rail: clamp(20px, 4vw, 52px);
  --max: 1320px;
  --gap-section: clamp(48px, 6vw, 96px);
  --pill: 9999px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 800; line-height: 1.06; letter-spacing: -.038em; }
h1 { font-size: var(--t-h1); margin-bottom: 20px; }
h2 { font-size: var(--t-h2); letter-spacing: -.032em; line-height: 1.1; margin-bottom: 18px; }
h3 { font-size: var(--t-h3); letter-spacing: -.024em; line-height: 1.16; font-weight: 700; margin-bottom: 12px; }

p { margin-bottom: 18px; }

::selection { background: var(--accent); color: #fff; }

.rail { width: min(var(--max), calc(100% - var(--rail) * 2)); margin-inline: auto; }
.accent { color: var(--accent); }

.label {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.label--accent { color: var(--accent); }

.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--muted); max-width: 62ch; }

/* ============ Кнопки ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 16px 30px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background .22s, border-color .22s, color .22s, transform .22s;
}
.btn:hover { background: var(--accent-bright); transform: translateY(-2px); }

.btn--outline-dark {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--outline-dark:hover { background: var(--text); border-color: var(--text); color: #fff; }

.btn--outline-light {
  background: transparent;
  color: #fff;
  border-color: var(--line-dark-strong);
}
.btn--outline-light:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 12px 22px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--pill);
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ============ Шапка ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 22px; }

.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { width: 50px; height: 36px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.brand-name b { color: var(--accent); }
.brand-sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 10px 16px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface); color: var(--accent); }

.header-phone { font-size: 14px; font-weight: 700; white-space: nowrap; }
.header-phone:hover { color: var(--accent); }

.header-cta { display: flex; align-items: center; gap: 12px; }

/* ============ Обложка статьи ============ */
.article-hero {
  padding: clamp(40px, 6vw, 76px) 0 clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}
.breadcrumbs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; opacity: .5; }
.article-hero h1 { max-width: 20ch; }
.article-hero .lead { max-width: 66ch; margin-bottom: 0; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============ Тело статьи ============ */
.article-body { padding: var(--gap-section) 0; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.article-layout > * { min-width: 0; }

.prose { max-width: 74ch; }
.prose h2 { margin-top: clamp(36px, 4vw, 56px); }
.prose h3 { margin-top: 30px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-bright); }

.article-cover {
  margin: 0 0 clamp(28px, 4vw, 44px);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-cover figcaption,
.prose figcaption {
  padding: 12px 2px 0;
  font-size: 13.5px;
  color: var(--muted);
}

.callout {
  margin: clamp(26px, 3vw, 40px) 0;
  padding: 24px 28px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label { margin-bottom: 10px; }

.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Таблица */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
tbody tr:hover { background: var(--surface); }

/* ============ Боковая колонка ============ */
.article-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.aside-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.aside-card--dark {
  background: var(--dark);
  color: #fff;
  border-color: transparent;
}
.aside-card--dark .label { color: rgba(255, 255, 255, .6); }
.aside-card--dark p { color: rgba(255, 255, 255, .78); }
.aside-card h3 { margin-bottom: 12px; }
.aside-card p:last-of-type { margin-bottom: 18px; }
.aside-card .btn { width: 100%; margin-top: 6px; }

.aside-nav { list-style: none; margin: 0; padding: 0; }
.aside-nav li { border-bottom: 1px solid var(--line); }
.aside-nav li:last-child { border-bottom: 0; }
.aside-nav a {
  display: block;
  padding: 11px 0;
  font-size: 14.5px;
  font-weight: 600;
  transition: color .2s;
}
.aside-nav a:hover { color: var(--accent); }

/* ============ Читайте также ============ */
.read-more { padding: 0 0 var(--gap-section); }
.read-more h2 { margin-bottom: clamp(24px, 3vw, 40px); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color .22s, transform .22s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card-media { background: var(--surface); }
.card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-cat {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; }
.card .card-link {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* ============ CTA-полоса ============ */
.band {
  background: var(--dark);
  color: #fff;
  padding: clamp(44px, 5vw, 76px) 0;
}
.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.band h2 { color: #fff; max-width: 22ch; margin-bottom: 12px; }
.band p { color: rgba(255, 255, 255, .78); margin-bottom: 0; max-width: 52ch; }
.band-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ============ Подвал ============ */
footer { background: var(--surface); border-top: 1px solid var(--line); padding: clamp(44px, 5vw, 72px) 0 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
.footer-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { width: 50px; height: 36px; object-fit: contain; }
.footer-about { font-size: 14.5px; color: var(--muted); max-width: 40ch; margin-bottom: 0; }
.footer-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14.5px; }
.footer-col a:hover { color: var(--accent); }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer-legal b { color: var(--text); font-weight: 600; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

/* ============ Адаптив ============ */
@media (max-width: 980px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .header-phone { display: none; }
  .header-inner { justify-content: space-between; }

  .band-inner { flex-direction: column; align-items: flex-start; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .band-actions .btn, .aside-card .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
