/* =============================================================
   AI Solution detail page — block library
   =============================================================
   Подключается из templates/ai_registry/solution_detail.html.
   Все классы префикс `.sd-` (solution detail).
   Глобальные переменные (--bg, --accent, --text-light, --border,
   --px, --max-w) приходят из static/home/styles.css.
   ============================================================= */

/* ---------- 1. Контейнер страницы ---------- */
.sd-page {
  /* Без max-width + auto-margin — как на leadership: полная ширина с padding по бокам.
     header в ai_registry/styles.css — position:fixed, высота --header-h (128px). */
  padding: calc(var(--header-h, 128px) + 24px) 80px 80px;
  color: var(--text-light);
}

/* ---------- 2. Хлебные крошки — стиль как на leadership ---------- */
.sd-breadcrumbs {
  font-size: 12px;
  line-height: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.sd-breadcrumbs a {
  color: #56718F;
  text-decoration: none;
  transition: color 0.2s;
}
.sd-breadcrumbs a:hover { color: #fff; }
.sd-breadcrumbs span.sep {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #56718F;
  border-radius: 1px;
  flex-shrink: 0;
}
.sd-breadcrumbs span.current { color: #fff; }

/* ---------- 2. Hero ---------- */
.sd-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1360 / 402;
  min-height: 320px;
  padding: 56px 64px;
  margin-bottom: 24px;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sd-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.sd-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 22, 43, 0.85) 0%,
    rgba(0, 22, 43, 0.55) 50%,
    rgba(0, 22, 43, 0.35) 100%);
}
.sd-hero__main {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.sd-hero__title {
  font-family: "Play", sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.05;
  color: #fff;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.sd-hero__lead {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-light);
  margin: 0;
  max-width: 540px;
}
.sd-hero__aside {
  position: absolute;
  right: 48px;
  bottom: 48px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.sd-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.sd-hero__badge .star {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.sd-hero__cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.2s, border-color 0.2s;
}
.sd-hero__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- 3. Карточка-секция ---------- */
.sd-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
}
.sd-card__title {
  font-family: "Play", sans-serif;
  font-size: clamp(22px, 2.4vw, 30px);
  color: #fff;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}

/* Подсекция внутри карточки (заголовок по центру + разделитель) */
.sd-subsection { padding-top: 32px; }
.sd-subsection + .sd-subsection {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}
.sd-subsection__title {
  text-align: center;
  font-family: "Play", sans-serif;
  font-size: clamp(20px, 2.2vw, 28px);
  color: #fff;
  margin: 0 0 28px;
}

/* ---------- 4. Сетка ---------- */
.sd-grid {
  display: grid;
  gap: 24px;
}
.sd-grid--2 { grid-template-columns: repeat(2, 1fr); }
.sd-grid--3 { grid-template-columns: repeat(3, 1fr); }
.sd-grid--4 { grid-template-columns: repeat(4, 1fr); }
.sd-grid--5 { grid-template-columns: repeat(5, 1fr); }

/* ---------- 5. Универсальная фича ---------- */
.sd-feature { display: flex; flex-direction: column; }
.sd-feature__title {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  margin: 12px 0 8px;
}
.sd-feature__text {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}
.sd-feature__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.sd-feature__list li {
  position: relative;
  padding-left: 14px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.sd-feature__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
}

/* — маркер: квадратная иконка 56px (бордер встроен в SVG, из Figma) */
.sd-feature__icon-fig {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

/* — маркер: иконка в круге (44px, оранжевая обводка) */
.sd-feature__icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 131, 104, 0.08);
  border: 1px solid rgba(255, 131, 104, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.sd-feature__icon-circle img,
.sd-feature__icon-circle svg { width: 24px; height: 24px; }

/* — маркер: иконка слева inline (рядом с заголовком) */
.sd-feature--inline { flex-direction: row; align-items: flex-start; gap: 12px; }
.sd-feature--inline .sd-feature__icon-inline {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.sd-feature--inline .sd-feature__icon-inline img,
.sd-feature--inline .sd-feature__icon-inline svg { width: 20px; height: 20px; }
.sd-feature--inline .sd-feature__body { flex: 1; }
.sd-feature--inline .sd-feature__title { margin-top: 0; }

/* — маркер: галочка (красная) inline */
.sd-feature__check {
  color: var(--accent-red);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
}

/* — маркер: номер (01, 02, …) */
.sd-feature__number {
  font-family: "Play", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-red);
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

/* — маркер: шеврон/двойная стрелка */
.sd-feature__chevron {
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* ---------- 6. Карточка-«галочка» (без заголовка) ---------- */
.sd-check-card {
  background: linear-gradient(180deg, #00162B 0%, #394657 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sd-check-card__check {
  color: var(--accent);
  width: 20px;
  height: 20px;
}
.sd-check-card__text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

/* ---------- 7. Большие статы ---------- */
.sd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.sd-stat__value {
  font-family: "Play", sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.sd-stat__caption {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

/* ---------- 8. Нумерованный бокс с бордером (EAM) ---------- */
.sd-numbered-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.01);
}
.sd-numbered-box__num {
  font-family: "Play", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-red);
  letter-spacing: 0.04em;
  margin: 0 0 24px;
}
.sd-numbered-box__title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

/* ---------- 9. Overlay: карточки поверх фото ---------- */
.sd-overlay {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  min-height: 280px;
}
.sd-overlay__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.sd-overlay__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 22, 43, 0.55) 0%,
    rgba(0, 22, 43, 0.85) 100%);
}
.sd-overlay__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.sd-overlay__item {
  padding: 32px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.sd-overlay__item:last-child { border-right: none; }
.sd-overlay__item .sd-feature__number { margin-bottom: 20px; }
.sd-overlay__item .sd-feature__check { margin-bottom: 16px; }
.sd-overlay__item p {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

/* ---------- 10. Карточки «Проблема / Решение» ---------- */
.sd-problem-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sd-problem-card__title {
  padding: 28px 28px 24px;
  font-family: "Play", sans-serif;
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}
.sd-problem-card__section {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  flex: 1;
}
.sd-problem-card__section:last-child { border-bottom: none; }
.sd-problem-card__label {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px;
}
.sd-problem-card__text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-light);
  margin: 0;
}

/* Градиентный вариант — акцентная карточка */
.sd-problem-card--gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 35%,
    rgba(180, 70, 40, 0.45) 100%);
  pointer-events: none;
  z-index: 0;
}
.sd-problem-card--gradient > * {
  position: relative;
  z-index: 1;
}

