/*
Theme Name: DeFi Masters Network
Theme URI: https://blog.defimasters.network
Author: DMN
Author URI: https://defimasters.network
Description: Тема блога DMN. Использует тот же дизайн-систему что и главный сайт defimasters.network — токены, шрифт Inter, единый nav и footer.
Version: 2.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dmn-theme
Tags: dark, custom, blog
*/

/* ================================
   TOKENS
   ================================ */
:root {
  /* Brand */
  --orange:       #E8643A;
  --orange-hot:   #FF7548;
  --orange-soft:  rgba(232,100,58,0.12);
  --orange-glow:  rgba(232,100,58,0.30);

  /* Backgrounds */
  --bg-void:      #0A1628;
  --bg-deep:      #0D1B2C;
  --bg-card:      #122339;
  --bg-card-hot:  #16294A;

  /* Text — все проверены на WCAG AA против --bg-void */
  --white:        #FFFFFF;           /* 18:1 */
  --text:         #D5DFEC;           /* 11.5:1 — основной текст */
  --text-dim:     #9FB1C8;           /* 6.7:1 — вторичный текст */
  --text-faint:   #8B9FB8;           /* 5.1:1 — подписи, мелкие пометки */

  /* Borders */
  --border:       rgba(160,180,210,0.14);
  --border-hot:   rgba(232,100,58,0.45);

  /* Layout */
  --nav-h:        72px;
  --container:    1200px;
  --radius:       4px;
  --radius-lg:    8px;
}

/* ================================
   RESET / BASE
   ================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  background: var(--bg-void);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Производительность: fixed-noise overlay убран как источник лагов.
   Атмосфера держится за счёт градиентов в hero и --bg-deep на секциях. */

/* ================================
   ACCESSIBILITY
   ================================ */
.skip-link {
  position: absolute;
  top: -200px;
  left: 16px;
  background: var(--orange);
  color: var(--white);
  padding: 12px 20px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ================================
   TYPOGRAPHY
   ================================ */
h1, h2, h3, h4 {
  color: var(--white);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  color: var(--orange);
}

/* ================================
   LAYOUT
   ================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
section {
  padding: 96px 0;
  position: relative;
}

/* ================================
   NAVIGATION
   ================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
}
.nav-logo img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--orange); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: var(--white) !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-cta:hover {
  background: var(--orange-hot);
  transform: translateY(-1px);
  color: var(--white) !important;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.25s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ================================
   BUTTONS
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.22s;
  min-height: 48px;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}
.btn-primary:hover {
  background: var(--orange-hot);
  border-color: var(--orange-hot);
  box-shadow: 0 8px 32px var(--orange-glow);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--white);
}

/* ================================
   HERO (Block 1)
   ================================ */
.hero {
  padding: calc(var(--nav-h) + 80px) 0 80px;
  position: relative;
  overflow: hidden;
  contain: layout paint;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 75% 35%, rgba(232,100,58,0.10), transparent 55%),
    radial-gradient(circle at 5% 90%, rgba(77,123,200,0.07), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(160,180,210,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160,180,210,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-content { max-width: 640px; }
.hero h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 24px 0 24px;
}
.hero h1 .accent { color: var(--orange); }
.hero-sub {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 580px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(18, 35, 57, 0.65);
  margin-bottom: 36px;
  overflow: hidden;
}
.stat {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-val {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.stat-val .plus { color: var(--orange); }
.stat-lbl {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.stat-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.45;
  font-style: italic;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,22,40,0.55) 100%);
  pointer-events: none;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================================
   WHAT IS DMN (Block 2)
   ================================ */
.section-head {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.15;
  margin-bottom: 16px;
}
.section-head p {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
}

.what-is {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.what-grid {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}
.what-para {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  padding-left: 24px;
  border-left: 2px solid var(--orange);
}
.what-para:nth-child(2) { border-left-color: rgba(232,100,58,0.55); }
.what-para:nth-child(3) { border-left-color: rgba(232,100,58,0.30); }

/* ================================
   STAS (Block 3)
   ================================ */
.stas {
  position: relative;
}
.stas-inner {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 56px;
  align-items: start;
}
.stas-photo {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.stas-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stas-content { min-width: 0; }
.stas-content h2 {
  font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 10px;
}
.stas-content > .lead {
  font-size: 19px;
  color: var(--orange);
  font-weight: 500;
  margin-bottom: 28px;
}
.stas-bio {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 32px;
}

.stas-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.stas-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.25s, transform 0.25s;
}
.stas-card:hover {
  border-color: var(--border-hot);
  transform: translateY(-2px);
}
.stas-card h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.stas-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.timeline {
  display: grid;
  gap: 0;
  position: relative;
  margin-bottom: 36px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--orange), var(--border));
}
.t-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 12px 0 12px 28px;
  position: relative;
  align-items: baseline;
}
.t-row::before {
  content: '';
  position: absolute;
  left: 2px; top: 18px;
  width: 11px; height: 11px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg-void), 0 0 0 4px var(--orange-soft);
}
.t-year {
  font-weight: 700;
  color: var(--orange);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.t-text {
  font-size: 15.5px;
  color: var(--text);
  line-height: 1.5;
}

.stas-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 0;
  border-bottom: 1px solid transparent;
  transition: gap 0.2s, border-color 0.2s;
}
.stas-link:hover {
  gap: 14px;
  border-bottom-color: var(--orange);
}

