/* ============================================================
   PROSE — типографика статей
   Цветовая гамма: #1a1614 / #6b6560 / #631D1F / #f7f5f1
   ============================================================ */

.prose {
  line-height: 1.75;
  /* color: #4a4540; */
}

.prose > *:first-child {
  margin-top: 0;
}

/* ── Заголовки ─────────────────────────────────────────── */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: #1a1614;
  line-height: 1.25;
  font-weight: 700;
}

.prose h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid #e8e4de;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.625rem;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #6b6560;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .75rem;
}

/* ── Параграфы ─────────────────────────────────────────── */

.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

/* ── Ссылки ────────────────────────────────────────────── */

.prose a {
  color: #631D1F;
  text-decoration: underline;
  text-decoration-color: rgba(99, 29, 31, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.prose a:hover {
  color: #7a2426;
  text-decoration-color: #7a2426;
}

/* ── Выделение ─────────────────────────────────────────── */

.prose strong {
  color: #1a1614;
  font-weight: 700;
}

.prose em {
  color: #4a4540;
}

/* ── Списки ────────────────────────────────────────────── */

.prose ul,
.prose ol {
  padding-left: 0;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prose ul {
  list-style: none;
}

.prose ul li {
  padding-left: 1.5rem;
  position: relative;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #631D1F;
  flex-shrink: 0;
}

.prose ol {
  list-style: none;
  counter-reset: prose-ol;
}

.prose ol li {
  padding-left: 2rem;
  position: relative;
  counter-increment: prose-ol;
}

.prose ol li::before {
  content: counter(prose-ol);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #f5eaea;
  color: #631D1F;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Вложенные списки */
.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* ── Цитата ────────────────────────────────────────────── */

.prose blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid #631D1F;
  background: #faf8f5;
  border-radius: 0 12px 12px 0;
  color: #6b6560;
  font-style: italic;
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose blockquote p:not(:last-child) {
  margin-bottom: 0.75rem;
}

/* ── Разделитель ───────────────────────────────────────── */

.prose hr {
  border: none;
  border-top: 1px solid #e8e4de;
  margin: 2.5rem 0;
}

/* ── Код ───────────────────────────────────────────────── */

.prose code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  font-size: 0.875em;
  background: #f0ece6;
  color: #631D1F;
  font-family: ui-monospace, 'Roboto Mono', 'Courier New', monospace;
}

.prose pre {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.5rem 0;
  background: #1a1614;
  border: 1px solid #2e2825;
}

.prose pre code {
  background: transparent;
  color: #e8e4de;
  padding: 0;
  font-size: 0.875rem;
}

/* ── Картинки ──────────────────────────────────────────── */

.prose img {
  border-radius: 12px;
  margin: 1.75rem 0;
  max-width: 100%;
  height: auto;
  display: block;
}

.prose figure {
  margin: 1.75rem 0;
}

.prose figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #9b9590;
  text-align: center;
  font-style: italic;
}

/* ── Видео (iframe / YouTube / embed) ─────────────────── */

/* Адаптивный контейнер — 16:9 */
.prose iframe,
.prose .wp-block-embed__wrapper iframe,
.prose .video-embed iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: none;
  margin: 1.75rem 0;
}

/* WordPress embed обёртка */
.prose .wp-block-embed {
  margin: 1.75rem 0;
}

.prose .wp-block-embed__wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.prose .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  margin: 0;
}

/* YouTube / Video через shortcode или голый iframe */
.prose .video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin: 1.75rem 0;
  background: #1a1614;
}

.prose .video-wrap iframe,
.prose .video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  margin: 0;
}

/* Нативное видео */
.prose video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 1.75rem 0;
  background: #1a1614;
}

/* ── Таблицы ───────────────────────────────────────────── */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose thead {
  background: #631D1F;
  color: #fff;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8e4de;
  color: #4a4540;
  vertical-align: top;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:nth-child(even) {
  background: #faf8f5;
}

.prose tbody tr:hover {
  background: #f5eaea;
}

@media (max-width: 768px) {
  .prose table {
    font-size: 0.825rem;
  }

  .prose th,
  .prose td {
    padding: 0.5rem 0.75rem;
    white-space: normal;
    min-width: 100px;
  }

  .prose table th:first-child,
  .prose table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
  }

  .prose thead th:first-child {
    background: #631D1F;
  }
}

@media (max-width: 480px) {
  .prose th,
  .prose td {
    padding: 0.375rem 0.5rem;
    min-width: 80px;
  }
}

/* ── Инфобоксы (опционально, если редактор добавляет) ── */

.prose .infobox,
.prose .notice {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin: 1.5rem 0;
  border-left: 3px solid #631D1F;
  background: #faf8f5;
  font-size: 0.9rem;
  color: #4a4540;
}