/* SEO-блок MEDGRADE — компонент .seo (полный режим). Эталон: hub/medgrade-seo-block-concept (11.11.2026).
   Разметка: section.seo > .seo__mark (знак вставляет js/seo-block.js) + .seo__body > .seo__eyebrow, .seo__rich, .seo__cta.
   Режимы: full (по умолчанию), .seo--list (блог, контакты), .seo--long (разделы каталога), .seo--compact (подразделы, бренды).
   Кнопки — свои (.seo__btn), чтобы не задевать .btn сайта. Тёмной темы в шаблоне нет. */
.seo {
  --seo-bg: var(--mg-ref-sage-100, #f2f3ec);
  --seo-fg: var(--mg-ref-neutral-900, #1a1a1a);
  --seo-muted: var(--mg-ref-neutral-700, #575656);
  --seo-brand: var(--mg-ref-forest, #013F32);
  --seo-brand-hover: var(--mg-ref-forest-light, #02593f);
  --seo-chip-fg: var(--mg-ref-neon-500, #DBFE02);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: start;
  padding: 64px;
  border-radius: 24px;
  background: var(--seo-bg);
  color: var(--seo-fg);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
.seo > .seo__mark, .seo > .seo__body { position: relative; z-index: 1; }

.seo__mark {
  grid-column: 1 / span 4;
  align-self: start;
  aspect-ratio: 1 / 1;
  color: var(--seo-brand);
}
.seo__mark svg { display: block; width: 100%; height: auto; overflow: visible; }
.seo__mark .m-icon { display: none; }
.seo__ring { transform-box: fill-box; transform-origin: center; animation: seo-spin 60s linear infinite; }
@keyframes seo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .seo__ring { animation: none; } }

.seo__bg { position: absolute; left: 50%; top: 52%; width: 92%; transform: translateX(-50%); z-index: 0; color: var(--seo-brand); opacity: .07; pointer-events: none; }
.seo__bg svg { display: block; width: 100%; height: auto; }

.seo__body { grid-column: 6 / span 7; align-self: center; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.seo__eyebrow {
  align-self: flex-start;
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--seo-brand);
  color: var(--seo-chip-fg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.seo__rich > p { margin: 0 0 16px; max-width: 64ch; font-size: 17px; color: var(--seo-muted); }
.seo__rich > p:first-child { max-width: none; margin-bottom: 22px; font-size: clamp(20px, 2vw, 28px); line-height: 1.35; font-weight: 600; letter-spacing: -.01em; color: var(--seo-fg); }
.seo__rich > p:first-child strong { font-weight: 700; color: var(--seo-brand); }
.seo__rich > p:last-child { margin-bottom: 0; }
.seo__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.seo__btn { display: inline-block; padding: 14px 26px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.5; text-decoration: none; transition: background-color .2s, color .2s; }
.seo__btn--main { background: var(--seo-brand); color: #fff; }
.seo__btn--main:hover { background: var(--seo-brand-hover); color: #fff; }
.seo__btn--ghost { border: 1.5px solid var(--seo-brand); color: var(--seo-brand); }
.seo__btn--ghost:hover { background: var(--seo-brand); color: #fff; }
.seo .seo__body > :last-child { margin-bottom: 0; }

@media (max-width: 1100px) {
  .seo { padding: 48px 40px; }
  .seo__mark { grid-column: 1 / span 5; }
}
@media (max-width: 860px) {
  .seo { display: block; padding: 24px 20px; border-radius: 20px; }
  .seo__mark { float: left; width: 64px; max-width: 64px; margin: 2px 16px 8px 0; aspect-ratio: 1 / 1; }
  .seo__mark .m-full { display: none; }
  .seo__mark .m-icon { display: block; }
  .seo__bg { display: none; }
  .seo__body { display: block; align-self: auto; }
  .seo__eyebrow { display: none; }
  .seo__rich { margin-bottom: 20px; }
  .seo__rich > p:first-child { margin-bottom: 20px; font-size: 19px; }
  .seo__rich > p:nth-child(2) { clear: both; }
  .seo__cta { clear: both; }
}
@media (max-width: 575px) {
  .seo__rich > p { font-size: 16px; }
  .seo__btn { flex: 1 1 100%; text-align: center; }
}

/* ---- общее: произвольный HTML из админки внутри .seo__rich ---- */
.seo__rich { min-width: 0; }
.seo__rich h2, .seo__rich h3, .seo__rich h4 { margin: 0 0 10px; font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--seo-fg); }
.seo__rich > * + h2, .seo__rich > * + h3, .seo__rich > * + h4 { margin-top: 24px; }
.seo__rich a { color: var(--seo-brand); text-decoration: underline; text-underline-offset: 2px; }
.seo__rich ul:not(.seo__facts), .seo__rich ol { margin: 0 0 16px; padding-left: 22px; font-size: 17px; color: var(--seo-muted); }
.seo__rich li { margin-bottom: 6px; }
.seo__rich img { max-width: 100%; height: auto; }
.seo__rich table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 16px; font-size: 15px; color: var(--seo-muted); }
.seo__rich th, .seo__rich td { padding: 8px 12px; border: 1px solid var(--seo-line); text-align: left; }

/* ---- плитки-факты и плитки-числа ---- */
.seo { --seo-line: rgba(1, 63, 50, .12); --seo-tile: #fff; }
.seo__facts { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.seo__fact { display: grid; grid-template-columns: minmax(0, 1fr) 84px; column-gap: 12px; align-items: stretch; min-height: 88px; margin: 0; padding: 12px 16px 12px 22px; background: var(--seo-tile); border: 1px solid var(--seo-line); border-radius: 16px; }
.seo__ftxt { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; padding: 6px 0; }
.seo__ftxt strong { display: block; margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--seo-fg); }
.seo__ftxt span { font-size: 14px; line-height: 1.4; color: var(--seo-muted); }
.seo__fact img { width: 84px; height: 100%; min-height: 0; align-self: stretch; object-fit: contain; object-position: center right; }
.seo__nfact { grid-template-columns: minmax(0, 1fr) auto; }
.seo__digits { display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; min-height: 64px; }
.seo__digits img { width: auto; height: 58px; min-height: 0; margin: 0; align-self: center; object-fit: contain; }
.seo__rich .seo__facts { margin-top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1100px) { .seo__fact { grid-template-columns: minmax(0, 1fr) 72px; } .seo__fact img { width: 72px; } .seo__nfact { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---- режим list: блог, контакты (знак меньше, текст шире) ---- */
.seo--list .seo__mark { grid-column: 1 / span 2; }
.seo--list .seo__body { grid-column: 4 / span 9; }
@media (max-width: 1100px) { .seo--list .seo__mark { grid-column: 1 / span 3; } .seo--list .seo__body { grid-column: 4 / span 9; } }

/* ---- режим long: разделы каталога (длинный текст + плитки-числа) ---- */
.seo--long .seo__rich > p { max-width: 70ch; }
.seo--long .seo__rich > p:first-child { max-width: none; font-size: clamp(19px, 1.7vw, 24px); }

/* ---- режим compact: подразделы, бренды (короткий текст без плиток) ---- */
.seo--compact { display: flex; flex-direction: row; align-items: center; gap: 28px; padding: 28px 32px; border-radius: 18px; background: #EFEFEF; }
.seo--compact .seo__mark { flex: none; grid-column: auto; width: 88px; max-width: 88px; margin: 0; align-self: center; aspect-ratio: 1 / 1; }
.seo--compact .seo__mark .m-full { display: none; }
.seo--compact .seo__mark .m-icon { display: block; }
.seo--compact .seo__body { flex: 1 1 auto; min-width: 0; grid-column: auto; gap: 14px; }
.seo--compact .seo__eyebrow { display: none; }
.seo--compact .seo__rich > p:first-child { margin-bottom: 0; font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; }
.seo--compact .seo__rich > p + p { margin-top: 14px; }
.seo--compact .seo__rich h2, .seo--compact .seo__rich h3, .seo--compact .seo__rich h4 { font-size: 20px; }

@media (max-width: 860px) {
  .seo__rich ul:not(.seo__facts), .seo__rich ol { font-size: 16px; }
  .seo__facts { clear: both; }
  .seo .seo__rich .seo__facts { margin-bottom: 0; }
  .seo--compact { display: flex; gap: 14px; padding: 20px 16px; align-items: flex-start; }
  .seo--compact .seo__mark { float: none; width: 44px; max-width: 44px; margin: 2px 0 0; align-self: flex-start; }
  .seo--compact .seo__body { display: block; flex: 1 1 0; }
  .seo--compact .seo__rich h2, .seo--compact .seo__rich h3, .seo--compact .seo__rich h4 { font-size: 18px; }
  .seo--compact .seo__rich ul:not(.seo__facts), .seo--compact .seo__rich ol { padding-left: 18px; font-size: 15px; }
  .seo--compact .seo__rich { margin-bottom: 0; }
  .seo--compact .seo__rich > p:first-child { margin-bottom: 0; font-size: 17px; overflow: visible; }
  .seo--compact .seo__rich > p:nth-child(2) { clear: none; }
  .seo--compact .seo__cta .seo__btn--ghost { display: none; }
}
