/* ══════════════════════════════════════════════════════════
   BLOG — shared styles
   Uses CSS variables from style.css (must be loaded first)
══════════════════════════════════════════════════════════ */

/* ── Site header (blog pages) ── */
.blog-site-header {
  background: var(--ink);
  padding: 12px 0;
}

.blog-site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blog-logo {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  font-style: italic;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -.1px;
  flex-shrink: 0;
}

.blog-logo:hover { color: var(--gold); }

.blog-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-nav a {
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color 200ms, background 200ms, border-color 200ms;
  white-space: nowrap;
}

.blog-nav a:hover,
.blog-nav a.active { color: var(--white); }

/* «Создать подпись» — выглядит как кнопка */
.blog-nav a.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: #1a1408;
  font-weight: 600;
  font-size: .8rem;
  padding: 7px 16px;
  border-radius: 20px;
  letter-spacing: .01em;
  border: 1.5px solid var(--gold);
  transition: background 200ms, border-color 200ms, transform .1s;
}

.blog-nav a.btn-header:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  padding: 14px 0 0;
  font-size: .78rem;
  color: var(--ink-light);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumbs li { display: flex; align-items: center; gap: 4px; }

.breadcrumbs li::after {
  content: '›';
  color: var(--border-2);
}

.breadcrumbs li:last-child::after { display: none; }

.breadcrumbs a {
  color: var(--ink-light);
  text-decoration: none;
  transition: color var(--dur);
}

.breadcrumbs a:hover { color: var(--gold-dark); }

.breadcrumbs span { color: var(--ink-mid); }

/* ── Blog main layout ── */
.blog-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ── Article header ── */
.article-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.28);
  color: #8a6820;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.article-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -.3px;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .78rem;
  color: var(--ink-light);
  flex-wrap: wrap;
}

.article-meta-sep { color: var(--border-2); }

/* ── Article body ── */
.article-body {
  font-size: .97rem;
  line-height: 1.78;
  color: #3d3630;
}

.article-body p { margin-bottom: 1.2em; }

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -.2px;
  margin: 2.2em 0 .7em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.6em 0 .5em;
}

.article-body ul,
.article-body ol {
  padding-left: 24px;
  margin-bottom: 1.2em;
}

.article-body li { margin-bottom: .45em; }

.article-body strong { color: var(--ink); font-weight: 600; }

.article-body a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-color: rgba(160,120,48,.3);
  transition: color var(--dur);
}

.article-body a:hover { color: var(--ink); }

/* ── Tip / callout box ── */
.tip-box {
  background: #fef9ec;
  border: 1px solid rgba(201,168,76,.3);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 1.6em 0;
  font-size: .9rem;
  color: var(--ink-mid);
  line-height: 1.65;
}

.tip-box strong { color: #8a6820; }

/* ── CTA block (inline) ── */
.cta-block {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 32px 36px;
  text-align: center;
  margin: 2.5em 0;
  position: relative;
  overflow: hidden;
}

.cta-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 8%, var(--gold) 40%, var(--gold) 60%, transparent 92%);
}

.cta-block h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--white);
  margin: 0 0 6px;
}

.cta-block p {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  margin: 0 0 20px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .93rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--dur), transform var(--dur);
}

.btn-cta:hover {
  background: var(--gold-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* ── FAQ ── */
.article-faq { margin: 2.5em 0; }

.article-faq h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 1.2em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq-item:first-of-type { border-top: 1px solid var(--border); }

.faq-q {
  font-size: .97rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.faq-q::before {
  content: 'В';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  color: #8a6820;
  flex-shrink: 0;
  margin-top: 1px;
}

.faq-a {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink-mid);
  padding-left: 32px;
}

/* ── Related articles ── */
.related-section {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 16px;
  border-bottom: none;
  padding-bottom: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-decoration: none;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
  display: block;
}

.related-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.related-card__tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 6px;
}

.related-card__title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* ── Blog index page ── */
.blog-index-header {
  background: linear-gradient(160deg, #faf8f3 0%, #f5f2ea 100%);
  padding: 52px 0 44px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.blog-index-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 10px;
}

.blog-index-sub {
  font-size: .92rem;
  color: var(--ink-mid);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 48px 0 80px;
}

.blog-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}

.blog-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.blog-card__body { padding: 22px 22px 18px; }

.blog-card__tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 10px;
}

.blog-card__title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 10px;
}

.blog-card__excerpt {
  font-size: .82rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.blog-card__meta {
  font-size: .73rem;
  color: var(--border-2);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Steps list ── */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
}

.steps-list li {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 1.2em;
  padding-bottom: 1.2em;
  border-bottom: 1px solid var(--border);
}

.steps-list li:last-child { border-bottom: none; }

.steps-list li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── H4 inside article ── */
.article-body h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-mid);
  margin: 1.2em 0 .4em;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .8rem;
}

/* ── Table of Contents ── */
.toc {
  background: #f8f5f0;
  border-radius: 12px;
  padding: 24px 28px;
  margin: 28px 0;
  border-left: 3px solid var(--gold);
}

.toc p {
  font-weight: 600;
  margin: 0 0 12px;
  font-size: .95rem;
  color: var(--ink);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  line-height: 2;
}

.toc ol li { margin-bottom: 0; }

.toc a {
  color: var(--ink-mid);
  text-decoration: none;
  font-size: .88rem;
  transition: color var(--dur);
}

.toc a:hover { color: var(--gold-dark); }

/* ── Figure / figcaption ── */
.article-body figure {
  margin: 28px 0;
  border-radius: 10px;
  overflow: hidden;
}

.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
}

.article-body figcaption {
  font-size: .78rem;
  color: #999;
  padding: 6px 0;
  line-height: 1.5;
  font-style: italic;
}

/* ── Tables inside articles ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  line-height: 1.5;
  margin: 24px 0;
}

.article-body thead tr {
  background: var(--ink);
  color: var(--white);
}

.article-body th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.article-body tbody tr:nth-child(even) {
  background: #faf8f5;
}

.article-body tbody tr:hover {
  background: #f5f0e8;
}

/* ── Article section spacing ── */
.article-body section {
  scroll-margin-top: 80px;
}

/* ── Author box (when not inline) ── */
.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #f8f5f0;
  border-radius: 12px;
  padding: 24px;
  margin: 40px 0 32px;
}

.author-box__avatar {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.author-box__name {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--ink);
}

.author-box__role {
  color: #888;
  font-size: .82rem;
  margin: 0 0 10px;
}

.author-box__bio {
  font-size: .9rem;
  margin: 0;
  line-height: 1.6;
  color: var(--ink-mid);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .blog-main { padding: 0 20px 60px; }
  .related-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .toc { padding: 18px 20px; }
  .article-body table { font-size: .82rem; }
  .article-body th,
  .article-body td { padding: 8px 10px; }
}

@media (max-width: 500px) {
  .blog-grid { grid-template-columns: 1fr; }
  .cta-block { padding: 24px 20px; }
  .related-grid { grid-template-columns: 1fr; gap: 8px; }
  .author-box { flex-direction: column; }
}
