/* ==========================================================================
   blog.css — единый стиль для всех статей /blog/*.php
   Подключается в head.php по условию $page['is_blog_article'] === true.
   Документация: /_meta/BLOG_TEMPLATE.md
   ========================================================================== */

/* ——— Контейнер статьи ——— */
.blog-article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 32px) clamp(60px, 8vw, 100px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #e8e8e8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  z-index: 1;
}

.blog-article *,
.blog-article *::before,
.blog-article *::after {
  box-sizing: border-box;
}

/* ——— Хедер статьи: breadcrumbs + badge + h1 + meta + hero ——— */
.blog-article__header {
  margin-bottom: clamp(32px, 5vw, 48px);
}

.blog-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
}

.blog-breadcrumbs a {
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-breadcrumbs a:hover {
  color: #ff2d78;
}

.blog-breadcrumbs__sep {
  opacity: 0.4;
  font-size: 12px;
}

.blog-breadcrumbs__current {
  color: #aaa;
}

.blog-badge {
  display: inline-block;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 100px;
  color: #fff;
  background: rgba(255, 45, 120, 0.65);
  margin-bottom: 20px;
}

.blog-article h1,
.blog-article [itemprop="headline"] {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 20px;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: #888;
}

.blog-meta time {
  color: #aaa;
}

.blog-meta__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #555;
}

.blog-hero {
  margin: 0 0 clamp(32px, 5vw, 48px);
  border-radius: clamp(12px, 2vw, 16px);
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
}

.blog-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ——— Тело статьи ——— */
.blog-content {
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.7;
}

.blog-lead {
  font-size: clamp(17px, 2.7vw, 20px);
  line-height: 1.6;
  color: #ddd;
  margin: 0 0 clamp(24px, 4vw, 36px);
  font-weight: 400;
}

.blog-content h2 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  margin: clamp(36px, 5vw, 48px) 0 clamp(14px, 2vw, 18px);
  letter-spacing: -0.005em;
}

.blog-content h3 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  margin: clamp(24px, 4vw, 32px) 0 12px;
}

.blog-content p {
  margin: 0 0 18px;
  color: #e8e8e8;
}

.blog-content p:last-child {
  margin-bottom: 0;
}

.blog-content strong {
  color: #fff;
  font-weight: 600;
}

.blog-content em {
  font-style: italic;
  color: #ddd;
}

.blog-content a {
  color: #ff2d78;
  text-decoration: underline;
  text-decoration-color: rgba(255, 45, 120, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.blog-content a:hover {
  color: #ff5a9a;
  text-decoration-color: #ff5a9a;
}

.blog-content a:visited {
  color: #ff2d78;
}

/* ——— Списки ——— */
.blog-content ul,
.blog-content ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.blog-content li {
  margin: 8px 0;
  color: #e8e8e8;
}

.blog-content ul li::marker {
  color: #ff2d78;
}

.blog-content ol li::marker {
  color: #ff2d78;
  font-weight: 600;
}

.blog-content li > ul,
.blog-content li > ol {
  margin-top: 8px;
  margin-bottom: 0;
}

/* ——— Цитата ——— */
.blog-content blockquote {
  margin: clamp(24px, 4vw, 32px) 0;
  padding: 8px 0 8px 20px;
  border-left: 4px solid #ff2d78;
  color: #ddd;
  font-style: italic;
}

.blog-content blockquote p {
  margin-bottom: 8px;
}

.blog-content blockquote cite {
  display: block;
  font-size: 14px;
  color: #888;
  font-style: normal;
  margin-top: 8px;
}

/* ——— Callout-блок (важный совет) ——— */
.blog-callout {
  margin: clamp(24px, 4vw, 32px) 0;
  padding: clamp(16px, 3vw, 24px) clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #00f5ff;
  border-radius: 12px;
}

.blog-callout p {
  margin-bottom: 8px;
}

.blog-callout p:last-child {
  margin-bottom: 0;
}

.blog-callout strong {
  color: #00f5ff;
}

/* ——— Изображение в статье ——— */
.blog-figure {
  margin: clamp(24px, 4vw, 36px) 0;
  border-radius: 12px;
  overflow: hidden;
}

.blog-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.blog-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: #888;
  text-align: center;
  font-style: italic;
}

/* Изображения внутри .blog-content без <figure> */
.blog-content > img,
.blog-content p > img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: clamp(16px, 3vw, 24px) 0;
}

/* ——— Таблица ——— */
.blog-table-wrap {
  margin: clamp(24px, 4vw, 32px) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #e8e8e8;
}

