/* ============================================================
   Истокмедиа — стили
   ============================================================ */

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #4a4f59;
  --muted: #8a909c;
  --line: #e6e6e2;
  --brand: #2a2f3a;          /* нейтральный графит (без красного) */
  --brand-dark: #16181d;
  --dark: #181b22;           /* тёмная полоса новостей */
  --dark-soft: #232733;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 24, 32, .08);
  --shadow-hover: 0 12px 34px rgba(20, 24, 32, .14);
  --maxw: 1180px;
  --gap: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* фолбэк-фон для блоков с фоновой картинкой, пока нет фото */
[style*="background-image"] {
  background-color: #d7dae0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============ ПРОМО-СТРОКА ============ */
.promo {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.promo__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
}
.promo__img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #d7dae0;
  flex: none;
}
.promo__text { display: flex; flex-direction: column; line-height: 1.25; }
.promo__text strong { font-size: 14px; font-weight: 700; }
.promo__text span { font-size: 13px; color: var(--muted); }
.promo__btn {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s ease;
}
.promo__btn:hover { background: var(--brand-dark); }
.promo__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.promo__close:hover { color: var(--ink); }
.promo.is-hidden { display: none; }

/* ============ ШАПКА ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.logo {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: .5px;
  color: var(--brand);
}
.logo:hover { color: var(--brand-dark); }

.header__tools { display: flex; align-items: center; gap: 16px; }

.socials { display: flex; gap: 8px; }
.soc {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ececed;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.soc:hover { background: var(--brand); color: #fff; }

.search-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ececed;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease;
}
.search-toggle:hover { background: #e0e0e0; }

.search-bar { padding: 0 0 12px; }
.search-bar[hidden] { display: none; }
.search-bar input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  outline: none;
  background: #fff;
}
.search-bar input:focus { border-color: var(--brand); }

.header__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0 14px;
  border-top: 1px solid var(--line);
}
.mainnav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.mainnav a {
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.mainnav a:hover { color: var(--brand); background: #eceef1; }

.socials--nav { margin-left: auto; }
.socials--header { display: flex; }

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: #ececed;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.burger span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ БОЛЬШАЯ ШАПКА (postnews-стиль: гигантский логотип) ============ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.masthead .container { padding-top: 14px; padding-bottom: 0; }
.masthead__logo {
  display: block;
  font-weight: 900;
  line-height: .82;
  letter-spacing: -.03em;
  color: var(--ink);
  font-size: clamp(28px, 8.2vw, 104px);
  white-space: nowrap;
  text-align: center;
}
.masthead__logo:hover { color: var(--ink); }
.masthead__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 0 12px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.masthead__bar .mainnav a {
  font-size: 16px;
  color: var(--ink);
  padding: 8px 10px;
}
.masthead__bar .mainnav a:hover { color: var(--ink-soft); background: transparent; }
.masthead__tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* ============ ОБЩЕЕ ============ */
main { padding: 26px 18px 40px; }

.section-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  text-transform: lowercase;
  margin: 34px 0 18px;
  letter-spacing: .3px;
}
.section-title--light { color: #fff; margin: 0; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--feature { grid-template-columns: 2fr 1fr; }

.pill {
  display: inline-block;
  align-self: flex-start;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: .4px;
  padding: 5px 12px;
  border-radius: 999px;
}

/* ============ ГЕРОЙ (postnews-сплит: заголовок слева + фото справа) ============ */
.hero { margin-top: 6px; }
.lead {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.lead:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.lead__text {
  padding: 40px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lead__tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 4px 11px;
  border-radius: 6px;
  margin-bottom: 18px;
}
.lead__title {
  font-size: clamp(26px, 3.6vw, 46px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.4px;
  margin: 0 0 16px;
  color: var(--ink);
}
.lead__dek {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}
.lead__media {
  min-height: 400px;
  background-size: cover;
  background-position: center;
  background-color: #d7dae0;
}
@media (max-width: 820px) {
  .lead { grid-template-columns: 1fr; }
  .lead__media { min-height: 240px; order: -1; }
  .lead__text { padding: 26px 22px; }
}

/* старый оверлей-герой (не используется на главной, оставлен для совместимости) */
.hero__card {
  position: relative;
  display: block;
  min-height: 440px;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #2a2f3a;
  box-shadow: var(--shadow);
}
.hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 34px;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.82) 100%);
  color: #fff;
}
.hero__title {
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  max-width: 900px;
}
.hero__desc {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.5;
  margin: 0;
  max-width: 760px;
  color: rgba(255,255,255,.9);
}

