/* ==========================================================================
   SEO-лендінги /ai/<slug>. Доповнює styles.css (токени, .btn, .sec-head, .cta, nav, footer);
   тут лише стилі блоків із blocks/*.php. Без картинок і JS — щоб LCP був текстом.
   ========================================================================== */

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

/* сторінка трохи компактніша за головну; контраст малого тексту на tint-фоні — темніший */
.sp .sp-sec { padding-block: clamp(56px, 8vw, 104px); }
.sp .section--tint .kicker, .sp .kicker { color: var(--accent-deep); }
.sp .section--tint .lead, .sp .section--tint p { color: var(--ink-2); }
.sp .sec-head .h2 { max-width: 24ch; }
.sp .sec-head--center .h2 { max-width: 28ch; }

/* ---- hero: по центру, без картинки — LCP це заголовок ---- */
/* верхній відступ = висота фіксованої шапки (72px) + невеликий зазор, без порожнього «поверху» */
.sp-hero { padding: clamp(92px, 8vw, 112px) 0 clamp(48px, 7vw, 88px); }
.sp-hero__content { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sp-hero__h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); margin-top: 22px; max-width: 20ch; }
.sp-hero .lead { margin-top: 24px; max-width: 62ch; }
.sp-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.sp-crumbs a { color: var(--accent-deep); font-weight: 500; }
.sp-crumbs a:hover { text-decoration: underline; }
.sp-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.sp-points li { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink-2); }
.sp-points svg { flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); }
.sp-hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

/* ---- grids / cards ---- */
.sp-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(14px, 2vw, 22px); }
.sp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-card, .sp-feat, .sp-plan { background: #fff; border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: clamp(22px, 2.6vw, 32px); }
.sp-card__n { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--accent-deep); letter-spacing: .04em; }
.sp-card h3, .sp-card h2 { margin: 14px 0 10px; font-size: 1.25rem; line-height: 1.2; }
.sp-card h3 a:hover, .sp-card h2 a:hover { color: var(--accent-deep); }
.sp-card p, .sp-feat p, .sp-step p { color: var(--muted); }
.sp .section--tint .sp-card p, .sp .section--tint .sp-feat p { color: var(--ink-2); }
.sp-feat__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); }
.sp-feat h3 { font-size: 1.15rem; margin: 16px 0 8px; line-height: 1.25; }

/* ---- compare ---- */
.sp-table-wrap { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; text-align: left; }
.sp-table th, .sp-table td { padding: 18px 22px; vertical-align: top; border-bottom: 1px solid var(--hair); }
.sp-table tbody tr:last-child > * { border-bottom: 0; }
.sp-table thead th { font-family: var(--font-display); font-size: 0.95rem; background: var(--surface-tint); }
.sp-table tbody th { font-family: var(--font-display); font-weight: 600; width: 22%; color: var(--ink); }
.sp-table td { color: var(--muted); width: 36%; }
.sp .section--tint .sp-table td { color: var(--ink-2); }
.sp-table .sp-table__us { background: var(--accent-softer); color: var(--ink); font-weight: 500; }
.sp-table thead .sp-table__us { background: var(--accent); color: #fff; }

/* ---- steps ---- */
.sp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 22px); counter-reset: step; }
.sp-steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-step { counter-increment: step; position: relative; padding: 26px 0 0; border-top: 2px solid var(--ink); }
.sp-step::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 4vw, 3.4rem); letter-spacing: -0.03em; color: var(--accent-deep); line-height: 1; margin-bottom: 18px; }
.sp-step h3 { font-size: 1.3rem; margin-bottom: 10px; }

