/* Дизайн-токены журнала soundex — светлая тема из макета «Soundex Журнал» */
:root {
  --color-bg: #ffffff;
  --color-surface: #f4f4f6;
  --color-text: #14141a;
  --color-accent: #177ec9;
  --color-divider: rgba(20, 20, 26, 0.14);
  --color-neutral-100: #f4f4f6;
  --color-neutral-200: #e9e9ee;
  --color-neutral-300: #d7d8de;
  --color-neutral-400: #b8bac3;
  --color-neutral-500: #8d8f9b;
  --color-neutral-600: #6b6d78;
  --color-neutral-700: #4c4e57;
  --color-neutral-800: #2e2f36;
  --color-neutral-900: #14141a;
  --color-accent-100: #e9f3fb;
  --color-accent-200: #cbe5f6;
  --color-accent-300: #97cbee;
  --color-accent-400: #4da4dc;
  --color-accent-500: #177ec9;
  --color-accent-600: #1265a1;
  --color-accent-700: #0d4a78;
  --color-accent-800: #093351;
  --color-accent-900: #051e30;
  --shadow-sm: 0 0 0 1px rgba(20, 20, 26, 0.10);
  --shadow-md: 0 0 0 1px rgba(20, 20, 26, 0.10), 0 6px 18px rgba(20, 20, 26, 0.10);
  --shadow-lg: 0 0 0 1px rgba(20, 20, 26, 0.12), 0 16px 40px rgba(20, 20, 26, 0.16);
  --font-heading: "Inter Variable", "Inter", system-ui, sans-serif;
  --font-body: "Inter Variable", "Inter", system-ui, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent-700); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.wrap { max-width: 1320px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* — кнопки — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: 500;
  font-size: 13.5px; line-height: 1.2;
  height: 34px; padding: 0 14px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text);
  white-space: nowrap;
}
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-solid { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn-solid:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); color: #fff; }
.btn-primary:hover { background: var(--color-accent-100); color: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: rgba(20,20,26,0.05); }
.btn-ghost { color: var(--color-neutral-700); border-color: var(--color-neutral-300); }
.btn-ghost:hover { background: var(--color-neutral-100); color: var(--color-accent-700); }
.btn[aria-current="page"] { color: var(--color-accent); border-color: var(--color-accent); }

/* — теги / чипы — */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.04em;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-700); }
.tag-neutral { background: var(--color-neutral-200); color: var(--color-neutral-800); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 13px; border: 1px solid var(--color-accent-300);
  color: var(--color-accent-700);
}
.chip:hover { background: var(--color-accent-100); }
.chip.active { background: var(--color-accent-100); border-color: var(--color-accent-300); }
.chip .n { opacity: 0.55; font-variant-numeric: tabular-nums; }

/* — сегмент-переключатель — */
.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--color-divider); border-radius: var(--radius-md); }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; cursor: default; color: var(--color-neutral-700); }
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt.active { background: var(--color-accent-100); color: var(--color-accent-700); }

/* — карточка — */
.card {
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-bg); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

/* — шапка — */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 34px; font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-neutral-600);
}
.header-row { display: flex; align-items: center; gap: 36px; height: 62px; }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--color-text); }
.brand b { font-family: var(--font-heading); font-weight: 600; font-size: 27px; letter-spacing: -0.02em; }
.brand span { font-size: 12px; color: var(--color-accent); letter-spacing: 0.1em; }
.main-nav { display: flex; align-items: stretch; gap: 2px; height: 62px; flex: 1; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a {
  padding: 0 12px; height: 32px; display: inline-flex; align-items: center;
  border-radius: var(--radius-sm); font-size: 14.5px; white-space: nowrap;
  color: var(--color-neutral-800);
}
.nav-item > a:hover { color: var(--color-accent-700); }
.nav-item > a[aria-current="true"] { color: var(--color-accent-600); font-weight: 500; }
.nav-accent > a { color: var(--color-accent-600); font-weight: 500; }
.nav-drop {
  position: absolute; top: 52px; left: -4px; min-width: 250px; padding: 8px;
  background: var(--color-bg); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none; flex-direction: column; z-index: 50;
}
.nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop { display: flex; }
.nav-drop a {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--color-neutral-800); font-size: 14px;
}
.nav-drop a:hover { background: var(--color-accent-100); color: var(--color-accent-700); }
.nav-drop .n { font-size: 11.5px; color: var(--color-neutral-500); font-variant-numeric: tabular-nums; }
.search-stub {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 34px;
  border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md);
  color: var(--color-neutral-600); width: 170px; font-size: 13.5px;
}

