/* МИА medfora.ru — газетная полоса v5 */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,600;6..72,700;6..72,800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #12151A;
  --ink-soft: #3D4654;
  --muted: #6B7585;
  --rule: #D4D9E0;
  --rule-dark: #9AA3B2;
  --paper: #FFFFFF;
  --wash: #F4F6F8;
  --accent: #B42318;
  --accent-hover: #8F1B13;
  --brand: #1B3A57;
  --brand-light: #2A5A82;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --max: 920px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--wash);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-light); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Masthead (horizontal) ── */
.masthead {
  background: var(--paper);
  border-bottom: 4px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  flex-wrap: wrap;
}

.site-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.site-logo:hover { color: inherit; }

.site-logo__main {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1.25;
  letter-spacing: -.01em;
}

.site-logo__main em {
  font-style: normal;
  color: var(--accent);
}

.site-logo__tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.masthead-nav a {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.masthead-nav a:hover,
.masthead-nav a.is-active {
  color: var(--brand);
  border-bottom-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
  flex-shrink: 0;
}

/* ── Main ── */
.main { flex: 1; padding: 32px 0 56px; }

.digest { max-width: var(--max); }

.page-head {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-dark);
}

.page-head__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 1.85rem);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -.02em;
}

.page-head__desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Digest list (newspaper rows) ── */
.digest-list {
  background: var(--paper);
  border: 1px solid var(--rule);
}

.digest-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}

.digest-item:last-child { border-bottom: none; }

.digest-item:hover { background: rgba(244,246,248,.6); }

.digest-item__when {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
  padding-top: 4px;
  border-right: 1px solid var(--rule);
  padding-right: 16px;
}

.digest-item__body {
  min-width: 0;
}

.digest-item__flag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: 6px;
}

.digest-item__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.digest-item__title a { color: var(--ink); }
.digest-item__title a:hover { color: var(--accent); }

.digest-item__lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.digest-item__photo {
  float: right;
  margin: 0 0 10px 16px;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.digest-item__photo img {
  width: 160px;
  height: 112px;
  object-fit: cover;
}

.digest-item__meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  clear: both;
}

/* Lead story — full-width block, no date column */
.digest-item--lead {
  display: block;
  padding: 0;
  border-bottom: 3px solid var(--brand);
}

.digest-item--lead:hover { background: var(--paper); }

.digest-item--lead .digest-item__when {
  display: block;
  border-right: none;
  padding: 20px 28px 0;
  font-size: 13px;
}

.digest-item--lead .digest-item__body {
  padding: 12px 28px 28px;
}

.digest-item--lead .digest-item__title {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  margin-bottom: 12px;
}

.digest-item--lead .digest-item__lead {
  font-size: 17px;
  line-height: 1.65;
  max-width: 68ch;
}

.digest-item--lead .digest-item__photo--lead {
  float: none;
  margin: 0 0 20px;
  display: block;
  border: none;
  border-bottom: 1px solid var(--rule);
}

.digest-item--lead .digest-item__photo--lead img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

.digest-item--marker .digest-item__title a {
  color: var(--brand);
}

/* ── Search ── */
.search-form-large {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.search-form-large input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--rule-dark);
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--paper);
}

.search-form-large input:focus {
  outline: none;
  border-color: var(--brand-light);
}

.search-form-large button {
  padding: 12px 22px;
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}

.search-form-large button:hover { background: var(--brand-light); }

.search-results__count {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.search-hit {
  background: #FEF08A;
  padding: 0 2px;
  font-weight: 600;
}

/* ── Article view ── */
.container--article { max-width: var(--max); }

.article-view { padding-bottom: 40px; }

.article-header__back {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
}

.article-card {
  background: var(--paper);
  border: 1px solid var(--rule);
}

.article-header {
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--rule);
}

.article-header__top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.article-header__date { font-size: 13px; color: var(--muted); font-weight: 600; }

.article-header__badges { display: flex; gap: 8px; flex-wrap: wrap; }

.article-header__title {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 800;
  line-height: 1.22;
  color: var(--brand);
  letter-spacing: -.02em;
}

.article-header__lead {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 16px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.article-header__author {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.article-hero-photo img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-content {
  padding: 28px 32px 36px;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.75;
}

.article-content p { margin-bottom: 1.1em; }
.article-content img { margin: 1em 0; }
.article-content a { color: var(--brand-light); text-decoration: underline; }

.article-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  letter-spacing: .04em;
}

.article-badge--ad { background: #FEF3C7; color: #92400E; }
.article-badge--author { background: rgba(27,58,87,.08); color: var(--brand); }

.article-age-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border: 1px solid var(--rule);
}

/* ── About ── */
.about-content {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 28px 32px;
}

.about-content h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--brand);
  margin: 22px 0 10px;
}

.about-content h2:first-child { margin-top: 0; }

.about-content p { margin-bottom: 12px; }

.about-content .highlight { color: var(--accent); font-weight: 600; }

.constitution {
  border-left: 3px solid var(--brand-light);
  padding: 14px 18px;
  background: var(--wash);
  margin: 14px 0;
}

/* ── Pagination & misc ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pagination a, .pagination__current {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--rule);
  font-weight: 600;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
}

.pagination a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination__current { background: var(--brand); color: #fff; border-color: var(--brand); }

.news-more { text-align: center; margin-top: 24px; font-weight: 600; font-size: 14px; }
.news-empty { text-align: center; color: var(--muted); padding: 40px 0; }

.partners {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.partners__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.partners__list { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.partners__list img { height: 40px; width: auto; opacity: .75; }
.partners__list a:hover img { opacity: 1; }

/* ── Footer ── */
.site-footer {
  background: var(--brand);
  color: rgba(255,255,255,.9);
  padding: 32px 0 24px;
  margin-top: auto;
}

.site-footer a { color: #fff; }
.footer__brand { font-weight: 600; margin-bottom: 12px; font-size: 14px; }
.footer__legal, .footer__contacts { font-size: 12px; line-height: 1.7; opacity: .85; margin-bottom: 14px; }
.footer__bottom {
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 12px;
  opacity: .7;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.footer__feeds a { color: rgba(255,255,255,.85); }
.footer__feeds a:hover { color: #fff; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .masthead__inner {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .site-logo { flex: 1; }

  .menu-toggle { display: block; }

  .masthead-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 16px;
    top: calc(100% - 4px);
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    min-width: 160px;
  }

  .masthead-nav.is-open { display: flex; }

  .masthead-nav a {
    border-bottom: none;
    width: 100%;
  }

  .masthead { position: relative; }

  .digest-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 16px;
  }

  .digest-item__when {
    border-right: none;
    padding-right: 0;
    padding-top: 0;
  }

  .digest-item--lead .digest-item__when,
  .digest-item--lead .digest-item__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .digest-item__photo {
    float: none;
    margin: 0 0 12px;
    display: block;
  }

  .digest-item__photo img { width: 100%; height: auto; max-height: 200px; }

  .article-header, .article-content { padding: 20px 16px; }
  .about-content { padding: 20px 16px; }
}