/* ---- SEO text ---- */
.sp-text { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.sp-text .sec-head { margin-bottom: 0; position: sticky; top: 100px; }
.sp-prose { font-size: 1.08rem; color: var(--ink-2); max-width: 66ch; min-width: 0; }
.sp-prose p + p, .sp-prose ul, .sp-prose ol { margin-top: 1.1em; }
.sp-prose h3 { margin: 1.6em 0 .5em; font-size: 1.3rem; }
.sp-prose a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.sp-prose ul, .sp-prose ol { padding-left: 1.3em; }
.sp-prose :not(pre) > code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; padding: .12em .4em; border-radius: 6px; background: var(--accent-softer); color: var(--accent-deep); }
.sp-prose pre { max-width: 100%; position: relative; margin: 1.3em 0; padding: 18px 20px; border-radius: 14px; background: var(--ink); color: #efedf7; overflow-x: auto; font-size: .9rem; line-height: 1.6; tab-size: 2; -webkit-overflow-scrolling: touch; }
.sp-prose pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: none; padding: 0; color: inherit; white-space: pre; user-select: all; }
.sp-prose pre + p { margin-top: 1.1em; }
.sp-copy { position: absolute; top: 10px; right: 10px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(255,255,255,.08); color: #efedf7; font: 600 .78rem/1 var(--font-display, inherit); cursor: pointer; transition: background .15s; }
.sp-copy:hover { background: rgba(255,255,255,.18); }
.sp-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) { .sp-text { grid-template-columns: minmax(0, 1fr); } .sp-text .sec-head { position: static; } }

/* ---- pricing ---- */
.sp-plan { display: flex; flex-direction: column; gap: 6px; }
.sp-plan__note { font-size: 0.8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-deep); }
.sp-plan h3 { font-size: 1.5rem; }
.sp-plan__price { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; letter-spacing: -0.03em; color: var(--ink) !important; margin: 4px 0 8px; }
.sp-plan__price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-left: 3px; }
.sp-plan--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-pop); }
.sp-more { margin-top: 30px; text-align: center; }

/* ---- FAQ на <details> ---- */
.sp-faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.sp-qa { background: #fff; border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; transition: border-color .3s var(--ease), background .3s var(--ease); }
.sp-qa[open] { background: #fff; border-color: color-mix(in oklab, var(--accent) 55%, var(--hair)); box-shadow: 0 14px 34px -18px rgba(106,76,255,.45); }
.sp-qa[open] summary { color: var(--accent-deep); }
.sp-qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 26px; font-family: var(--font-display); font-size: clamp(1.05rem, 1.8vw, 1.2rem); font-weight: 500; letter-spacing: -0.01em; }
.sp-qa summary::-webkit-details-marker { display: none; }
.sp-qa summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-card); }
.sp-qa[open] .qa__ico { background: var(--accent); border-color: var(--accent); }
.sp-qa[open] .qa__ico::before, .sp-qa[open] .qa__ico::after { background: #fff; }
.sp-qa[open] .qa__ico::after { transform: rotate(90deg); opacity: 0; }
.sp-qa p { padding: 0 26px 24px; max-width: 68ch; color: var(--ink-2); }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .sp-text { grid-template-columns: minmax(0, 1fr); }
  .sp-text .sec-head { position: static; }
  .sp-grid--3, .sp-grid--4, .sp-steps, .sp-steps--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .sp-grid--3, .sp-grid--4, .sp-grid--2, .sp-steps, .sp-steps--4 { grid-template-columns: minmax(0, 1fr); }
  /* код не розпирає сторінку: рядки переносяться (копіювання лишається цілим) */
  .sp-prose pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* таблиця порівняння → стек карток: підпис колонки береться з data-label */
  .sp-table thead { display: none; }
  .sp-table, .sp-table tbody, .sp-table tr, .sp-table th, .sp-table td { display: block; width: 100% !important; }
  .sp-table tr { border-bottom: 1px solid var(--hair); padding: 8px 0; }
  .sp-table tbody tr:last-child { border-bottom: 0; }
  .sp-table th, .sp-table td { border: 0; padding: 6px 18px; }
  .sp-table td::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  .sp-table .sp-table__us { background: var(--accent-softer); }
}

/* Мобільний: hero вирівняний по лівому краю (по центру вузькі рядки виглядають рваними) */
@media (max-width: 640px) {
  .sp-hero__content { align-items: flex-start; text-align: left; }
  .sp-crumbs { justify-content: flex-start; }
  .sp-points { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 10px; }
  .sp-points li { align-items: flex-start; text-align: left; }
  .sp-points svg { margin-top: 1px; }
  .sp-hero__cta { justify-content: flex-start; }
}