/* — секции — */
.sec-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 26px; letter-spacing: -0.02em; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; }
.sec-more { font-size: 13px; color: var(--color-accent-600); }
.sec-more:hover { color: var(--color-accent-700); }
.side-title {
  margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 15px;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.side-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 12px; border-bottom: 1px solid var(--color-divider);
}
.rubric-label {
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent-600);
}
.rubric-label.muted { color: var(--color-neutral-600); }
.imgbox { position: relative; width: 100%; overflow: hidden; background: var(--color-neutral-100); border-radius: var(--radius-md); }
.imgbox img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.imgbox.noimg::after {
  content: "soundex"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-neutral-300); font-family: var(--font-heading);
  font-weight: 600; font-size: 22px; letter-spacing: -0.02em;
}
.meta { font-size: 13px; color: var(--color-neutral-600); }

/* — статья — */
.prose { font-size: 17.5px; line-height: 1.65; color: var(--color-neutral-900); }
.prose p { margin: 0 0 22px; }
.prose h2 { margin: 36px 0 16px; font-family: var(--font-heading); font-weight: 500; font-size: 26px; letter-spacing: -0.02em; }
.prose h3 { margin: 28px 0 12px; font-family: var(--font-heading); font-weight: 500; font-size: 21px; }
.prose a { color: var(--color-accent-600); }
.prose a:hover { color: var(--color-accent-700); }
.prose blockquote {
  margin: 32px 0; padding-left: 26px; border-left: 2px solid var(--color-accent);
  font-family: var(--font-heading); font-size: 24px; line-height: 1.3; color: var(--color-text);
}
.prose blockquote p { margin: 0 0 10px; }
.prose img { border-radius: var(--radius-md); height: auto; background: var(--color-neutral-100); }
.prose figure { margin: 32px 0; }
.prose figcaption { font-size: 12.5px; color: var(--color-neutral-500); margin-top: 8px; }
.prose iframe { max-width: 100%; border: 0; border-radius: var(--radius-md); }
/* видео из статей: в WordPress плеер обёрнут в контейнер старой темы (jeg_video_container),
   её стилей у нас нет — поэтому делаем вставку адаптивной сами, 16:9 на всю ширину */
.prose .wp-block-embed { margin: 32px 0; }
.prose .jeg_video_container iframe,
.prose .wp-block-embed__wrapper > iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}
.prose table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--color-divider); }
.prose th { font-weight: 500; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-neutral-600); }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }

.crumbs { font-size: 12.5px; color: var(--color-neutral-500); margin-bottom: 18px; }
.crumbs a { color: var(--color-neutral-500); }
.crumbs a:hover { color: var(--color-accent-700); }

/* — адаптив — */
@media (max-width: 1024px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .wrap > section { max-width: 100%; overflow-x: clip; }
  .full-bleed { margin-left: -20px !important; margin-right: -20px !important; }
  .grid-hero, .grid-main-side, .grid-3, .grid-4, .grid-article { grid-template-columns: 1fr !important; }
  .main-nav { overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .search-stub { display: none; }
  .topbar span.tagline { display: none; }
  .article-side { position: static !important; }
}
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr !important; }
  .header-row { gap: 16px; }
  h1 { font-size: 32px !important; }
}

/* — единая карточная система — */
.card-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 17px; line-height: 1.3; text-wrap: pretty; }
.card-title-lg { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* — кнопка play на видеообложках — */
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(23, 126, 201, 0.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.play-badge::after {
  content: ""; margin-left: 4px;
  border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.video-cover img { filter: saturate(0.85); }
.video-cover::before { content: ""; position: absolute; inset: 0; background: rgba(20,20,26,0.18); z-index: 1; }
.video-cover .play-badge { z-index: 2; }

/* — список «Главное» справа от героя — */
.lead-list a { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid rgba(20,20,26,0.10); }
.lead-list .t { font-size: 12px; color: var(--color-neutral-500); font-variant-numeric: tabular-nums; padding-top: 3px; }
.lead-list .h { font-size: 15px; font-weight: 500; line-height: 1.4; text-wrap: pretty; font-family: var(--font-heading); }

/* — события — */
.event-row { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid rgba(20,20,26,0.10); }
.event-row .d { font-family: var(--font-heading); font-size: 23px; font-weight: 500; line-height: 1; }
.event-row .m { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent-600); }

/* — форум «сейчас обсуждают» — */
.topic-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 15px 0; border-bottom: 1px solid rgba(20,20,26,0.10); }
.topic-row .n { font-size: 13px; color: var(--color-neutral-600); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* — анимации в духе porsche.com: проявление при скролле, мягкий зум — */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal.in { opacity: 1; transform: none; }

  .imgbox img { transition: transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1); will-change: transform; }
  .imgbox.reveal-img img { transform: scale(1.09); }
  .imgbox.reveal-img.in img { transform: scale(1); }
  a:hover .imgbox img, a:focus-visible .imgbox img { transform: scale(1.045) !important; }
}

