/* ============================================================
 * Стили специфичные для главной страницы
 * (Hero, Timeline, Tree-preview, Contact-strip, Support-strip)
 * Шапка preview-header теперь живёт в style-search-bottom.css глобально.
 * ============================================================ */

/* На главной скрываем старые блоки которые остались в HTML, но не нужны в новом дизайне */
body[data-section="s0"] .seo-intro,
body[data-section="s0"] > main > section > .g2,
body[data-section="s0"] .qbox,
body[data-section="s0"] .seo-branches,
body[data-section="s0"] .seo-relatives,
body[data-section="s0"] > main > section > .g3,
body[data-section="s0"] .sec-title {
  display: none !important;
}

/* === HERO === */
.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, .86fr);
  gap: 28px;
  align-items: stretch;
}
.hero-copy,
.hero-panel,
.timeline-card,
.tree-preview,
.contact-strip,
.support-strip {
  border: 1px solid #bcd3ff;
  border-radius: 26px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 52px rgba(31, 59, 105, .16);
}
.hero-copy { padding: 52px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  margin: 0 0 10px;
  color: #2f66df;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hero h1 {
  max-width: 880px;
  margin: 0 0 22px 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
  letter-spacing: 0;
  color: #122b55;
  overflow-wrap: break-word;
}
.hero h2,
.section-grid h2,
.contact-strip h2,
.support-strip h2 {
  margin: 0 0 14px 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
  color: #122b55;
}
.lead {
  max-width: 700px;
  margin: 0;
  color: #58709a;
  font-size: 17px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-actions a {
  padding: 14px 17px;
  border-radius: 14px;
  color: white;
  background: #2f66df;
  font-weight: 900;
  text-decoration: none;
}
.hero-actions .secondary {
  color: #122b55;
  background: #edf4ff;
  border: 1px solid #bcd3ff;
}
.hero-panel { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.map-card {
  position: relative;
  flex: 1;
  min-height: 350px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .1)),
    radial-gradient(circle at 78% 18%, #cfe2ff 0 8%, transparent 8.5%),
    linear-gradient(150deg, #dcecff 0 45%, #dff1e7 45% 100%);
}
.map-card::before {
  content: ""; position: absolute; left: -5%; right: -5%; bottom: 0; height: 38%;
  background: linear-gradient(165deg, #c6dfc0 0 42%, #e5f1dd 42% 100%);
}
.map-card svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-line {
  fill: none; stroke: #2f66df; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 12 12; animation: dashGlobal 7s linear infinite;
}
.route-line.strong { stroke: #1e4ec4; stroke-dasharray: 0; }
.point {
  position: absolute; z-index: 2;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  color: #15325f;
  border: 1px solid rgba(188, 211, 255, .88);
  font-size: 12px; font-weight: 900;
  box-shadow: 0 8px 20px rgba(31, 59, 105, .12);
}
.prussia    { left: 14%; top: 24%; }
.volhynia   { left: 40%; top: 40%; }
.kazakhstan { right: 8%; top: 28%; }
.schachty   { left: 52%; top: 70%; }
.berlin     { left: 4%;  top: 18%; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-stats span {
  min-height: 78px; padding: 14px;
  border-radius: 18px;
  background: #eff6ff;
  color: #58709a;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-stats strong { display: block; color: #122b55; font-size: 28px; line-height: 1; }

/* === SECTION CARD (заголовок ВНУТРИ карточки) === */
.section-card {
  margin-top: 26px;
  padding: 32px;
  border: 1px solid #bcd3ff;
  border-radius: 26px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 52px rgba(31, 59, 105, .16);
}
.section-card-header { margin-bottom: 22px; }
.section-card-header .eyebrow { margin-bottom: 6px; }
.section-card-header h2 { margin: 0; }

/* === TIMELINE === */
.timeline-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.timeline-item {
  position: relative;
  min-height: 140px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbff, #edf5ff);
  border: 1px solid #d6e5ff;
}
.timeline-item::after {
  content: ""; position: absolute; right: -16px; top: 50%;
  width: 18px; height: 2px; background: #2f66df;
}
.timeline-item:last-child::after { display: none; }
.timeline-item span {
  display: block; margin-bottom: 10px;
  color: #2f66df; font-size: 12px; font-weight: 900;
}
.timeline-item strong { display: block; margin-bottom: 6px; font-size: 16px; color: #122b55; }
.timeline-item p { color: #58709a; margin: 0; }

/* === TREE PREVIEW === */
.tree-preview {
  margin-top: 26px;
  padding: 32px;
  border: 1px solid #bcd3ff;
  border-radius: 26px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 52px rgba(31, 59, 105, .16);
}
.tree-preview-header { margin-bottom: 22px; }
.tree-preview-header .eyebrow { margin-bottom: 6px; }
.tree-preview-header h2 { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filters a, .filters button,
.contact-options a, .contact-options button {
  display: inline-flex; align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid #bcd3ff;
  background: #f3f8ff;
  color: #122b55;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}
.filters a:hover, .contact-options a:hover { background: #e5eeff; }
.filters .active { background: #2f66df; color: white; border-color: #2f66df; }
.family-row { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; }
.person {
  position: relative;
  min-height: 110px;
  padding: 14px 16px;
  border-radius: 16px;
  background: white;
  border: 1px solid #d5e4ff;
  font-size: 15px;
  font-weight: 900;
  color: #122b55;
  text-decoration: none;
  display: block;
  overflow-wrap: break-word;
  word-break: break-word;
}
.person::after {
  content: "→"; position: absolute; right: -18px; top: 42%;
  color: #2f66df; font-size: 24px;
}
.person:last-child::after { display: none; }
.person span { display: block; margin-top: 8px; color: #58709a; font-size: 14px; font-weight: 700; }
.person.highlight {
  color: white;
  background: linear-gradient(180deg, #3b73f3, #2456d5);
  border-color: #2456d5;
}
.person.highlight span { color: rgba(255, 255, 255, .82); }

/* === CONTACT + SUPPORT === */
.contact-strip,
.support-strip {
  margin-top: 34px;
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.contact-options,
.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.support-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 13px;
  font-weight: 900;
  text-decoration: none;
}
.support-actions .telegram { background: #28a8e9; color: white; }
.support-actions .donate { background: #ffc84a; color: #15325f; }
.support-actions button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid #bcd3ff;
  background: #f3f8ff;
  color: #122b55;
  font-weight: 900;
  cursor: pointer;
}
.support-strip {
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(246, 250, 255, .92));
}
.support-strip p,
.contact-strip p {
  color: #58709a;
  font-size: 17px;
  margin: 0;
}

@keyframes dashGlobal { to { stroke-dashoffset: -48; } }

@media (max-width: 1100px) {
  .hero,
  .section-grid,
  .contact-strip,
  .support-strip { grid-template-columns: 1fr; }
  .section-title { position: static; }
}
@media (max-width: 720px) {
  .hero-copy { padding: 22px; }
  .section-card,
  .tree-preview,
  .contact-strip,
  .support-strip { padding: 20px !important; margin-top: 20px; }
  .section-card-header,
  .tree-preview-header { margin-bottom: 16px; }
  .hero h1 { font-size: 20px; line-height: 1.25; max-width: 100%; }
  .lead { font-size: 15px; }
  .hero-actions a { width: 100%; text-align: center; }
  .hero-panel { padding: 14px; }
  .timeline-row,
  .timeline-card,
  .family-row {
    grid-template-columns: 1fr !important;
  }
  .timeline-item,
  .person {
    width: 100%;
  }
  /* Убираем стрелки и горизонтальные коннекторы между блоками на мобильной */
  .timeline-item::after,
  .person::after { display: none !important; }
  .hero-stats { grid-template-columns: 1fr; }
}

/* === Тёмная тема === */
[data-theme="dark"] .hero-copy,
[data-theme="dark"] .hero-panel,
[data-theme="dark"] .timeline-card,
[data-theme="dark"] .tree-preview,
[data-theme="dark"] .contact-strip,
[data-theme="dark"] .support-strip {
  background: rgba(26, 38, 64, .86);
  border-color: #2a3f6b;
}
[data-theme="dark"] .hero h1,
[data-theme="dark"] .hero h2,
[data-theme="dark"] .section-grid h2,
[data-theme="dark"] .contact-strip h2,
[data-theme="dark"] .support-strip h2,
[data-theme="dark"] .timeline-item strong { color: #e8eef9; }
[data-theme="dark"] .lead,
[data-theme="dark"] .timeline-item p,
[data-theme="dark"] .contact-strip p,
[data-theme="dark"] .support-strip p { color: #a4b5d1; }
[data-theme="dark"] .timeline-item {
  background: linear-gradient(180deg, #16243e, #1a2640);
  border-color: #2a3f6b;
}
[data-theme="dark"] .hero-stats span { background: #16243e; }
[data-theme="dark"] .hero-stats strong { color: #e8eef9; }
[data-theme="dark"] .person { background: #16243e; border-color: #2a3f6b; color: #e8eef9; }
[data-theme="dark"] .filters a,
[data-theme="dark"] .contact-options a,
[data-theme="dark"] .support-actions button {
  background: #16243e; border-color: #2a3f6b; color: #e8eef9;
}
[data-theme="dark"] .hero-actions .secondary {
  background: #16243e; border-color: #2a3f6b; color: #e8eef9;
}

/* === Защита от горизонтального скролла на мобильной === */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  body > main.main { padding-left: 12px !important; padding-right: 12px !important; }
}