/* ================================
   PRODUCTS (Block 4)
   ================================ */
.products {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.product-card:hover {
  border-color: var(--border-hot);
  background: var(--bg-card-hot);
  transform: translateY(-4px);
}
.product-card:hover::before { transform: scaleX(1); }

/* Static cards — не-ссылочные, остаются информационными */
.product-card--static {
  cursor: default;
}
.product-card--static:hover {
  transform: none;
  background: var(--bg-card);
  border-color: var(--border-hot);
}
.product-card--static:hover::before { transform: scaleX(1); }

.product-num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 14px;
}
.product-card h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.25;
}
.product-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 18px;
  flex-grow: 1;
}
.product-fit {
  font-size: 13.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.product-fit b {
  color: var(--text);
  font-weight: 600;
}
.product-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
  transition: gap 0.2s;
}
.product-card:hover .product-arrow { gap: 12px; }

/* ================================
   CHANNELS (Block 5) — главный CTA
   ================================ */
.channels {
  position: relative;
}
.channels::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(232,100,58,0.08), transparent 70%);
  pointer-events: none;
}
.channels-inner { position: relative; z-index: 2; }
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.channel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: border-color 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
}
.channel:hover {
  border-color: var(--border-hot);
  transform: translateY(-4px);
}
.channel-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--orange-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--orange);
}
.channel-icon svg { width: 30px; height: 30px; }
.channel h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.channel p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 28px;
  flex-grow: 1;
}
.channel .btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 15.5px;
}

/* ================================
   JOIN BOT (CTA band)
   ================================ */
.join-bot {
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-card-hot) 100%);
  border-top: 1px solid var(--border-hot);
  border-bottom: 1px solid var(--border-hot);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}
.join-bot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 70% at 80% 50%, rgba(232,100,58,0.12), transparent 70%);
  pointer-events: none;
}
.join-bot-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.join-bot h2 {
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.2;
  margin-bottom: 10px;
}
.join-bot p {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 640px;
  line-height: 1.6;
}
.join-bot .btn {
  white-space: nowrap;
  padding: 16px 32px;
  font-size: 16px;
}
@media (max-width: 768px) {
  .join-bot-inner {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 24px;
  }
  .join-bot .btn {
    width: 100%;
  }
}

/* ================================
   PARTNERS TEASER (Block 7)
   ================================ */
.partners {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.partners-inner {
  max-width: 720px;
  margin: 0 auto;
}
.partners h2 {
  font-size: clamp(28px, 3.5vw, 38px);
  margin-bottom: 24px;
}
.partners p {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 32px;
}
.partners .stats-inline {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
  padding: 20px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(18, 35, 57, 0.4);
}
.partners .stats-inline > div {
  text-align: center;
}
.partners .stats-inline strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 4px;
}
.partners .stats-inline span {
  font-size: 13px;
  color: var(--text-faint);
}

/* ================================
   FOOTER (Block 8)
   ================================ */
.footer {
  background: #07101D;
  padding: 72px 0 0;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 56px;
}
.footer h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
}
.footer-brand .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  text-decoration: none;
}
.footer-brand .logo img { width: 36px; height: 36px; }
.footer-brand .logo span { color: var(--orange); }
.footer-brand p {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 320px;
}
.footer-socials {
  display: flex;
  gap: 10px;
}
.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: all 0.22s;
}
.footer-socials a:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}
.footer-socials svg { width: 18px; height: 18px; }

.footer ul { list-style: none; }
.footer li { margin-bottom: 12px; }
.footer a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
  transition: color 0.2s;
}
.footer a:hover { color: var(--orange); }