/* — комментарии (собственный рендер ветки форума) — */
.cmt { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(20,20,26,0.08); }
.cmt-ava { border-radius: 50%; width: 40px; height: 40px; object-fit: cover; background: var(--color-neutral-200); }
.cmt-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.cmt-head b { font-size: 14px; font-family: var(--font-heading); font-weight: 600; }
.cmt-head span { font-size: 12px; color: var(--color-neutral-500); }
.cmt-text { font-size: 15px; line-height: 1.55; color: var(--color-neutral-900); overflow-wrap: anywhere; }
.cmt-text p { margin: 0 0 10px; }
.cmt-text p:last-child { margin-bottom: 0; }
.cmt-text img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.cmt-text img.emoji { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; border-radius: 0; }
.cmt-text blockquote, .cmt-text aside.quote {
  margin: 10px 0; padding: 8px 14px; border-left: 2px solid var(--color-accent-300);
  background: var(--color-neutral-100); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px; color: var(--color-neutral-700);
}
.cmt-text aside.quote .title { font-size: 12px; color: var(--color-neutral-500); margin-bottom: 4px; }
.cmt-text a { color: var(--color-accent-600); }
.cmt-text .lightbox-wrapper .meta { display: none; }

/* — свёрнутые комментарии — */
.cmt-text.cmt-collapsed { max-height: 132px; overflow: hidden; position: relative; }
.cmt-text.cmt-collapsed::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--color-bg));
}
.cmt-expand {
  margin-top: 8px; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--color-accent-600);
}
.cmt-expand:hover { color: var(--color-accent-700); }

/* — тёмная тема: автоматически по системе, вручную через переключатель — */
html.dark {
  --color-bg: #14161c;
  --color-surface: #1d2028;
  --color-text: #e9e9ed;
  --color-divider: rgba(233, 233, 237, 0.14);
  --color-neutral-100: #1d2028;
  --color-neutral-200: #262a33;
  --color-neutral-300: #363b47;
  --color-neutral-400: #565c6b;
  --color-neutral-500: #8b91a0;
  --color-neutral-600: #a6abb8;
  --color-neutral-700: #c3c7d1;
  --color-neutral-800: #dcdee5;
  --color-neutral-900: #e9e9ed;
  --color-accent: #4da4dc;
  --color-accent-100: #10202e;
  --color-accent-200: #143049;
  --color-accent-300: #1c476b;
  --color-accent-400: #2b6da3;
  --color-accent-500: #4da4dc;
  --color-accent-600: #6fb6e4;
  --color-accent-700: #97cbee;
  --color-accent-800: #c3e1f6;
  --color-accent-900: #e9f3fb;
  --shadow-sm: 0 0 0 1px rgba(233, 233, 237, 0.10);
  --shadow-md: 0 0 0 1px rgba(233, 233, 237, 0.10), 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 0 0 1px rgba(233, 233, 237, 0.12), 0 16px 40px rgba(0, 0, 0, 0.55);
}
html.dark .site-header { background: rgba(20, 22, 28, 0.92); }
html.dark .logo-light { display: none !important; }
html.dark .logo-dark { display: block !important; }
html.dark .imgbox.noimg::after { color: var(--color-neutral-300); }
html.dark .cmt-text.cmt-collapsed::after { background: linear-gradient(to bottom, rgba(20,22,28,0), var(--color-bg)); }
html.dark .btn-solid { color: #fff; }
.theme-toggle {
  background: none; border: 0; cursor: pointer; padding: 6px;
  border-radius: var(--radius-sm); color: var(--color-neutral-600);
  display: inline-flex; align-items: center;
}
.theme-toggle:hover { color: var(--color-accent-600); }

/* — мобильное меню — */
.burger { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--color-divider); border-radius: var(--radius-sm, 8px); background: transparent; color: var(--color-neutral-800); cursor: pointer; }
.mobile-menu { display: none; }
@media (max-width: 700px) {
  .main-nav { display: none; }
  .burger { display: flex; }
  .header-row .btn.btn-solid { display: none; } /* «Подписка» переезжает в меню */
  .mobile-menu {
    display: block; position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 1000;
    margin-top: 0; padding: 104px 20px 24px; overflow-y: auto;
    background: var(--color-bg, #fff);
  }
  .mobile-menu[hidden] { display: none; }
  body.mm-open { overflow: hidden; }
  body.mm-open .site-header { position: relative; z-index: 1001; background: var(--color-bg, #fff); }
  .mm-nav { display: flex; flex-direction: column; }
  .mm-group { border-bottom: 1px solid var(--color-divider); padding: 4px 0; }
  .mm-link { display: block; padding: 14px 0; font-family: var(--font-heading); font-size: 21px; font-weight: 500; color: var(--color-neutral-900); }
  .mm-accent { color: var(--color-accent-600); }
  .mm-kids { padding: 0 0 12px 14px; display: flex; flex-direction: column; gap: 2px; }
  .mm-kids a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; color: var(--color-neutral-700); }
  .mm-kids .n { color: var(--color-neutral-400); font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .mm-foot { display: flex; gap: 22px; padding-top: 18px; }
  .mm-foot a { font-size: 14px; color: var(--color-neutral-600); }
}
