/* ═══════════════════════════════════════════════════════════════════
   Блог Hop & Cross — та сама система, що й лендінг.

   МОТИВ — штрих ручки: форма зі скругленими кінцями. Дрібне (кнопки,
   мови, посилання-дії) кругле повністю; великі площини беруть щедрий
   радіус. Жодного прямого кута, жодного градієнта, жодної тіні.

   Колір — ручка. Вона стоїть тільки на дії, на межі важливого блоку
   і на викресленому. Ніде більше: ні на фоні, ні на шапці.

   Верстка лишається вузькою — тут читають статтю, а не сканують екран.
   Підключається абсолютним шляхом /blog/blog.css з УСІХ сторінок,
   зокрема з /blog/en/..., де відносний шлях мав би іншу глибину.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --night:   #0B0B0A;
  --ground:  #E4E1DA;
  --paper:   #EEEDEA;
  --paper-2: #E6E5E1;
  --surface: #D9D5CD;
  --ink:     #14130F;
  --ink-soft:#1C1A16;
  --muted:   #5B574E;
  --pen:     #1F49E0;
  --pen-night: #5B86FF;
  --pen-ink: #FFFFFF;

  --radius: 22px;
  --stroke: 999px;
  --tilt: -2.6deg;

  --display: 'Unbounded', 'Manrope', sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --script: 'Kaushan Script', cursive;   /* тільки знак */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  color: var(--ink-soft);
  background: var(--ground);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pen); color: var(--pen-ink); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

/* ── Шапка: пласка смуга, без скла й без тіні ─────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--night);
}
/* Знак: рукописний, «Cross» перекреслено тією самою ручкою */
.topbar .brand {
  display: inline-flex; align-items: baseline; gap: .14em;
  font-family: var(--script); font-weight: 400; font-size: 1.6rem;
  line-height: 1; color: var(--paper); text-decoration: none; white-space: nowrap;
}
.topbar .brand .amp { opacity: .45; font-size: .8em; }
.topbar .brand .cr { position: relative; color: var(--pen-night); }
.topbar .brand .cr::after {
  content: ''; position: absolute; left: -.04em; right: -.04em; top: 53%;
  height: .075em; background: currentColor; border-radius: var(--stroke);
  transform: rotate(var(--tilt));
}
.topbar .brand img { display: none; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-right a.nav-link { color: #C6C2B9; text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.topbar-right a.nav-link:hover { color: var(--paper); }
.topbar .cta {
  padding: 10px 22px; border-radius: var(--stroke); text-decoration: none;
  font-weight: 700; font-size: 0.9rem; color: var(--pen-ink); white-space: nowrap;
  background: var(--pen-night);
}
.topbar .cta:hover { background: #87A6FF; }
.lang { display: flex; gap: 10px; }
.lang a { font-size: 0.82rem; font-weight: 700; color: #8D8980; text-decoration: none; }
.lang a.on { color: var(--paper); }
@media (max-width: 720px) { .topbar-right a.nav-link { display: none; } }

/* ── Каркас ───────────────────────────────────────────────────── */
.wrap { max-width: 740px; margin: 0 auto; padding: 44px 20px 96px; }
.wrap-wide { max-width: 1100px; }

.crumbs { font-size: 0.86rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--pen); text-decoration: underline; }

/* ── Заголовок сторінки ───────────────────────────────────────── */
.page-head { margin-bottom: 38px; }
/* Надзаголовка більше немає: те, що він казав, стоїть у самому
   заголовку або в першому реченні. */
.kicker { display: none; }
h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.02;
  letter-spacing: -0.035em; color: var(--ink);
}
.lede { margin-top: 20px; font-size: 1.1875rem; color: var(--ink-soft); }
.meta { margin-top: 20px; font-size: 0.86rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ── Короткий підсумок угорі статті ──
   Найважливіший блок і для пошуку, і для мовних моделей: вони тягнуть
   відповідь із перших абзаців. Тому стаття починається з відповіді. */
.summary {
  margin: 34px 0; padding: 26px 28px;
  background: var(--paper); border: 0;
  border-radius: var(--radius);
}
.summary h2 {
  font-family: var(--body); font-size: 1rem; font-weight: 700;
  letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 14px;
}
.summary ul { margin: 0; padding-left: 0; list-style: none; }
.summary li { margin-bottom: 10px; color: var(--ink-soft); padding-left: 30px; position: relative; }
/* Маркер — крихітний штрих, а не крапка */
.summary li::before {
  content: ''; position: absolute; left: 0; top: .72em;
  width: 18px; height: 3px; background: var(--pen); border-radius: var(--stroke);
}
.summary li:last-child { margin-bottom: 0; }

/* ── Зміст ────────────────────────────────────────────────────── */
.toc { margin: 34px 0; padding: 24px 28px; background: var(--paper-2); border: 0; border-radius: var(--radius); }
.toc h2 { font-family: var(--body); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 14px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin-bottom: 8px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--pen); text-decoration: underline; }

/* ── Текст статті ─────────────────────────────────────────────── */
article h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1.1;
  letter-spacing: -0.03em; color: var(--ink);
  margin: 54px 0 16px; scroll-margin-top: 84px;
}
article h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); margin: 32px 0 10px; }
article p { margin-bottom: 18px; }
article ul, article ol { margin: 0 0 20px 24px; }
article li { margin-bottom: 9px; }
article strong { font-weight: 700; color: var(--ink); }
article a { color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }

