/* ═══════════════════════════════════════════════════════════════
   blog.css — стили блога МастерГаз
   Подключается только на страницах блога поверх style.css
   ═══════════════════════════════════════════════════════════════ */


/* ── ХЛЕБНЫЕ КРОШКИ ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 28px;
}

.breadcrumbs__sep {
  color: var(--muted);
  user-select: none;
}

.breadcrumbs a {
  color: var(--text-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--mint-deep);
  text-decoration: underline;
}

.breadcrumbs span[aria-current] {
  color: var(--text);
}


/* ── СТРАНИЦА БЛОГА (список статей) ── */
.blog-section {
  padding: 64px 0 80px;
}

.blog-section__header {
  margin-bottom: 48px;
}

.blog-section__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 12px;
  line-height: 1.2;
}

.blog-section__desc {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 560px;
  line-height: 1.6;
}

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

.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--text-soft);
  font-size: 16px;
}


/* ── КАРТОЧКА СТАТЬИ ── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
  box-shadow: var(--s2);
  transform: translateY(-2px);
}

.blog-card__img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-section);
}

.blog-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-card__img-wrap img {
  transform: scale(1.03);
}

.blog-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--border-card) 100%);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.blog-card__cat {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  background: rgba(17, 217, 154, 0.12);
  color: var(--mint-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 4px;
  text-decoration: none;
}

.blog-card__cat:hover {
  background: rgba(17, 217, 154, 0.2);
}

.blog-card__date {
  font-size: 12px;
  color: var(--muted);
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.35;
  margin-bottom: 10px;
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-card__title a:hover {
  color: var(--mint-deep);
}

.blog-card__desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__readmore {
  font-size: 13px;
  font-weight: 600;
  color: var(--mint-deep);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.blog-card__readmore:hover {
  text-decoration: underline;
}


/* ── СТРАНИЦА СТАТЬИ ── */
.post-section {
  padding: 48px 0 80px;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}

.post-main {}

.post-header {
  margin-bottom: 32px;
}

.post-header__cat {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  background: rgba(17, 217, 154, 0.12);
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 16px;
}

.post-header__cat:hover {
  background: rgba(17, 217, 154, 0.2);
}

.post-header__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.post-header__date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-hero {
  margin-bottom: 36px;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.post-hero__img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}


/* ── ОГЛАВЛЕНИЕ (sidebar) ── */
.post-sidebar {
  position: sticky;
  top: 110px;
}

.post-toc {
  background: var(--bg-section);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}

.post-toc__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-toc__item {
  counter-increment: toc;
}

.post-toc__item a {
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 2px 0;
  transition: color 0.15s;
}

.post-toc__item a:hover {
  color: var(--mint-deep);
}

.post-toc__item--h3 a {
  padding-left: 12px;
  font-size: 12px;
}


/* ── КОНТЕНТ СТАТЬИ ── */
.post-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin-top: 44px;
  margin-bottom: 18px;
  line-height: 1.3;
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--heading);
  margin-top: 32px;
  margin-bottom: 14px;
  line-height: 1.35;
}

.post-content p {
  margin-bottom: 18px;
}

.post-content ul,
.post-content ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 6px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.post-content th {
  background: var(--bg-section);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border-card);
  color: var(--heading);
}

.post-content td {
  padding: 9px 14px;
  border: 1px solid var(--border-card);
  vertical-align: top;
}

.post-content tr:nth-child(even) td {
  background: var(--bg-section);
}

.post-content a {
  color: var(--mint-deep);
  text-decoration: underline;
}

.post-content a:hover {
  text-decoration: none;
}

.post-content strong {
  font-weight: 600;
  color: var(--heading);
}

.post-content blockquote {
  border-left: 3px solid var(--mint);
  margin: 24px 0;
  padding: 14px 20px;
  background: rgba(17, 217, 154, 0.06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-soft);
  font-style: italic;
}

.post-content code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--bg-section);
  border: 1px solid var(--border-card);
  border-radius: 3px;
  padding: 1px 5px;
}

.post-content pre {
  background: #1a2332;
  border-radius: var(--r-md);
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-content pre code {
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 14px;
  padding: 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 16px 0;
}


/* ── CTA-БЛОК В КОНЦЕ СТАТЬИ ── */
.post-cta {
  background: var(--heading);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.post-cta__text {}

.post-cta__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 6px;
}

.post-cta__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.post-cta__sub {
  font-size: 14px;
  color: rgba(255,255,255,.6);
}

.post-cta__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}


/* ── СТРАНИЦА КАТЕГОРИИ ── */
.category-section {
  padding: 64px 0 80px;
}

.category-section__header {
  margin-bottom: 40px;
}

.category-section__badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  background: rgba(17, 217, 154, 0.12);
  color: var(--mint-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 12px;
}

.category-section__title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 10px;
}

.category-section__desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.6;
}

.category-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  margin-top: 32px;
}

.category-back:hover {
  color: var(--mint-deep);
}


/* ── АДАПТИВ ── */
@media (max-width: 1100px) {
  .post-layout {
    grid-template-columns: 1fr 240px;
    gap: 40px;
  }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    position: static;
    order: -1;
  }

  .post-toc {
    margin-bottom: 8px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .blog-section { padding: 40px 0 60px; }
  .category-section { padding: 40px 0 60px; }
  .post-section { padding: 32px 0 60px; }

  .blog-section__title { font-size: 28px; }
  .post-header__title { font-size: 26px; }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }

  .post-cta__actions {
    flex-direction: column;
    width: 100%;
  }

  .post-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .post-header__title { font-size: 24px; }
  .post-content h2 { font-size: 20px; }
  .post-content h3 { font-size: 17px; }
}
