/* ══════════════════════════════════════════════
   post.css — стили страниц статей блога
   Дополняет style.css, не дублирует переменные
   ══════════════════════════════════════════════ */

/* ── Reading progress ── */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--c-brand), var(--c-accent));
  z-index: 999; transition: width .1s linear;
}

/* ── Post Hero ── */
.post-hero { background: var(--c-ink); color: #fff; padding: 48px 0 0; }

.post-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #8fa0b5; margin-bottom: 18px; flex-wrap: wrap;
}
.post-breadcrumb a { color: #8fa0b5; transition: color .15s; }
.post-breadcrumb a:hover { color: #fff; }
.post-breadcrumb span { color: #4a5e73; }

.post-cats { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.post-cat {
  background: rgba(232,168,56,.18); color: var(--c-accent);
  padding: 5px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}

.post-hero h1 {
  font-family: 'Bricolage Grotesque', 'Be Vietnam Pro', sans-serif;
  font-size: clamp(24px, 3.5vw, 44px); font-weight: 700;
  line-height: 1.1; letter-spacing: -.02em; max-width: 820px; margin-bottom: 20px;
}
.post-hero h1 em { font-style: normal; color: var(--c-accent); }

.post-meta {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; font-size: 13.5px; color: #8fa0b5; padding-bottom: 36px;
}
.post-meta-item { display: flex; align-items: center; gap: 7px; }

.post-hero-img { aspect-ratio: 21/8; overflow: hidden; position: relative; }
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: .65; display: block; }
.post-hero-img-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 120px;
  background: linear-gradient(0deg, var(--c-bg), transparent);
}

/* ── Post layout ── */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 310px);
  gap: 48px; padding: 48px 0 80px; align-items: start;
}

/* ── TOC inline ── */
.toc-inline {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 36px;
}
.toc-inline-head {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--c-ink); margin-bottom: 18px;
}
.toc-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 16px; list-style: none; counter-reset: none;
}
.toc-grid li a {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 10px;
  border-radius: 8px; font-size: 14px; color: var(--c-ink-2); transition: all .15s; line-height: 1.4;
}
.toc-grid li a:hover,
.toc-grid li.active a { background: rgba(10,77,140,.07); color: var(--c-brand); }
.toc-grid li.active a .toc-num { color: var(--c-accent); }
.toc-num { font-weight: 700; color: var(--c-brand); font-size: 13px; flex-shrink: 0; min-width: 22px; }
.toc-grid li.h3 a { padding-left: 24px; font-size: 13px; color: var(--c-muted); }
.toc-grid li.h3 a:hover { background: rgba(10,77,140,.05); color: var(--c-brand); }

/* ── Article sections ── */
.post-content > section {
  padding: 0;
}
.post-content > section + section {
  margin-top: 34px;
}
section[id] { scroll-margin-top: 88px; }

.prose-heading {
  font-family: 'Bricolage Grotesque', 'Be Vietnam Pro', sans-serif;
  font-size: clamp(20px, 2.2vw, 28px); font-weight: 700;
  color: var(--c-ink); margin: 48px 0 16px; letter-spacing: -.02em;
  line-height: 1.2; scroll-margin-top: 88px;
}
h3.prose-heading, .subsection h3 {
  font-size: 19px; font-weight: 700; color: var(--c-ink);
  margin: 32px 0 12px; line-height: 1.3; scroll-margin-top: 88px;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.subsection { padding-left: 0; }

/* ── Prose ── */
.prose { font-size: 17px; line-height: 1.78; color: var(--c-ink-2); }
.prose p  { margin-bottom: 20px; max-width: 72ch; }
.prose ul,
.prose ol { margin: 0 0 20px 24px; padding-left: 0; display: flex; flex-direction: column; gap: 8px; }
.prose li { padding-left: 4px; }
.prose strong { color: var(--c-ink); font-weight: 600; }
.prose a { color: var(--c-brand); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--c-brand-2); }