/* ============ КАРТОЧКИ ============ */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card__img {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: #d7dae0;
}
.card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.32;
  margin: 0;
  padding: 14px 16px 18px;
}
.card--pill { position: relative; }
.card--pill .pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.top-cards { margin-top: 22px; }

/* ============ НОВОСТИ (тёмная полоса) ============ */
.news {
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 28px 30px;
  margin: 36px 0;
}
.news__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.see-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  transition: color .15s ease;
}
.see-all:hover { color: #fff; }
.news__list { list-style: none; margin: 0; padding: 0; }
.news__item {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
.news__item:first-child { border-top: 0; }
.news__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.news__meta i { font-style: normal; color: var(--brand); }
.news__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  transition: color .15s ease;
}
.news__title:hover { color: #c7ccd6; }

/* ============ В ФОКУСЕ ============ */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature__text {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature__title {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.22;
  margin: 0 0 12px;
}
.feature__desc {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}
.feature__img {
  min-height: 260px;
  background-size: cover;
  background-position: center;
  background-color: #d7dae0;
}

.quiz {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  padding: 28px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.quiz:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quiz .pill { background: rgba(255,255,255,.22); }
.quiz__title {
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 800;
  line-height: 1.22;
  margin: 0;
}
.quiz--wide {
  margin: var(--gap) 0;
  background: linear-gradient(135deg, #2b2f3a 0%, #11141b 100%);
  text-align: center;
  align-items: center;
}

/* ============ КНОПКА "БОЛЬШЕ" ============ */
.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px auto 0;
  padding: 14px 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.more-btn:hover { background: #eceef1; border-color: var(--brand); color: var(--brand); }
.more-btn.is-loading { opacity: .6; pointer-events: none; }

/* ============ РАЗДЕЛЫ (NYT-стиль: колонки по рубрикам) ============ */
.sections { margin: 44px 0; }
.sections__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.scol { padding: 0 22px; border-left: 1px solid var(--line); }
.scol:first-child { padding-left: 0; border-left: 0; }
.scol:last-child { padding-right: 0; }
.scol__title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.scol__item { padding: 12px 0; border-top: 1px solid var(--line); }
.scol__item:first-of-type { border-top: 0; padding-top: 2px; }
.scol__item a {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink);
  transition: color .15s ease;
}
.scol__item a:hover { color: var(--ink-soft); }
.scol__dek {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 5px 0 0;
}
@media (max-width: 860px) {
  .sections__grid { grid-template-columns: repeat(2, 1fr); column-gap: 22px; row-gap: 8px; }
  .scol { border-left: 0; padding: 0; }
  .scol:nth-child(n+3) { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
}
@media (max-width: 520px) {
  .sections__grid { grid-template-columns: 1fr; }
  .scol:nth-child(n+2) { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
}

/* ============ ФУТЕР ============ */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.8);
  padding: 40px 18px;
  margin-top: 50px;
}
.footer__copy {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 900px;
  margin: 0 0 26px;
}
.footer__main {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer__logo { font-weight: 900; font-size: 24px; color: #fff; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__links a {
  font-size: 14px;
  color: rgba(255,255,255,.78);
  transition: color .15s ease;
}
.footer__links a:hover { color: #fff; }
.socials--footer { margin-left: auto; }
.socials--footer .soc { background: rgba(255,255,255,.1); color: #fff; }
.socials--footer .soc:hover { background: var(--brand); }
.footer__info { padding-top: 18px; font-size: 12px; color: var(--muted); }

/* ============ АФИША ============ */
.afisha-intro {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 780px;
  margin: 0 0 22px;
}
.afisha-sub {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 40px 0 18px;
}
.afisha-sub__title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: .3px;
  margin: 0;
}
.afisha-sub__note { font-size: 14px; color: var(--muted); }

.afisha-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.event {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.event:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.event__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center top;
  background-color: #d7dae0;
}
.event__cat {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.event__date {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.event__body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
  margin: 0;
}
.event__desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}
.event__meta {
  list-style: none;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event__meta li {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.event__meta b {
  flex: none;
  min-width: 62px;
  font-weight: 600;
  color: var(--muted);
}

/* ============ АДАПТИВ ============ */
@media (max-width: 980px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .afisha-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .socials--header { display: none; }
  .burger { display: flex; }
  .header__nav {
    position: relative;
    flex-wrap: wrap;
  }
  .mainnav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 2px;
    padding: 8px 0;
  }
  .mainnav.is-open { display: flex; }
  .mainnav a { padding: 12px; border-radius: 8px; }
  .socials--nav { margin-left: 0; }
  .grid--feature { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature__img { min-height: 220px; order: -1; }
}

@media (max-width: 680px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .afisha-grid { grid-template-columns: repeat(2, 1fr); }
  .promo__btn { margin-left: 0; }
  .promo__inner { flex-wrap: wrap; }
  .hero__card { min-height: 340px; }
  .hero__overlay { padding: 22px; }
  .news { padding: 22px 18px; }
}

@media (max-width: 420px) {
  .header__tools .socials { display: none; }
}

/* nav hover pill outline (postnews-style) */
.masthead__bar .mainnav a{border:2px solid transparent;transition:all .2s ease-in-out}
.masthead__bar .mainnav a:hover{border-color:var(--ink);background:transparent;color:var(--ink)}

/* news hover: white text-highlight (marker), like postnews */
.news__title{-webkit-box-decoration-break:clone;box-decoration-break:clone;transition:background .12s ease,color .12s ease}
.news__item:hover .news__title{background:#fff;color:#14171c;box-shadow:5px 0 0 #fff,-5px 0 0 #fff}

/* ===== МОБИЛЬНЫЕ ФИКСЫ (шапка/оверфлоу) ===== */
@media (max-width: 700px){
  html, body { overflow-x: hidden; max-width: 100%; }
  .masthead .container { padding-left: 14px; padding-right: 14px; }
  .masthead__logo { font-size: clamp(20px, 6.4vw, 26px); letter-spacing: -.02em; }
  .masthead__bar { gap: 8px; padding: 8px 0 10px; }
  .masthead__tools { gap: 8px; }
  .socials--nav { gap: 6px; }
  .burger { width: 38px; height: 38px; }
  .search-toggle { width: 34px; height: 34px; }
}
/* убрать уродливую синюю подсветку тапа на мобиле */
a, button, .card, .news__item, .list-card, .pn-news__item, .masthead__logo { -webkit-tap-highlight-color: rgba(0,0,0,0); }
/* ===== Мобильное меню — тёмная шторка (как postnews) ===== */
@media (max-width: 860px){
  body.menu-open{ overflow: hidden; }
  body.menu-open::before{ content:""; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:150; }
  body.menu-open .masthead{ z-index:300; }
  /* как на postnews: в шапке на мобиле только бургер + логотип + поиск */
  .masthead__tools .socials--nav{ display:none; }
  .mainnav{
    position:fixed; top:0; left:0; bottom:0;
    width:min(80vw, 330px);
    background:#0f0f10;
    display:flex; flex-direction:column; align-items:flex-start;
    gap:2px; margin:0; padding:86px 26px 100px;
    transform:translateX(-102%);
    transition:transform .28s ease;
    z-index:200; overflow-y:auto; border:0;
  }
  .mainnav.is-open{ transform:translateX(0); }
  .masthead__bar .mainnav a{
    color:#fff; font-size:25px; font-weight:800;
    padding:11px 0; border-radius:0; letter-spacing:-.01em;
    text-transform:lowercase; width:auto; background:transparent;
  }
  .masthead__bar .mainnav a:active{ color:#9aa2ad; background:transparent; }
  .burger{ position:relative; z-index:210; }
  .burger.is-open{ background:transparent; }
  .burger.is-open span{ background:#fff; }
  body.menu-open .socials--nav{ position:fixed; left:26px; bottom:34px; z-index:210; display:flex; gap:12px; margin:0; }
  body.menu-open .socials--nav .soc{ background:rgba(255,255,255,.14); color:#fff; width:40px; height:40px; }
}

/* counters: static in footer, no fixed overlap on mobile */
.im-counters{position:static!important;right:auto!important;left:auto!important;bottom:auto!important;top:auto!important;z-index:auto!important;display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap;padding:22px 14px 30px;line-height:0}
