/* ── Сторінки-статті (tools/pages.cjs → life-dashboard/, printable-year-planner/ і їхні uk/ru) ──
   Підключається після landing.css і бере з нього токени, шапку, футер, кнопки (.lp-cta, .lp-signin) і перемикач мови.
   Тут — лише стаття: одна колонка тексту 45–75 знаків, заголовки тим самим Unbounded 300, що на лендингу, волосинки
   замість рамок і карток. Помаранчевий — лише головна дія сторінки (одна .lp-cta) і посилання. Mobile-first. */

/* На статті немає меню розділів, тож перемикач мови сам відштовхує кнопки до краю */
@media (min-width: 720px) {
  .pg-page .lp-nav .lp-dd { margin-inline-start: auto; }
}

.pg { padding: 20px 0 72px; }
.pg-wrap { width: min(100% - 2 * var(--gut), 760px); margin-inline: auto; }

/* ── Шапка статті ── */
.pg-head { padding: 12px 0 8px; }
.pg-kicker {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pg-h1 {
  margin: 0;
  font-family: var(--head);
  font-size: clamp(30px, 7.6vw, 52px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.pg-lead {
  margin: 22px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text2);
  text-wrap: pretty;
}
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 30px; }
.pg-actions .lp-cta { min-height: 50px; }
.pg-link { color: var(--accent2); font-weight: 600; text-underline-offset: 3px; }

/* ── Текст ── */
.pg-sec { margin-top: 56px; }
/* Загальні правила тексту — через :where(), з нульовою вагою класу: інакше .pg p перебивав би .pg-lead і .pg-kicker */
:where(.pg) h2 {
  margin: 0 0 14px;
  font-family: var(--head);
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
:where(.pg) h3 { margin: 30px 0 8px; font-size: 18px; font-weight: 700; line-height: 1.35; }
:where(.pg) p { margin: 0 0 14px; font-size: 17px; line-height: 1.65; color: var(--text2); }
:where(.pg) :is(p, li) b { color: var(--text); font-weight: 700; }
:where(.pg) :is(ul, ol) { margin: 0 0 14px; padding-inline-start: 22px; color: var(--text2); }
:where(.pg) li { margin: 0 0 8px; font-size: 17px; line-height: 1.6; padding-inline-start: 4px; }
:where(.pg) li::marker { color: var(--muted); }
.pg a:not(.lp-cta):not(.pg-file) { color: var(--accent2); text-underline-offset: 3px; }

/* Визначення одним абзацом — те, що шукач може взяти у відповідь: трохи більше повітря й волосинка ліворуч */
.pg-def {
  margin: 0 0 14px;
  padding-inline-start: 18px;
  border-inline-start: 2px solid var(--line2);
}

/* Кроки: номер — службовим кеглем, текст — звичайним; волосинка між кроками */
.pg-steps { list-style: none; counter-reset: pg-step; padding: 0; margin: 0; }
.pg-steps li {
  counter-increment: pg-step;
  position: relative;
  margin: 0;
  padding: 16px 0 16px 48px;
  border-top: 1px solid var(--line);
}
.pg-steps li:last-child { border-bottom: 1px solid var(--line); }
.pg-steps li::before {
  content: counter(pg-step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: 17px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
[dir="rtl"] .pg-steps li { padding: 16px 48px 16px 0; }

/* ── Ілюстрації: справжні знімки інтерфейсу; розміри в атрибутах, щоб текст не стрибав, поки вантажиться ── */
.pg-fig { margin: 36px 0; }
.pg-fig img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 10px;
}
.pg-fig figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ── Порівняння: таблиця з волосинками, на телефоні прокручується вбік у своїй рамці ── */
.pg-table { margin: 18px 0 14px; overflow-x: auto; }
.pg-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.pg-table th, .pg-table td { padding: 11px 12px 11px 0; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.pg-table th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pg-table td { color: var(--text2); line-height: 1.5; }
.pg-table td:first-child { color: var(--text); font-weight: 600; }

/* ── Файли для завантаження: рядок на файл — що це, формат і розмір, кнопка ── */
.pg-files { display: grid; gap: 12px; margin: 22px 0 14px; }
.pg-file {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.pg-file:hover { border-color: rgba(236, 235, 230, 0.4); background: var(--surface2); }
.pg-file-name { font-weight: 700; font-size: 16px; }
.pg-file-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.pg-file-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1a1206;
  background: var(--accent);
  border-radius: 10px;
}
.pg-file:hover .pg-file-go { background: var(--accent2); }
/* Другорядний файл — без помаранчевої кнопки: акцент на сторінці один */
.pg-file.alt .pg-file-go { color: var(--text); background: none; border: 1px solid var(--line2); }
.pg-file.alt:hover .pg-file-go { background: rgba(236, 235, 230, 0.06); }

/* ── Питання й відповіді: власний значок замість системного трикутника ── */
.pg-faq details { border-top: 1px solid var(--line); }
.pg-faq details:last-of-type { border-bottom: 1px solid var(--line); }
.pg-faq summary {
  position: relative;
  padding: 16px 36px 16px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after {
  content: '';
  position: absolute;
  inset-inline-end: 6px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.pg-faq details[open] summary::after { transform: translateY(4px) rotate(-135deg); }
.pg-faq summary:hover { color: var(--text); }
.pg-faq details > :not(summary) { margin-top: 0; }
.pg-faq details > p:last-child { margin-bottom: 18px; }

/* ── Кінцевий заклик: та сама дія, що в шапці статті ── */
.pg-end {
  margin-top: 64px;
  padding: 32px 0 0;
  border-top: 1px solid var(--line2);
}
.pg-end h2 { margin-bottom: 10px; }
.pg-end .pg-actions { margin-top: 22px; }

@media (min-width: 720px) {
  .pg { padding: 36px 0 104px; }
  .pg-lead { font-size: 19px; }
  .pg-sec { margin-top: 72px; }
  .pg-fig { margin: 44px 0; }
  .pg-files { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pg-faq summary::after { transition: none; }
}

/* 404 pages: a plain row of languages instead of the script-driven .lp-dd menu (those pages have no script) */
.pg-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pg-langs a[aria-current] { font-weight: 600; color: var(--text); text-decoration: none; }
/* …and no menu between the logo and the buttons to push them to the edge: the demo button does it (only these pages
   have it right after the logo; the media rule above 720 px would otherwise put it next to the logo) */
.lp-nav-in > .lp-brand + .lp-demo { margin-inline-start: auto; }
