/* =====================================================================
   style-editorial.css — журнальная тема «Вестника»
   Антиква Literata для заголовков и текста статьи, гротеск Golos Text для интерфейса.
   ===================================================================== */

:root {
    --ink: #17191C;
    --text-2: #3A3F45;
    --muted: #5A6169;
    --rule: #E4E1DB;
    --rule-strong: #17191C;
    --placeholder: #E8E4DC;
    --accent: #1E5B47;          /* цвет рубрик и номеров; поменяйте здесь */

    --serif: 'Literata', Georgia, 'Times New Roman', serif;
    --sans: 'Golos Text', 'PT Sans', 'Segoe UI', sans-serif;

    --gap: 32px;
    --side-gap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body.ed {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font: 16px/1.5 var(--sans);
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}
.ed a { color: inherit; text-decoration: none; }
.ed a:hover .ed-title, .ed-h1 a:hover, .ed-crumbs a:hover, .ed-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ed a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ed img, .ed video { display: block; max-width: 100%; }

.ed-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Шапка ---------- */
.ed-header { border-bottom: 1px solid var(--rule-strong); }
.ed-utility { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.ed-masthead { padding: 28px 0 20px; text-align: center; }
.ed-logo { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 52px); line-height: 1; letter-spacing: -0.01em; }
.ed-tagline { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.ed-nav {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px;
    padding: 14px 0; border-top: 1px solid var(--rule);
    font-size: 15px; font-weight: 500;
}
.ed-nav a.is-active { color: var(--accent); }

/* ---------- Общие подписи ---------- */
.ed-kicker { display: block; font-size: 12px; font-weight: 600; color: var(--accent); }
.ed-kicker-lg { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.ed-ad {
    font-size: 11px; color: var(--muted); white-space: nowrap;
    border: 1px solid #C9C5BD; border-radius: 3px; padding: 1px 6px;
}
.ed-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ed-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.ed-title { display: block; font-family: var(--serif); font-weight: 600; line-height: 1.3; }

/* ---------- Медиа тизеров ---------- */
.ed-thumb, .ed-media { background: var(--placeholder); overflow: hidden; }
.ed-img { width: 100%; height: 100%; object-fit: cover; }
.ed-media { aspect-ratio: 4 / 3; }

/* Строки: миниатюра + текст */
.ed-row { display: flex; gap: 16px; align-items: center; }
.ed-row .ed-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-row .ed-thumb { flex: 0 0 120px; height: 90px; }

/* ---------- Полоса над статьёй ---------- */
.ed-strip-box { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.ed-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 32px; }
.ed-strip .ed-thumb { flex-basis: 88px; height: 66px; }
.ed-strip .ed-title { font-size: 17px; }

/* ---------- Основная сетка ---------- */
.ed-main { display: flex; flex-wrap: wrap; gap: var(--side-gap); align-items: flex-start; padding: 36px 0 8px; }
.ed-article { flex: 999 1 620px; min-width: 0; max-width: 760px; }
.ed-side { flex: 1 1 300px; min-width: 0; max-width: 380px; display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- Статья ---------- */
.ed-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.ed-h1 {
    font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.12; letter-spacing: -0.01em; margin: 10px 0 16px;
}
.ed-lead { font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--text-2); margin: 0 0 20px; }
.ed-meta {
    display: flex; flex-wrap: wrap; gap: 6px 18px;
    padding: 12px 0; margin-bottom: 28px;
    border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    font-size: 13px; color: var(--muted);
}
.ed-figure { margin: 0 0 32px; background: var(--placeholder); }
.ed-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.ed-body { font-family: var(--serif); font-size: 19px; line-height: 1.7; overflow-wrap: break-word; }
.ed-body > :first-child { margin-top: 0; }
.ed-body p, .ed-body ul, .ed-body ol, .ed-body blockquote { margin: 0 0 18px; }
.ed-body h1, .ed-body h2, .ed-body h3, .ed-body h4 { line-height: 1.25; margin: 32px 0 12px; }
.ed-body h1, .ed-body h2 { font-size: 26px; }
.ed-body h3 { font-size: 22px; }
.ed-body ul, .ed-body ol { padding-left: 1.3em; }
.ed-body li { margin-bottom: 8px; }
.ed-body a:not(.teaser-link) { color: var(--accent); text-decoration: underline; }
.ed-body img { height: auto; }
.ed-body blockquote { padding-left: 18px; border-left: 3px solid var(--rule); color: var(--text-2); }

/* «Читайте также» внутри текста и после него */
.ed-block { font-family: var(--sans); }
.ed-inline-block { margin: 32px 0; padding: 16px 0; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.ed-article > .ed-inline-block:last-child { margin-bottom: 0; }
.ed-inline-block .ed-title { font-size: 19px; }

/* Превью-страница */
.ed-preview .ed-h1 a { color: inherit; }
.ed-button {
    display: inline-block; padding: 12px 22px; border-radius: 3px;
    background: var(--ink); color: #fff !important; font-weight: 600; font-size: 15px;
}
.ed-button:hover { background: #000; }
.ed-preview .ed-button { margin-bottom: 8px; }

/* ---------- Колонка ---------- */
.ed-card { display: flex; flex-direction: column; gap: 10px; }
.ed-side-feature .ed-title { font-size: 22px; line-height: 1.25; }

.ed-section-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding-bottom: 10px; margin-bottom: 24px; border-bottom: 2px solid var(--rule-strong);
}
.ed-section-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.ed-section-head-sm { margin-bottom: 0; }
.ed-section-head-sm h2 { font-size: 22px; }

.ed-popular-list { counter-reset: popular; }
.ed-popular {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.ed-popular .ed-num { flex: 0 0 28px; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; color: var(--accent); }
.ed-popular .ed-num::before { counter-increment: popular; content: counter(popular); }
.ed-popular .ed-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-popular .ed-kicker { color: var(--muted); }
.ed-popular .ed-title { font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.35; }
.ed-popular .ed-thumb { flex: 0 0 72px; height: 72px; }

/* ---------- Блоки под статьёй ---------- */
.ed-section { padding-top: 48px; }
.ed-partners { display: flex; flex-wrap: wrap; gap: var(--gap); }
.ed-partners-main { flex: 1 1 480px; min-width: 0; }
.ed-partners-main .ed-title { font-size: 28px; font-weight: 700; line-height: 1.2; }
.ed-partners-list { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; }
.ed-partners-list .ed-row { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ed-partners-list .ed-row:first-child { padding-top: 0; }
.ed-partners-list .ed-title { font-size: 18px; }

.ed-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); }
.ed-cards .ed-title { font-size: 20px; }

.ed-feed .ed-row { gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.ed-feed .ed-thumb { flex: 0 0 clamp(112px, 22%, 220px); height: auto; aspect-ratio: 4 / 3; }
.ed-feed .ed-text { gap: 6px; }
.ed-feed .ed-title { font-size: clamp(17px, 1.8vw, 22px); }

#end-of-content-sentinel { height: 1px; }

/* ---------- Подгрузка ---------- */
.ed .loading-spinner { padding: 24px 0; text-align: center; color: var(--muted); font-size: 14px; }
.ed .loader, .ed .loader-small {
    margin: 0 auto 8px; border: 3px solid #eee; border-top-color: var(--accent);
    border-radius: 50%; animation: ed-spin 1s linear infinite;
}
.ed .loader { width: 28px; height: 28px; }
.ed .loader-small { width: 18px; height: 18px; margin-top: 12px; }
@keyframes ed-spin { to { transform: rotate(360deg); } }

/* ---------- Подвал и 404 ---------- */
.ed-footer { margin-top: 64px; border-top: 1px solid var(--rule-strong); }
.ed-footer-inner {
    display: flex; flex-wrap: wrap; gap: 20px 48px; justify-content: space-between; align-items: flex-end;
    padding-top: 28px; padding-bottom: 36px; font-size: 13px; color: var(--muted);
}
.ed-footer-about { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.ed-footer-name { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); }
.ed-404 { padding: 64px 24px; text-align: center; }

/* =====================================================================
   Телефоны
   ===================================================================== */
@media (max-width: 768px) {
    :root { --gap: 24px; --side-gap: 32px; }
    .ed-container { padding: 0 16px; }
    .ed-masthead { padding: 20px 0 14px; }
    .ed-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 22px; scrollbar-width: none; }
    .ed-nav::-webkit-scrollbar { display: none; }
    .ed-nav a { white-space: nowrap; }
    .ed-main { padding-top: 24px; }
    .ed-side { max-width: none; }
    .ed-lead { font-size: 18px; }
    .ed-body { font-size: 17px; }
    .ed-body h1, .ed-body h2 { font-size: 22px; }
    .ed-figure img { aspect-ratio: 4 / 3; }
    .ed-row .ed-thumb { flex-basis: 96px; height: 72px; }
    .ed-strip { grid-template-columns: minmax(0, 1fr); }
    .ed-strip .ed-title, .ed-inline-block .ed-title { font-size: 16px; }
    .ed-partners-main .ed-title { font-size: 22px; }
    .ed-partners-list .ed-title, .ed-cards .ed-title { font-size: 17px; }
    .ed-section { padding-top: 36px; }
    .ed-section-head h2 { font-size: 22px; }
    .ed-feed .ed-row { gap: 14px; padding: 14px 0; }
}

/* ---------- «Читайте также»: 4 статьи сайта в ряд ---------- */
.read-also-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.read-also-item { display: flex; flex-direction: column; gap: 10px; }
.read-also-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--placeholder); }
.read-also-img img { width: 100%; height: 100%; object-fit: cover; }
.read-also-cat { font-size: 12px; font-weight: 600; color: var(--accent); }
.read-also-title { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.read-also-item:hover .read-also-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (max-width: 1024px) { .read-also-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .read-also-grid { gap: 16px; } .read-also-title { font-size: 16px; } }

/* Источник под текстом статьи */
.ed-source { margin: 24px 0 0; font-family: var(--serif); font-size: 17px; font-style: italic; color: var(--text-2); }
.ed-source a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 768px) { .ed-source { font-size: 15px; } }