.footer-bottom {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-bottom .copy {
  font-size: 13px;
  color: var(--text-faint);
}
.footer-disclaimer {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
  max-width: 680px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo { max-width: 420px; aspect-ratio: 4/5; }
  .stas-inner { grid-template-columns: 1fr; gap: 36px; }
  .stas-photo {
    position: static;
    max-width: 360px;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .hero { padding: calc(var(--nav-h) + 48px) 0 56px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 18px;
    align-items: stretch;
  }
  .nav-links.open a {
    padding: 12px 0;
    font-size: 16px;
  }
  .hamburger { display: flex; }

  .hero-stats { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .hero-actions .btn { flex: 1; min-width: 0; }

  .stas-cards { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .partners .stats-inline {
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ================================
   SUB-PAGE STYLES
   Применяется на /about, /partners, /legal/*
   ================================ */

/* Page header — короткий hero для внутренних страниц */
.page-header {
  padding: calc(var(--nav-h) + 64px) 0 56px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 30% 50%, rgba(232,100,58,0.08), transparent 65%);
  pointer-events: none;
}
.page-header-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
}
.page-header h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 20px 0 20px;
}
.page-header h1 .accent { color: var(--orange); }
.page-header .lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 720px;
}

/* Прозы — для статичного длинного текста (about, legal) */
.prose {
  max-width: 760px;
  margin: 0 auto;
}
.prose > * + * { margin-top: 24px; }
.prose h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.2;
  margin-top: 56px;
  margin-bottom: 16px;
  letter-spacing: -0.015em;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--white);
  margin-top: 32px;
  margin-bottom: 12px;
}
.prose p {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
}
.prose p.muted {
  color: var(--text-dim);
  font-size: 15.5px;
}
.prose strong { color: var(--white); font-weight: 600; }
.prose a {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
.prose a:hover { opacity: 0.75; }
.prose ul, .prose ol {
  padding-left: 24px;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
}
.prose li + li { margin-top: 8px; }
.prose ul li::marker { color: var(--orange); }
.prose blockquote {
  border-left: 3px solid var(--orange);
  padding: 8px 0 8px 24px;
  margin: 24px 0;
  color: var(--text);
  font-style: italic;
}
.prose .legal-meta {
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* Highlight panel — для важных блоков на под-страницах */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.panel h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}
.panel p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
}
.panel p + p { margin-top: 12px; }

/* CTA cluster — для блока «куда дальше» на внутренних страницах */
.cta-cluster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.cta-cluster .btn { width: 100%; }

/* Print stylesheet */
@media print {
  body { background: white; color: black; }
  .nav, .footer, .skip-link, .hero-grid, .channels::before, .partners, .join-bot { display: none !important; }
  body::after { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  h1, h2, h3, h4 { color: black; }
  a { color: black; text-decoration: underline; }
  .page-header { padding: 16px 0; }
  .prose p, .prose li { color: black; }
}

/* ================================
   BLOG EXTENSIONS
   Стили только для блога: лента, мета поста, пагинация.
   Базовый дизайн системы — выше. Эти классы расширяют его.
   ================================ */

/* Лента постов на главной блога */
.posts-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.22s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { border-color: var(--border-hot); }
.post-card h2 {
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -0.015em;
}
.post-card h2 a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.2s;
}
.post-card h2 a:hover { color: var(--orange); }
.post-card .post-excerpt {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Мета-информация: дата + время чтения */
.post-meta,
.post-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
}
.post-header-meta {
  font-size: 14px;
  margin-top: 18px;
}
.post-meta .dot,
.post-header-meta .dot {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.6;
}

/* Featured image поста */
.post-thumbnail {
  margin: 0 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-thumbnail img { width: 100%; display: block; }

/* Навигация между постами */
.post-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
}
.post-nav > div:first-child { text-align: left; }
.post-nav > div:nth-child(2) { text-align: center; }
.post-nav > div:last-child { text-align: right; }
.post-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.post-nav a:hover { color: var(--orange); }
.post-nav > div:nth-child(2) a { color: var(--orange); }

/* Пагинация ленты */
.posts-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 56px 0 0;
}
.posts-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.posts-pagination .page-numbers:hover {
  border-color: var(--border-hot);
  color: var(--white);
}
.posts-pagination .page-numbers.current {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.posts-pagination .page-numbers.dots {
  border: none;
  background: transparent;
  color: var(--text-faint);
}

/* Пустое состояние ленты */
.posts-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
  font-size: 16px;
}

/* Тонкая секция для контента поста (тоньше чем дефолтная section: 96px) */
.section-thin { padding: 56px 0 96px; position: relative; }

/* Адаптив блога */
@media (max-width: 768px) {
  .posts-list { grid-template-columns: 1fr; gap: 16px; }
  .post-card { padding: 24px; }
  .post-card h2 { font-size: 20px; }
  .post-nav { grid-template-columns: 1fr; gap: 12px; }
  .post-nav > div { text-align: center !important; }
}

/* ================================
   GUTENBERG BLOCKS — минимальный фикс
   Стандартные блоки WP внутри .prose: картинки, выравнивания, ширина
   ================================ */
.prose .wp-block-image { margin: 32px 0; }
.prose .wp-block-image img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.prose .wp-block-image figcaption {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 10px;
}
.prose .wp-block-quote {
  border-left: 3px solid var(--orange);
  padding: 8px 0 8px 24px;
  margin: 28px 0;
  font-style: italic;
}
.prose .wp-block-quote cite {
  display: block;
  font-style: normal;
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 8px;
}
.prose .wp-block-code,
.prose pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.prose code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--orange);
}
.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.prose .wp-block-table {
  margin: 24px 0;
  overflow-x: auto;
}
.prose .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.prose .wp-block-table th,
.prose .wp-block-table td {
  border: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
}
.prose .wp-block-table th {
  background: var(--bg-card);
  color: var(--white);
  font-weight: 600;
}
