/* Guide, comparison and free tool pages (written by tools/pages.mjs).
   Built on the tokens and parts in site.css: the peach nav, the CTA, the FAQ,
   the ink final block and the footer. */

.page { font-size: 18px; line-height: 1.65; }

/* ============ Header block ============ */

.p-hero { background: var(--peach); padding: clamp(28px, 4vw, 44px) 0 clamp(44px, 6vw, 64px); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.crumbs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill); text-decoration: none;
  transition: background-color var(--sel-out) var(--ease-soft);
}
.crumbs a:hover { background: rgba(30, 27, 58, 0.07); transition: background-color var(--sel-in) var(--ease-soft); }
.crumbs .ic { width: 14px; height: 14px; color: var(--ink-3); }
.crumbs [aria-current] { padding: 4px 10px; color: var(--ink); }
.p-head { margin-top: 20px; display: flex; align-items: flex-start; gap: 18px; }
.p-head .badge { margin-top: 6px; }
.p-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance;
}
.p-lede { margin-top: 16px; max-width: 58ch; font-size: clamp(18px, 1.6vw, 20px); color: var(--ink-2); text-wrap: pretty; }
.p-meta { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.p-meta span { display: inline-flex; align-items: center; gap: 6px; }
.p-meta .ic { width: 16px; height: 16px; }
@media (max-width: 560px) { .p-head .badge { display: none; } }

/* ============ Free tool ============ */

.tool-sec { background: var(--lilac-50); padding: clamp(28px, 4vw, 44px) 0; }
.tool {
  background: var(--tile); border-radius: var(--r-tile); box-shadow: var(--tile-shadow);
  padding: clamp(16px, 2.6vw, 28px);
}
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tb-gap { flex: 1; }
.tb-field {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px;
  border-radius: var(--r-pill); background: var(--panel-2);
  font-size: 15px; font-weight: 700; color: var(--ink-2);
  transition: box-shadow var(--sel-out) var(--ease-soft);
}
.tb-field:focus-within { box-shadow: 0 0 0 3px var(--ink); transition: box-shadow var(--sel-in) var(--ease-soft); }
.tb-field .ic { width: 17px; height: 17px; color: var(--ink-3); }
.tb-field input, .tb-field select {
  height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-pill);
  background: var(--tile); font: inherit; font-weight: 800; color: var(--ink); outline: none; cursor: pointer;
}
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--panel-2); }
.seg button {
  height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none;
  font-size: 15px; font-weight: 800; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--sel-out) var(--ease-soft), color var(--sel-out) var(--ease-soft);
}
.seg button[aria-pressed='true'] { background: var(--tab-on); color: var(--tab-on-text); transition: background-color var(--sel-in) var(--ease-soft), color var(--sel-in) var(--ease-soft); }
.tb-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 13px;
  border: 0; border-radius: var(--r-pill); background: var(--panel-2);
  font-size: 15px; font-weight: 800; color: var(--ink); cursor: pointer;
  transition: background-color var(--sel-out) var(--ease-soft), transform var(--t-press) var(--ease-soft);
}
.tb-btn .ic { width: 18px; height: 18px; }
.tb-btn:hover { background: var(--lilac-hover); transition: background-color var(--sel-in) var(--ease-soft), transform var(--t-press) var(--ease-soft); }
.tb-btn:active { transform: scale(0.97); }
.tb-btn.tb-main { background: var(--ink); color: var(--on-ink); }
.tb-btn.tb-main:hover { background: var(--ink-hover); }

.wh-title { margin-top: 20px; font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.wh-scroll { margin-top: 12px; overflow-x: auto; border-radius: var(--r-card); background: var(--panel-2); }
.wh { width: 100%; min-width: calc(64px + var(--cols, 5) * 112px); border-collapse: separate; border-spacing: 4px; padding: 4px; table-layout: fixed; }
.wh th { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.wh thead th { padding: 8px 6px 4px; text-align: left; }
.wh thead th:first-child { width: 56px; }
.wh-day { color: var(--ink); text-transform: capitalize; }
.wh-date { font-weight: 700; color: var(--ink-3); }
.wh tbody th { padding-right: 6px; text-align: right; vertical-align: top; padding-top: 8px; white-space: nowrap; }
.wh td { height: 46px; padding: 0; border-radius: var(--r-ctl); background: var(--tile); transition: background-color var(--sel-out) var(--ease-soft); }
.wh td.on { background: var(--peach); transition: background-color var(--sel-in) var(--ease-soft); }
.wh td input {
  width: 100%; height: 100%; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: none;
  font-size: 15px; font-weight: 700; color: var(--ink); outline: none;
  transition: box-shadow var(--sel-out) var(--ease-soft);
}
.wh td input:focus { box-shadow: 0 0 0 3px var(--ink); transition: box-shadow var(--sel-in) var(--ease-soft); }
.tool-note { margin-top: 14px; font-size: 14.5px; color: var(--ink-2); }
.tool noscript p { margin-top: 12px; font-weight: 700; }

/* ============ Article ============ */

.prose { padding: clamp(36px, 5vw, 56px) 0 clamp(56px, 7vw, 80px); }
.prose > * + * { margin-top: 16px; }
.prose h2 {
  margin-top: 52px; font-family: var(--display); font-weight: 600;
  font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.005em; text-wrap: balance;
  scroll-margin-top: 96px;
}
.prose h3 { margin-top: 32px; font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.25; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 800; }
.prose a { color: var(--accent-text); font-weight: 700; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.prose ul, .prose ol { display: grid; gap: 8px; }
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before { content: ''; position: absolute; left: 5px; top: 0.7em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.prose ol { counter-reset: n; }
.prose ol li { position: relative; padding-left: 44px; counter-increment: n; min-height: 32px; }
.prose ol li::before {
  content: counter(n); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--peach); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1;
}
.prose blockquote { padding: 18px 22px; border-radius: var(--r-card); background: var(--lilac-50); font-size: 19px; color: var(--ink); }
.prose figure img { width: 100%; height: auto; border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.prose figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); text-align: center; }
.prose code { font-size: 0.9em; padding: 0.1em 0.45em; border-radius: var(--r-sm); background: var(--lilac-50); }
.prose kbd {
  display: inline-block; padding: 0.05em 0.5em; border-radius: var(--r-sm);
  background: var(--tile); box-shadow: 0 2px 0 var(--lilac), 0 0 0 1.5px var(--lilac);
  font-size: 0.9em; font-weight: 800; color: var(--ink);
}

.p-table { overflow-x: auto; border-radius: var(--r-card); background: var(--lilac-50); }
.p-table table { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0 4px; padding: 4px 8px 8px; font-size: 16px; line-height: 1.5; }
.p-table th { text-align: left; padding: 10px 14px 4px; font-size: 14px; font-weight: 800; color: var(--ink-3); }
.p-table td { padding: 12px 14px; vertical-align: top; background: var(--tile); color: var(--ink-2); }
.p-table td:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); color: var(--ink); font-weight: 800; }
.p-table td:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.p-table tr.us td { background: var(--peach); color: var(--ink); }

