/* ============================================================
   Демо-издание «Меридиан» — витрина форматов CPM Arena
   Editorial-стиль (light, книжный). Отдельный визуальный язык
   от лендинга. Локальные демо-креативы, без внешних запросов.
   Префикс .m-  (Meridian)
   ============================================================ */
:root {
  --m-ink: #14110f;
  --m-ink-soft: #4a443e;
  --m-mute: #8a8178;
  --m-paper: #fbf9f5;
  --m-paper-2: #f2ede4;
  --m-line: rgba(20, 17, 15, 0.12);
  --m-accent: #a3352a;      /* editorial бордовый */
  --m-accent-2: #1f6f6a;    /* приглушённый teal */
  --m-serif: ui-serif, Georgia, "Times New Roman", "Iowan Old Style", serif;
  --m-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --m-maxw: 720px;
  --m-wide: 1180px;
  --m-ad: #2f7bff; /* бренд-акцент CPM Arena для меток «Реклама» */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--m-paper); color: var(--m-ink);
  font-family: var(--m-serif); line-height: 1.7;
  font-size: 1.16rem; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.m-lock { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, ul { margin: 0; }
:focus-visible { outline: 2px solid var(--m-accent); outline-offset: 3px; }
.m-skip { position: absolute; left: 16px; top: -80px; z-index: 300; background: var(--m-ink); color: #fff; padding: 12px 18px; border-radius: 8px; text-decoration: none; font-family: var(--m-sans); font-weight: 600; transition: top .2s; }
.m-skip:focus { top: 16px; }

/* ---------- Верхняя техническая полоса CPM Arena ---------- */
.m-demobar {
  background: #0a0e17; color: #c3cbe0; font-family: var(--m-sans);
  font-size: 0.82rem; padding: 9px 20px; display: flex; gap: 14px; align-items: center; justify-content: center;
  flex-wrap: wrap; text-align: center;
}
.m-demobar strong { color: #fff; }
.m-demobar a { color: #35d0ba; text-decoration: none; font-weight: 600; }
.m-demobar a:hover { text-decoration: underline; }

/* ---------- Шапка издания ---------- */
.m-masthead { border-bottom: 1px solid var(--m-line); background: var(--m-paper); }
.m-masthead-top { max-width: var(--m-wide); margin: 0 auto; padding: 22px 24px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.m-logo { font-family: var(--m-serif); font-weight: 700; font-size: 2rem; letter-spacing: -0.02em; text-decoration: none; color: var(--m-ink); display: inline-flex; align-items: center; gap: 10px; }
.m-logo svg { width: 30px; height: 30px; }
.m-date { font-family: var(--m-sans); font-size: 0.8rem; color: var(--m-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.m-nav { border-top: 1px solid var(--m-line); }
.m-nav-inner { max-width: var(--m-wide); margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.m-nav-inner a { font-family: var(--m-sans); font-size: 0.9rem; font-weight: 600; padding: 14px 14px; color: var(--m-ink-soft); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.m-nav-inner a:hover, .m-nav-inner a[aria-current] { color: var(--m-accent); border-bottom-color: var(--m-accent); }

/* ---------- Статья ---------- */
.m-article { max-width: var(--m-wide); margin: 0 auto; padding: 40px 24px 80px; }
.m-kicker { font-family: var(--m-sans); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--m-accent); margin-bottom: 16px; }
.m-title { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; max-width: 16ch; }
.m-standfirst { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem); line-height: 1.5; color: var(--m-ink-soft); max-width: var(--m-maxw); margin-top: 20px; }
.m-byline { font-family: var(--m-sans); font-size: 0.9rem; color: var(--m-mute); margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.m-byline .m-author { color: var(--m-ink); font-weight: 600; }

.m-cover { margin: 36px 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--m-line); }
.m-cover-art { aspect-ratio: 16/8; position: relative; background: linear-gradient(135deg, #1c2b3a, #0f1620 55%, #24303d); }
.m-cover-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-cover figcaption { font-family: var(--m-sans); font-size: 0.82rem; color: var(--m-mute); padding: 10px 14px; background: var(--m-paper-2); }

/* колонка текста */
.m-body { max-width: var(--m-maxw); margin: 0 auto; }
.m-body > p { margin: 0 0 26px; }
.m-body > p:first-of-type::first-letter {
  font-size: 3.6em; float: left; line-height: 0.82; padding: 6px 10px 0 0; font-weight: 700; color: var(--m-accent);
}
.m-body h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; margin: 44px 0 18px; letter-spacing: -0.01em; }
.m-body h3 { font-size: 1.3rem; margin: 32px 0 12px; }
.m-body blockquote { margin: 34px 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--m-accent); font-size: 1.4rem; line-height: 1.4; font-style: italic; color: var(--m-ink); }
.m-body figure.m-inline-img { margin: 34px 0; }
.m-body figure.m-inline-img .m-imgbox { aspect-ratio: 16/9; border-radius: 6px; background: linear-gradient(120deg, #26333f, #131b24); border: 1px solid var(--m-line); }
.m-body figure.m-inline-img figcaption { font-family: var(--m-sans); font-size: 0.82rem; color: var(--m-mute); margin-top: 8px; }
.m-body a.m-textlink { color: var(--m-accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* доп. материалы */
.m-related { max-width: var(--m-maxw); margin: 56px auto 0; padding-top: 32px; border-top: 1px solid var(--m-line); }
.m-related h2 { font-family: var(--m-sans); font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--m-mute); margin-bottom: 18px; }
.m-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.m-related-card { display: block; text-decoration: none; color: inherit; }
.m-related-card .m-rc-img { aspect-ratio: 16/10; border-radius: 6px; background: linear-gradient(120deg, #2a3a34, #16201d); border: 1px solid var(--m-line); margin-bottom: 12px; }
.m-related-card h3 { font-size: 1.25rem; line-height: 1.25; }
.m-related-card:hover h3 { color: var(--m-accent); }

.m-loadmore { max-width: var(--m-maxw); margin: 40px auto 0; text-align: center; }
.m-btn { font-family: var(--m-sans); font-weight: 600; font-size: 1rem; padding: 14px 30px; border-radius: 999px; border: 1px solid var(--m-ink); background: transparent; color: var(--m-ink); cursor: pointer; transition: background .2s, color .2s; }
.m-btn:hover { background: var(--m-ink); color: var(--m-paper); }

/* ---------- Подвал издания ---------- */
.m-footer { background: var(--m-ink); color: #cfc8bf; font-family: var(--m-sans); margin-top: 80px; padding: 48px 24px; }
.m-footer-inner { max-width: var(--m-wide); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.m-footer a { color: #fff; text-decoration: none; }
.m-footer .m-fnote { font-size: 0.85rem; color: #9a9188; max-width: 46ch; }

/* ============================================================
   Рекламные слоты — только обёртка и подпись.
   Сами форматы (sticky/in-read + контролы/refresh/mobile full-width)
   рендерит ЖИВОЙ загрузчик CPM Arena в контейнерах [data-cpm-block].
   ============================================================ */
.m-inread { max-width: var(--m-maxw); margin: 40px auto; }
.m-adslot-note { font-family: var(--m-sans); font-size: 0.72rem; color: var(--m-mute); text-align: center; margin-top: 6px; letter-spacing: 0.04em; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 1.08rem; }
  .m-related-grid { grid-template-columns: 1fr; }
  .m-body > p:first-of-type::first-letter { font-size: 3em; }
}