/* ---------- 11. CTA «Скачать презентацию» ---------- */
.sd-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: gap 0.2s;
}
.sd-download:hover { gap: 12px; }
.sd-download::after {
  content: "→";
  font-size: 18px;
}

/* =============================================================
   Адаптив
   ============================================================= */

@media (max-width: 1100px) {
  .sd-page { padding-left: 40px; padding-right: 40px; }
  .sd-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .sd-grid--5 { grid-template-columns: repeat(3, 1fr); }
  .sd-overlay__grid { grid-template-columns: repeat(2, 1fr); }
  .sd-overlay__item:nth-child(2) { border-right: none; }
  .sd-overlay__item:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
}

@media (max-width: 768px) {
  .sd-page { padding-left: 20px; padding-right: 20px; }
  .sd-hero {
    aspect-ratio: auto;
    min-height: 360px;
    padding: 24px;
  }
  .sd-hero__aside {
    position: static;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
  }
  .sd-hero__cta { padding: 12px 20px; }
  .sd-card { padding: 24px 20px; }
  .sd-card__title { margin-bottom: 24px; }

  .sd-grid--2,
  .sd-grid--3,
  .sd-grid--4,
  .sd-grid--5 { grid-template-columns: 1fr; }

  .sd-stats { grid-template-columns: 1fr; gap: 24px; }
  .sd-overlay__grid { grid-template-columns: 1fr; }
  .sd-overlay__item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sd-overlay__item:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
  .sd-page { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 480px) {
  .sd-page { padding: 16px 16px 60px; }
  .sd-hero__title { font-size: 26px; }
  .sd-hero__cta { width: 100%; justify-content: center; }
}