.blog-table th,
.blog-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

.blog-table tr:last-child td {
  border-bottom: none;
}

.blog-table tr:hover td {
  background: rgba(255, 45, 120, 0.03);
}

/* ——— Inline CTA (в середине статьи) ——— */
.blog-inline-cta {
  margin: clamp(28px, 4vw, 40px) 0;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 45, 120, 0.06);
  border: 1px solid rgba(255, 45, 120, 0.15);
  border-radius: 14px;
  text-align: center;
}

.blog-inline-cta p {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 500;
}

/* ——— CTA-кнопка (общая) ——— */
.blog-cta-btn {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(90deg, #ff2d78 0%, #ff0099 100%);
  color: #fff;
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 0 30px rgba(255, 45, 120, 0.35);
  text-decoration: none;
}

.blog-cta-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 40px rgba(255, 45, 120, 0.5);
  color: #fff;
}

.blog-cta-btn:active {
  transform: scale(0.98);
}

.blog-cta-btn--compact {
  padding: 12px 28px;
  font-size: 14px;
}

/* ——— FAQ ——— */
.blog-faq {
  margin: clamp(48px, 7vw, 72px) 0 clamp(32px, 5vw, 48px);
}

.blog-faq h2 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 clamp(16px, 3vw, 24px);
}

.blog-faq__item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
}

.blog-faq__item:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-faq__item summary {
  cursor: pointer;
  font-size: clamp(16px, 2.3vw, 18px);
  font-weight: 600;
  color: #fff;
  list-style: none;
  position: relative;
  padding-right: 32px;
  transition: color 0.2s;
}

.blog-faq__item summary::-webkit-details-marker {
  display: none;
}

.blog-faq__item summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  line-height: 1;
  color: #ff2d78;
  transition: transform 0.25s;
}

.blog-faq__item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.blog-faq__item summary:hover {
  color: #ff2d78;
}

.blog-faq__answer {
  padding: 12px 0 4px;
  color: #ccc;
  font-size: clamp(15px, 2.3vw, 16px);
  line-height: 1.65;
}

.blog-faq__answer p {
  margin: 0 0 10px;
}

.blog-faq__answer p:last-child {
  margin-bottom: 0;
}

/* ——— Final CTA блок ——— */
.blog-final-cta {
  margin: clamp(48px, 7vw, 72px) 0 clamp(32px, 5vw, 48px);
  padding: clamp(32px, 5vw, 48px) clamp(20px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.12) 0%, rgba(0, 245, 255, 0.1) 100%);
  border: 1px solid rgba(255, 45, 120, 0.25);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-final-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255, 45, 120, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.blog-final-cta > * {
  position: relative;
  z-index: 1;
}

.blog-final-cta h2 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

.blog-final-cta p {
  font-size: clamp(15px, 2vw, 17px);
  color: #ddd;
  margin: 0 0 24px;
  line-height: 1.6;
}

/* ——— Related articles ——— */
.blog-related {
  margin: clamp(48px, 7vw, 72px) 0 clamp(32px, 5vw, 48px);
}

.blog-related h2 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px;
}

.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 20px);
}

.blog-related__card {
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.blog-related__card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 45, 120, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.blog-related__card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}

.blog-related__card h3 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin: 0;
  padding: 14px 16px 18px;
}

/* ——— Footer-nav внутри статьи ——— */
.blog-article__footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: clamp(24px, 4vw, 32px);
  margin-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
}

.blog-article__footer-nav a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-article__footer-nav a:hover {
  color: #ff2d78;
}

/* ——— Адаптив ——— */

/* <720px: полная ширина, уменьшенные отступы */
@media (max-width: 720px) {
  .blog-related__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .blog-article__footer-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .blog-final-cta {
    border-radius: 16px;
  }
}

/* >1200px: можно было бы TOC справа, но пока не нужно. Просто максимум 760px. */

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  .blog-related__card,
  .blog-cta-btn,
  .blog-faq__item summary::after {
    transition: none !important;
  }
  .blog-related__card:hover,
  .blog-cta-btn:hover {
    transform: none;
  }
}

/* ——— Print ——— */
@media print {
  .blog-breadcrumbs,
  .blog-final-cta,
  .blog-related,
  .blog-article__footer-nav,
  .blog-inline-cta,
  .blog-cta-btn {
    display: none !important;
  }
  .blog-article {
    color: #000;
    max-width: 100%;
  }
  .blog-content h1,
  .blog-content h2,
  .blog-content h3,
  .blog-lead,
  .blog-content strong {
    color: #000;
  }
}