blockquote {
  margin: 28px 0; padding: 20px 26px;
  border: 0; background: var(--paper);
  border-radius: var(--radius);
  color: var(--ink-soft); font-style: normal; font-size: 1.1875rem;
}

/* Коробка «як це зробити в апці» — єдине місце, де стаття говорить про
   продукт. Свідомо одна на розділ: текст лишається корисним сам по собі,
   навіть якщо людина ніколи не відкриє апку. */
.in-app {
  margin: 30px 0; padding: 24px 28px;
  background: var(--night); color: #D7D4CC;
  border: 0; border-radius: var(--radius);
}
.in-app h3 { font-family: var(--body); font-weight: 700; font-size: 1rem; color: var(--paper); margin: 0 0 10px; letter-spacing: 0; }
.in-app p { margin: 0; color: #C6C2B9; font-size: 1rem; }
.in-app p + p { margin-top: 10px; }
.in-app a { color: var(--pen-night); }

/* ── Таблиця ──────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 26px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--surface); vertical-align: top; }
th { background: var(--paper-2); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
tr:last-child td { border-bottom: none; }

/* ── FAQ: плитки, відкрита бере колір ручки ───────────────────── */
.faq { margin-top: 58px; }
.faq h2 { margin-bottom: 20px; }
.faq details {
  background: var(--paper); border: 0; border-radius: var(--radius);
  padding: 0; margin-bottom: 8px; overflow: hidden;
}
.faq summary {
  font-weight: 700; cursor: pointer; list-style: none; position: relative;
  padding: 20px 56px 20px 26px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
/* Плюс і мінус — із тих самих штрихів */
.faq summary::after,
.faq summary::before {
  content: ''; position: absolute; right: 26px; top: 50%;
  width: 16px; height: 3px; background: currentColor; border-radius: var(--stroke);
}
.faq summary::before { transform: rotate(90deg); transition: transform .2s ease; }
.faq details[open] summary::before { transform: rotate(0deg); opacity: 0; }
.faq details[open] { background: var(--pen); }
.faq details[open] summary { color: var(--pen-ink); }
.faq details p { margin: 0; padding: 0 26px 22px; color: var(--ink-soft); }
.faq details[open] p { color: #E6EAF8; }

/* ── Картки статей на головній блогу ──────────────────────────── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-top: 14px; }
.post-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--paper); border: 0; border-radius: var(--radius);
  padding: 28px; text-decoration: none; color: inherit;
  transition: background .22s ease;
}
.post-card:hover { background: var(--paper-2); }
/* Іконка над заголовком була емодзі в кружечку — найвпізнаваніша
   ознака шаблону. Порядок тепер тримають розмір і положення. */
.post-card .ico { display: none; }
.post-card h2 { font-family: var(--display); font-weight: 800; font-size: 1.2rem; line-height: 1.15; letter-spacing: -0.025em; color: var(--ink); margin: 0; }
.post-card p { color: var(--ink-soft); font-size: 1rem; margin: 0; }
.post-card .more { margin-top: auto; padding-top: 8px; color: var(--pen); font-weight: 700; font-size: 0.95rem; }

/* ── Сусідні статті ───────────────────────────────────────────── */
.related { margin-top: 60px; padding-top: 34px; border-top: 0; }
.related h2 { font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 18px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin-bottom: 10px; }
.related a { color: var(--pen); text-decoration: none; font-weight: 600; }
.related a:hover { text-decoration: underline; }

/* ── Заклик наприкінці: поле кольору, без градієнта й тіні ────── */
.cta-box {
  margin-top: 58px; padding: clamp(32px, 5vw, 52px) clamp(24px, 4vw, 44px);
  background: var(--pen); border-radius: var(--radius);
  color: var(--pen-ink); text-align: left;
}
.cta-box h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 3.6vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 14px; color: var(--pen-ink); }
.cta-box p { opacity: .92; margin: 0 0 26px; max-width: 46ch; }
.cta-box a {
  display: inline-block; padding: 15px 32px; border-radius: var(--stroke);
  background: var(--pen-ink); color: var(--pen); font-weight: 700; text-decoration: none;
  transition: transform .18s ease;
}
.cta-box a:hover { transform: translateY(-2px); }

/* ── Підвал ───────────────────────────────────────────────────── */
footer {
  background: var(--night); color: #8D8980;
  text-align: left; padding: 48px clamp(16px, 4vw, 40px) 60px;
  font-size: 0.9rem;
}
footer .links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px 26px; }
footer a { color: #C6C2B9; text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--paper); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Знімок у картці: мотив штриха, щедрий радіус, тісний кадр ─── */
.post-card .shot {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left;
  border-radius: calc(var(--radius) - 8px); background: var(--surface);
  display: block; order: -1; margin-bottom: 4px;
}

/* ── Шапка тримає ті самі поля, що й колонка тексту ──────────────
      Інакше смуга йде від краю, а вміст — від 170px, і сторінка
      читається як зсунута вправо. */
.topbar { padding-inline: max(20px, calc((100% - 1100px) / 2)); }

/* ── Заголовок мусить бути домінантою першого екрана ───────────── */
.wrap-wide h1 { font-size: clamp(2.4rem, 6.4vw, 4.2rem); }

/* ── Рух: поява без скрипта. Елемент видимий за замовчуванням,
      анімація лише додає прихід — якщо її вимкнено, нічого не зникає. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hc-rise { from { opacity: 0; transform: translateY(18px); } }
  .page-head, .summary, .toc, .post-card, .cta-box, .faq details {
    animation: hc-rise .6s cubic-bezier(.2,.7,.3,1) both;
  }
  .post-card:nth-child(2) { animation-delay: .07s; }
  .post-card:nth-child(3) { animation-delay: .14s; }
  .post-card:nth-child(4) { animation-delay: .21s; }
  .post-card:nth-child(5) { animation-delay: .28s; }
  .post-card:nth-child(6) { animation-delay: .35s; }
  .post-card { transition: background .22s ease, transform .22s ease; }
  .post-card:hover { transform: translateY(-3px); }
}

/* Дія в шапці мусить читатись: білий на #5B86FF давав 3.3:1 */
.topbar .cta { background: var(--pen-ink); color: var(--night); }
.topbar .cta:hover { background: #fff; }

/* Рядок тексту не довший за 75 знаків */
.lede, article p, .summary li { max-width: 68ch; }

/* ── Підвал і шапка стоять на тих самих полях, що й колонка ────── */
footer { padding-inline: max(20px, calc((100% - 1100px) / 2)); }

/* ── Заклик відділений, щоб останній рядок FAQ не читався як
      підпис над його заголовком ──────────────────────────────── */
.cta-box { margin-top: 104px; }

/* ── На телефоні заголовок блогу не має права йти в три рядки ─── */
@media (max-width: 560px) {
  .wrap-wide h1 { font-size: 1.95rem; }
}