/* "With Samy": what Samy does here, in his sky colour. */
.with-samy { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: var(--r-tile); background: var(--sky); }
.prose > .with-samy { margin-top: 28px; }
.with-samy > svg { width: 56px; height: 56px; flex: none; }
.with-samy-k { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--ink); }
.with-samy p { color: var(--ink); }
.with-samy p + p { margin-top: 8px; }
.with-samy-go {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-pill); background: var(--tile); color: var(--ink) !important; text-decoration: none;
  font-size: 15.5px; font-weight: 800;
  transition: transform var(--t-press) var(--ease-soft), box-shadow var(--sel-out) var(--ease-soft);
}
.with-samy-go:hover { box-shadow: var(--shadow-sm); transition: transform var(--t-press) var(--ease-soft), box-shadow var(--sel-in) var(--ease-soft); }
.with-samy-go:active { transform: scale(0.97); }
.with-samy-go .ic { width: 18px; height: 18px; }
@media (max-width: 520px) { .with-samy { flex-direction: column; gap: 12px; padding: 20px; } .with-samy > svg { width: 48px; height: 48px; } }

.prose .qa-list { margin-top: 16px; }
.prose .qa-in p { padding-top: 0; }

.byline { margin-top: 48px; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--r-card); background: var(--lilac-50); font-size: 15.5px; color: var(--ink-2); }
.byline svg { width: 44px; height: 44px; flex: none; }
.byline b { color: var(--ink); font-weight: 800; }

/* ============ Related pages and hubs ============ */

.rel { background: var(--lilac-50); padding: clamp(48px, 6vw, 72px) 0; }
.rel-title { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; }
.cards { margin-top: 22px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  border-radius: var(--r-card); background: var(--tile); box-shadow: var(--tile-shadow); text-decoration: none;
  transition: transform var(--sel-out) var(--ease-soft), box-shadow var(--sel-out) var(--ease-soft);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); transition: transform var(--sel-in) var(--ease-soft), box-shadow var(--sel-in) var(--ease-soft); }
.card:active { transform: scale(0.97); transition-duration: var(--t-press); }
.card-kind { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: var(--ink-3); }
.card-t { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--ink); }
.card-d { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.hub { padding: clamp(36px, 5vw, 56px) 0 clamp(56px, 7vw, 80px); background: var(--lilac-50); }
.hub .cards { margin-top: 0; }

a.foot-brand { text-decoration: none; }

/* ============ Print: only the tool, on one A4 page ============ */

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.printing-tool > :not(main), body.printing-tool main > :not(.tool-sec) { display: none !important; }
  body.printing-tool .tool-sec { padding: 0; background: none; }
  body.printing-tool .tool-sec .wrap { width: 100%; }
  body.printing-tool .tool { padding: 0; border-radius: 0; box-shadow: none; }
  body.printing-tool .tool-bar, body.printing-tool .tool-note { display: none; }
  body.printing-tool .wh-title { margin-top: 0; }
  body.printing-tool .wh-scroll { overflow: visible; background: none; }
  body.printing-tool .wh { min-width: 0; border-spacing: 0; padding: 0; border-collapse: collapse; }
  body.printing-tool .wh th, body.printing-tool .wh td { border: 0.6pt solid #b9b4d6; border-radius: 0; background: #fff; }
  body.printing-tool .wh td { height: 30pt; }
  body.printing-tool .wh td.on { background: #fff; }
  body.printing-tool .wh td input { font-size: 10pt; padding: 0 4pt; }
  body.printing-tool .nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover, .card:active, .tb-btn:active, .with-samy-go:active { transform: none; }
}
