/* ============================================================ */
/* ============================================================ */
/*                    СТРАНИЦА СТАТЬИ                           */
/* ============================================================ */
/* ============================================================ */

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  padding: 28px 0 0;
  color: var(--gray);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs a:hover { color: var(--black); }
.breadcrumbs .sep { margin: 0 10px; color: #ccc; }

/* ============================================================
   HERO
   ============================================================ */
.article-hero { padding: 32px 0 0; }

.article-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 55px;
  align-items: end;
  min-width: 0;
}

.category-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.article-hero-text .category-label { margin-bottom: 18px; }

.article-hero h1 {
  margin-bottom: 26px;
  font-family: Georgia, serif;
  font-size: clamp(40px, 6vw, 78px);
  font-weight: 400;
  line-height: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-lead {
  max-width: 560px;
  margin-bottom: 30px;
  color: #444;
  font-family: Georgia, serif;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  word-wrap: break-word;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--gray);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.article-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--black);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
}

.article-hero-image {
  height: 640px;
  overflow: hidden;
  margin: 0;
  min-width: 0;
}
.article-hero-image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.article-body { padding: 90px 0; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 80px;
  align-items: start;
  min-width: 0;
}

/* ============================================================
   PROSE
   ============================================================ */
.prose {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  font-size: 17px;
  line-height: 1.75;
  color: #222;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.prose p { margin-bottom: 26px; }

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  color: var(--black);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.prose h1 { font-size: 42px; margin: 60px 0 24px; }
.prose h2 { font-size: 34px; margin: 70px 0 22px; }
.prose h3 { font-size: 26px; margin: 46px 0 14px; }
.prose h4 { font-size: 22px; margin: 36px 0 12px; }
.prose h5 { font-size: 18px; margin: 30px 0 10px; }
.prose h6 {
  font-size: 16px;
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.prose h1:first-child,
.prose h2:first-child { margin-top: 0; }

.prose ul,
.prose ol { margin: 0 0 26px 22px; }
.prose li { margin-bottom: 10px; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-word;
}
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose u { text-decoration: underline; }
.prose s { text-decoration: line-through; }
.prose sub { vertical-align: sub; font-size: .8em; }
.prose sup { vertical-align: super; font-size: .8em; }

.prose blockquote {
  margin: 60px 0;
  padding: 10px 0 10px 32px;
  border-left: 2px solid var(--black);
  font-family: Georgia, serif;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.25;
  color: var(--black);
}

.prose pre {
  margin: 30px 0;
  padding: 20px 24px;
  background: var(--light);
  border-left: 4px solid var(--accent);
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
}
.prose code {
  background: var(--light);
  padding: 2px 6px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92em;
  word-break: break-word;
}
.prose pre code { background: transparent; padding: 0; }

.prose img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 30px 0;
  cursor: zoom-in;
}

.prose figure {
  margin: 30px 0;
  max-width: 100%;
}
.prose figcaption {
  margin-top: 10px;
  color: var(--gray);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}

/* --- Таблица (внутри .table-wrap) --- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 15px;
}
.prose table th,
.prose table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.prose table th {
  background: var(--light);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 50px 0;
}

/* --- Палитра (внутри .palette-wrap) --- */
.prose .palette-grid,
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0;
}
.palette-card {
  padding: 16px;
  background: var(--light);
  text-align: center;
  min-width: 0;
}
.palette-swatch { height: 90px; margin-bottom: 12px; }
.palette-card strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
}
.palette-card span {
  color: var(--gray);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* --- Галерея (внутри .gallery-wrap) --- */
.prose .article-gallery,
.article-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.article-gallery figure {
  overflow: hidden;
  background: var(--light);
  margin: 0;
  min-width: 0;
}
.article-gallery img {
  height: 300px;
  width: 100%;
  object-fit: cover;
  cursor: zoom-in;
  margin: 0;
}
.article-gallery figcaption {
  padding: 12px 14px;
  color: var(--gray);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* --- Обёртки для скролла внутри статьи --- */
.table-wrap,
.palette-wrap,
.gallery-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 30px 0;
}

.table-wrap table { min-width: 500px; }
.palette-wrap .palette-grid { min-width: 0; }
.gallery-wrap .article-gallery { min-width: 0; }

/* --- Callout --- */
.prose .callout,
.callout {
  margin: 40px 0;
  padding: 28px 30px;
  background: var(--light);
  border-left: 4px solid var(--accent);
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.5;
}
.callout span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* --- Dropcap --- */
.prose .dropcap::first-letter {
  float: left;
  margin: 6px 12px 0 0;
  padding: 4px 12px 6px;
  color: var(--white);
  background: var(--black);
  font-family: Georgia, serif;
  font-size: 68px;
  line-height: .85;
}

/* ============================================================
   TOC
   ============================================================ */
.toc {
  position: sticky;
  top: 110px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.toc-title {
  margin-bottom: 18px;
  color: var(--gray);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.toc li { counter-increment: toc; margin-bottom: 14px; }
.toc a {
  display: block;
  color: #666;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.35;
  transition: color .3s ease;
  text-decoration: none;
  word-wrap: break-word;
}
.toc a::before {
  display: block;
  margin-bottom: 3px;
  color: #bbb;
  font-size: 10px;
  letter-spacing: .14em;
  content: "0" counter(toc);
}
.toc a:hover,
.toc a.active { color: var(--black); }
.toc a.active::before { color: var(--accent); }

/* ============================================================
   ARTICLE NAV
   ============================================================ */
.article-nav {
  padding: 70px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #faf7f2;
}
.article-nav-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}
.article-nav a {
  display: block;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  transition: .3s ease;
  text-decoration: none;
  min-width: 0;
}
.article-nav a:hover {
  border-color: var(--black);
  transform: translateY(-3px);
}
.article-nav .dir {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.article-nav h3 {
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  word-wrap: break-word;
}
.article-nav .next { text-align: right; }

/* ============================================================
   RELATED
   ============================================================ */
.related { padding: 90px 0; }
.related-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}
.related-header h2 {
  font-family: Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1;
}
.related-header p {
  max-width: 380px;
  color: var(--gray);
  font-size: 14px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.related-card {
  background: var(--light);
  overflow: hidden;
  transition: transform .3s ease;
  text-decoration: none;
  min-width: 0;
}
.related-card:hover { transform: translateY(-4px); }
.related-card img { height: 260px; width: 100%; object-fit: cover; }
.related-card .related-text { padding: 22px; }
.related-card h3 {
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  word-wrap: break-word;
}
.related-card p {
  margin-top: 10px;
  color: var(--gray);
  font-size: 13px;
}

/* ============================================================
   AD BANNER
   ============================================================ */
.article-ad {
  padding: 40px 0;
  background: #f7f7f7;
}
.article-ad-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 30px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: .3s ease;
  text-decoration: none;
  min-width: 0;
}
.article-ad-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
}
.article-ad-image {
  background-size: cover;
  background-position: center;
  min-height: 200px;
  background-color: #eee;
}
.article-ad-body {
  padding: 30px 30px 30px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.article-ad-label {
  color: var(--gray);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.article-ad-body h3 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--black);
  word-wrap: break-word;
}
.article-ad-body p {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   AD INLINE
   ============================================================ */
.article-ad-inline {
  margin: 50px 0;
  padding: 24px;
  background: #f7f7f7;
  border: 1px solid var(--line);
  text-align: center;
}
.article-ad-inline-label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 3px 10px;
  background: #e5e5e5;
  color: var(--gray);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.article-ad-inline a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.article-ad-inline img {
  max-width: 100%;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}
.article-ad-inline-body h4 {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}
.article-ad-inline-body p {
  color: var(--gray);
  font-size: 13px;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .92);
  cursor: zoom-out;
  padding: 40px;
  animation: lightboxFade .2s ease;
}
@keyframes lightboxFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }
body.lightbox-open { overflow: hidden; }