/* Callouts */
.callout {
  background: rgba(10,77,140,.06); border-left: 4px solid var(--c-brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; margin: 24px 0; font-size: 15.5px;
}
.callout strong { color: var(--c-brand); }
.callout.warn   { background: rgba(232,168,56,.10); border-color: var(--c-accent); }
.callout.warn strong { color: #9a6800; }
.callout.success { background: rgba(39,163,97,.08); border-color: #27a361; }
.callout.success strong { color: #1a7f4e; }

/* Tables */
.prose table, table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 15px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.prose thead, thead { background: var(--c-ink); color: #fff; }
.prose th, th {
  padding: 13px 16px; text-align: left;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.prose td, td { padding: 13px 16px; border-top: 1px solid var(--c-line); }
.prose tbody tr:hover, tbody tr:hover { background: rgba(10,77,140,.03); }
.prose td:last-child, td:last-child { font-weight: 600; color: var(--c-brand); }

/* ── Post footer ── */
.post-footer { border-top: 2px solid var(--c-line); padding-top: 32px; margin-top: 44px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; align-items: center; }
.post-tags-label { font-size: 13px; font-weight: 600; color: var(--c-muted); }
.post-tag {
  background: rgba(10,77,140,.07); color: var(--c-brand);
  padding: 6px 14px; border-radius: 999px; font-size: 13px;
  font-weight: 500; transition: all .15s;
}
.post-tag:hover { background: var(--c-brand); color: #fff; }
.post-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-label { font-size: 14px; font-weight: 600; color: var(--c-muted); }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  transition: all .2s; border: 0; cursor: pointer; font-family: inherit; text-decoration: none;
}
.share-btn.fb    { background: #1877f2; color: #fff; }
.share-btn.zalo  { background: #0068ff; color: #fff; }
.share-btn.copy  { background: var(--c-bg); border: 1px solid var(--c-line); color: var(--c-ink-2); }
.share-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ── Sidebar ── */
.post-sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; }

.sidebar-form {
  background: var(--c-ink); color: #fff;
  border-radius: var(--radius-lg); padding: 26px 22px; position: relative; overflow: hidden;
}
.sidebar-form::before {
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(232,168,56,.2), transparent 70%); pointer-events: none;
}
.sidebar-form h4 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.25;
}
.sidebar-form p { font-size: 13px; color: #8fa0b5; margin-bottom: 18px; line-height: 1.5; }
.sf-input {
  width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; color: #fff;
  font-family: inherit; margin-bottom: 9px; transition: border .2s;
}
.sf-input::placeholder { color: #6a7f94; }
.sf-input:focus { outline: 0; border-color: var(--c-accent); background: rgba(255,255,255,.12); }
.sf-btn {
  width: 100%; background: var(--c-accent); color: var(--c-ink);
  border: 0; border-radius: 10px; padding: 13px;
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all .2s;
}
.sf-btn:hover { background: var(--c-accent-2); }
.sf-consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.45; color: #8fa0b5;
  margin: 3px 0 12px; cursor: pointer;
}
.sf-consent input { margin-top: 2px; flex-shrink: 0; accent-color: var(--c-accent); }
.sf-msg { display: none; margin-top: 10px; font-size: 12.5px; line-height: 1.45; text-align: center; }
.sf-note { text-align: center; font-size: 12px; color: #6a7f94; margin-top: 9px; }

.related-card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 20px;
}
.related-card h4 {
  font-size: 12px; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px;
}
.related-list { list-style: none; display: flex; flex-direction: column; }
.related-list li { border-bottom: 1px solid var(--c-line); }
.related-list li:last-child { border-bottom: 0; }
.related-list a {
  display: flex; gap: 11px; padding: 11px 0; align-items: flex-start; transition: color .15s;
}
.related-thumb {
  width: 54px; height: 42px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; background: var(--c-bg);
}
.related-title { font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--c-ink-2); }
.related-list a:hover .related-title { color: var(--c-brand); }
.related-cat { font-size: 11px; color: var(--c-muted); margin-top: 3px; }

/* ── Post CTA strip ── */
.cta-strip {
  background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-ink) 100%);
  color: #fff; padding: 60px 24px; text-align: center;
}
.cta-strip h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(22px, 3vw, 36px); font-weight: 700; margin-bottom: 12px;
}
.cta-strip p { font-size: 17px; color: #dde6f0; margin-bottom: 28px; }
.cta-strip-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-w {
  background: #fff; color: var(--c-brand); padding: 14px 28px;
  border-radius: 999px; font-weight: 700; font-size: 15px; transition: all .2s;
}
.btn-w:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); color: var(--c-brand); }
.btn-o {
  border: 2px solid rgba(255,255,255,.4); color: #fff;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 15px; transition: all .2s;
}
.btn-o:hover { background: rgba(255,255,255,.12); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .toc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .post-hero h1 { font-size: 24px; }
  .post-meta { gap: 14px; }
  .post-sidebar { grid-template-columns: 1fr; }
  .post-share { flex-wrap: wrap; }
  .toc-grid { grid-template-columns: 1fr; }
  .prose { font-size: 16px; }
  .post-content > section + section { margin-top: 30px; }
  .prose-heading { margin-top: 0; }
  .prose ul,
  .prose ol { margin-left: 20px; }
}