/* ============================================================
   ПЛАНШЕТ
   ============================================================ */
@media (max-width: 1050px) {
  .article-hero-inner { grid-template-columns: 1fr; gap: 35px; }
  .article-hero-image { height: 460px; }
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .toc {
    position: static;
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-ad-card { grid-template-columns: 1fr; }
  .article-ad-body { padding: 24px; }
  .article-ad-image { min-height: 220px; }
}

/* ============================================================
   МОБИЛЬНЫЙ
   ============================================================ */
@media (max-width: 720px) {

  .article-page,
  .article-page body,
  .article-page main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .article-page section { padding: 0 !important; }

  .article-page .container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .article-page .article-hero,
  .article-page .article-body,
  .article-page .article-nav,
  .article-page .related,
  .article-page .article-ad {
    padding: 24px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .article-page .article-hero { padding-top: 16px !important; }

  .article-page .article-hero-inner {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .article-page .article-hero-text {
    width: 100% !important;
    min-width: 0 !important;
  }

  .article-page .article-hero h1 {
    font-size: 26px !important;
    line-height: 1.15 !important;
    margin-bottom: 14px !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .article-page .article-lead {
    font-size: 15px !important;
    line-height: 1.5 !important;
    margin-bottom: 18px !important;
  }

  .article-page .article-meta {
    gap: 12px 18px !important;
    font-size: 10px !important;
    padding-top: 14px !important;
  }
  .article-page .article-meta strong { font-size: 12px !important; }

  .article-page .article-hero-image {
    width: 100% !important;
    height: 220px !important;
    margin-top: 16px !important;
  }

  .article-page .breadcrumbs {
    padding: 12px 0 0 !important;
    font-size: 10px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .article-page .article-layout {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .article-page .prose {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 15.5px !important;
    line-height: 1.7 !important;
  }
  .article-page .prose p { margin-bottom: 18px !important; }

  .article-page .prose h1 { font-size: 22px !important; margin: 32px 0 14px !important; }
  .article-page .prose h2 { font-size: 20px !important; margin: 32px 0 12px !important; }
  .article-page .prose h3 { font-size: 17px !important; margin: 26px 0 10px !important; }
  .article-page .prose h4 { font-size: 16px !important; margin: 22px 0 8px !important; }

  .article-page .prose ul,
  .article-page .prose ol { margin: 0 0 18px 18px !important; }

  .article-page .prose blockquote {
    font-size: 17px !important;
    line-height: 1.35 !important;
    padding-left: 14px !important;
    margin: 26px 0 !important;
  }

  .article-page .prose pre {
    font-size: 12px !important;
    padding: 12px 14px !important;
    margin: 18px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  .article-page .prose img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .article-page .prose .dropcap::first-letter {
    font-size: 44px !important;
    padding: 3px 8px 4px !important;
    margin: 3px 8px 0 0 !important;
  }

  .article-page .prose .callout,
  .article-page .callout {
    padding: 16px 18px !important;
    font-size: 15px !important;
    margin: 22px 0 !important;
  }

  /* Обёртки — держат скролл внутри */
  .article-page .table-wrap,
  .article-page .palette-wrap,
  .article-page .gallery-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 22px 0 !important;
  }

  .article-page .table-wrap table {
    min-width: 500px !important;
    font-size: 13px !important;
  }
  .article-page .table-wrap table th,
  .article-page .table-wrap table td {
    padding: 8px 10px !important;
  }

  /* Палитра — 2 в ряд */
  .article-page .palette-wrap .palette-grid,
  .article-page .palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    min-width: 0 !important;
  }
  .article-page .palette-card { padding: 10px !important; min-width: 0 !important; }
  .article-page .palette-swatch { height: 56px !important; margin-bottom: 8px !important; }
  .article-page .palette-card strong { font-size: 13px !important; }
  .article-page .palette-card span { font-size: 9px !important; }

  /* Галерея — 1 колонка */
  .article-page .gallery-wrap .article-gallery,
  .article-page .article-gallery {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    min-width: 0 !important;
  }
  .article-page .article-gallery img { height: 200px !important; }

  .article-page .toc {
    position: static !important;
    padding: 16px 0 0 !important;
    border-left: 0 !important;
    border-top: 1px solid var(--line) !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .article-page .toc a { font-size: 14px !important; }

  .article-page .article-nav { padding: 28px 0 !important; }
  .article-page .article-nav-inner {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .article-page .article-nav .next { text-align: left !important; }
  .article-page .article-nav a { padding: 16px 18px !important; }
  .article-page .article-nav h3 { font-size: 17px !important; }

  .article-page .related { padding: 32px 0 !important; }
  .article-page .related-header {
    display: block !important;
    margin-bottom: 20px !important;
  }
  .article-page .related-header h2 { font-size: 22px !important; margin-bottom: 6px !important; }
  .article-page .related-header p { font-size: 13px !important; }
  .article-page .related-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .article-page .related-card img { height: 190px !important; }
  .article-page .related-card h3 { font-size: 17px !important; }

  .article-page .article-ad { padding: 20px 0 !important; }
  .article-page .article-ad-card {
    display: block !important;
    width: 100% !important;
  }
  .article-page .article-ad-image { height: 160px !important; min-height: 160px !important; }
  .article-page .article-ad-body { padding: 16px 18px !important; }
  .article-page .article-ad-body h3 { font-size: 18px !important; }
  .article-page .article-ad-body p { font-size: 13px !important; }

  .article-page .article-ad-inline { margin: 22px 0 !important; padding: 14px !important; }

  .article-page .lightbox { padding: 10px !important; }
  .article-page .lightbox-close {
    top: 8px !important;
    right: 8px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 380px) {
  .article-page .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .article-page .article-hero h1 { font-size: 22px !important; }
  .article-page .prose h1 { font-size: 20px !important; }
  .article-page .prose h2 { font-size: 18px !important; }
  .article-page .prose h3 { font-size: 16px !important; }
  .article-page .prose blockquote { font-size: 16px !important; }

  .article-page .palette-wrap .palette-grid,
  .article-page .palette-grid { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}