/* Styles for the static pages built from fm/pages/*.md (see fm/build-pages.mjs).
   Every class is prefixed pg- so nothing here collides with site.css. Colours and radii come from the tokens on
   :root in site.css, so dark mode follows automatically. */

.pg { padding-block: 2.75rem 1rem; }
.pg h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 0.75rem; }
.pg h2 { font-size: clamp(1.55rem, 3.4vw, 1.875rem); margin: 3rem 0 1rem; scroll-margin-top: 1rem; }
.pg h3 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.pg .lede { margin-bottom: 1.5rem; }
.pg > :last-child { margin-bottom: 0; }

/* A wide photo under the page heading. */
.pg-banner { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 18px; margin: 0.5rem 0 2.5rem; }

/* Two columns that stack on small screens: <div class="pg-split"><div>…</div><div>…</div></div> */
.pg-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3.5rem; align-items: center; margin-bottom: 2.5rem; }
.pg-split > * > :first-child { margin-top: 0; }
.pg-split > * > :last-child { margin-bottom: 0; }
.pg-split img { width: 100%; border-radius: 18px; }
.pg-split--photo { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.pg-split--photo > img { aspect-ratio: 4 / 5; object-fit: cover; }

/* A portrait beside a name, as on the About page. */
.pg-person { display: flex; align-items: center; gap: 1.25rem; margin: 1.5rem 0 1.25rem; }
.pg-person img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0; flex: none; }
.pg-person h2 { margin: 0; }

/* Videos (or any embeds) side by side: <div class="pg-videos"> then one link per paragraph. */
.pg-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.pg-videos > * { margin: 0; }

/* A full-width tinted band around a section. */
.pg-band { background: var(--bg-soft); box-shadow: 0 0 0 100vmax var(--bg-soft); clip-path: inset(0 -100vmax); padding-block: 3rem; margin-block: 3rem; }
.pg-band > :first-child { margin-top: 0; }
.pg-band > :last-child { margin-bottom: 0; }
.pg-center { text-align: center; }

/* Buttons in a row, or stacked for link-list pages. */
.pg-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.pg-buttons--center { justify-content: center; }
.pg-buttons--stack { flex-direction: column; max-width: 26rem; margin-inline: auto; }
.pg-buttons--stack .button { text-align: center; overflow-wrap: anywhere; }

/* "Jump to" links and other small link rows. */
.pg-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; font-size: 1rem; }
.pg-jump strong { margin-right: 0.25rem; }
.pg-social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 2rem; font-size: 1rem; }

/* Product cards: the whole card is one link. */
.pg-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(150px, 19%), 1fr)); gap: 1.25rem; margin-bottom: 2rem; font-size: 1rem; line-height: 1.4; }
.pg-product { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.pg-product:hover { border-color: var(--accent); transform: translateY(-2px); }
.pg-product img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; padding: 14px; border-radius: 0; margin: 0; }
.pg-product strong { padding: 14px 16px 0; font-size: 0.95rem; overflow-wrap: anywhere; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pg-product small { padding: 4px 16px 0; color: var(--muted); font-size: 0.82rem; }
.pg-product span { margin: auto 16px 16px; padding: 9px 12px; border-radius: 999px; background: var(--bg-soft); text-align: center; font-size: 0.88rem; font-weight: 650; }
.pg-product > :nth-last-child(2) { margin-bottom: 14px; }
.pg-product:hover span { background: var(--accent); color: var(--accent-text); }

/* Cards in a grid (features, prices). */
.pg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.5rem; margin: 1.5rem 0 2rem; }
.pg-card { border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem; background: var(--bg); font-size: 1rem; line-height: 1.55; }
.pg-card > :first-child { margin-top: 0; }
.pg-card > :last-child { margin-bottom: 0; }
.pg-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; margin: 0 0 1rem; }
.pg-card h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.pg-card p { color: var(--muted); margin: 0 0 0.6rem; }
.pg-card ul { list-style: none; padding: 0; margin: 0.75rem 0; }
.pg-price { text-align: center; padding: 1.75rem 1.5rem; }
.pg-price h3 { font-size: 1.3rem; }
.pg-price .pg-amount { font-size: 1.6rem; font-weight: 750; color: var(--text); margin: 0.25rem 0 0.75rem; }
.pg-price .pg-amount del { color: var(--muted); font-weight: 500; }
.pg-price .pg-closed { font-weight: 750; font-style: italic; letter-spacing: 0.08em; color: var(--text); margin-top: 1rem; }

/* Picture and text side by side, alternating sides down the page. */
.pg-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; align-items: center; margin: 2.5rem 0; }
.pg-step img { width: 100%; border-radius: 18px; margin: 0; }
.pg-step:nth-of-type(even) img { order: 2; }
.pg-step h3 { margin-top: 0; }

.pg-notice { text-align: center; font-size: clamp(1.9rem, 7vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 2rem; }
.pg-facts { list-style: none; padding: 0; font-weight: 650; font-size: 1.15rem; }

/* Questions and answers. */
.pg-faq { border-top: 1px solid var(--line); padding: 1rem 0; }
.pg-faq:last-of-type { border-bottom: 1px solid var(--line); }
.pg-faq summary { cursor: pointer; font-weight: 650; font-size: 1.1rem; }
.pg-faq p { margin: 0.75rem 0 0; color: var(--muted); }

/* The contact form. */
.pg-form { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1.5rem; font-size: 1rem; }
.pg-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pg-form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.pg-form input, .pg-form textarea { font: inherit; font-weight: 400; width: 100%; min-height: 46px; padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.pg-form textarea { min-height: 9.5rem; resize: vertical; line-height: 1.5; }
.pg-form input:focus-visible, .pg-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.pg-form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pg-form-check { min-height: 65px; }
.pg-form button { font: inherit; font-weight: 650; justify-self: start; min-height: 46px; padding: 0 1.6rem; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.pg-form button:disabled { opacity: 0.6; cursor: default; }
.pg-form-status { min-height: 1.6em; margin: 0; font-weight: 600; }
.pg-form-status[data-kind="error"] { color: #b42318; }
.pg-form-status[data-kind="ok"] { color: var(--accent); }
.pg-form-done { font-size: 1.15rem; font-weight: 650; padding: 1.25rem 1.5rem; border-radius: 16px; background: var(--bg-soft); max-width: 34rem; }
@media (prefers-color-scheme: dark) {
  .pg-form-status[data-kind="error"] { color: #ff8a80; }
}

/* The latest-from-everywhere list on /now. */
.pg-feed { --pg-thumb: 90px; font-size: 1rem; line-height: 1.5; margin: 1.5rem 0 2rem; }
.pg-feed-status { color: var(--muted); padding: 1rem 0; margin: 0; }
.pg-feed-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem 2.5rem; align-items: start; }
.pg-feed-cols--single { grid-template-columns: minmax(0, 1fr); }
.pg-feed ul { list-style: none; margin: 0; padding: 0; }
.pg-feed li { margin: 0; border-bottom: 1px solid var(--line); }
.pg-feed li:last-child { border-bottom: 0; }
.pg-feed a { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; color: inherit; text-decoration: none; }
.pg-feed a:hover .pg-feed-title, .pg-feed a:hover .pg-feed-text { color: var(--accent); }
.pg-feed-thumb { flex: none; position: relative; width: calc(var(--pg-thumb) * 16 / 9); height: var(--pg-thumb); border-radius: 10px; overflow: hidden; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pg-feed-thumb--square { height: calc(var(--pg-thumb) * 16 / 9); }
.pg-feed-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; margin: 0; }
.pg-feed-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pg-feed-play svg { width: 38px; height: auto; opacity: 0.92; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)); }
.pg-feed-body { min-width: 0; display: block; }
.pg-feed-title { display: block; font-weight: 650; font-size: 1.05rem; line-height: 1.35; }
.pg-feed-meta { display: block; margin-top: 0.3rem; font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pg-feed-snippet { display: block; margin-top: 0.4rem; font-size: 0.92rem; color: var(--muted); }
.pg-feed-side { border-left: 1px solid var(--line); padding-left: 2.5rem; }
.pg-feed-side-head { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.pg-feed-side a { gap: 0.7rem; padding: 0.8rem 0; }
.pg-feed-side .pg-feed-thumb { width: 44px; height: 44px; border-radius: 8px; }
.pg-feed-text { font-size: 0.9rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pg-feed-date { display: block; margin-top: 0.3rem; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

@media (max-width: 820px) {
  .pg-split, .pg-split--photo, .pg-step { grid-template-columns: minmax(0, 1fr); }
  .pg-step:nth-of-type(even) img { order: 0; }
  .pg-split--photo > img { aspect-ratio: 4 / 3; }
  .pg-feed-cols { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .pg-feed-side { border-left: 0; padding-left: 0; }
}
@media (max-width: 480px) {
  .pg { padding-top: 2rem; }
  .pg-products { gap: 0.75rem; }
  .pg-product img { padding: 10px; }
  .pg-product strong { padding: 10px 12px 0; font-size: 0.88rem; }
  .pg-product small { padding: 4px 12px 0; }
  .pg-product span { margin: auto 12px 12px; font-size: 0.82rem; padding: 8px 8px; }
  .pg-product > :nth-last-child(2) { margin-bottom: 10px; }
  .pg-form-row { grid-template-columns: minmax(0, 1fr); }
  .pg-person img { width: 84px; height: 84px; }
  .pg-feed { --pg-thumb: 64px; }
  .pg-feed-play svg { width: 26px; }
  .pg-feed-snippet { display: none; }
  .pg-band { padding-block: 2.25rem; margin-block: 2.25rem; }
}

/* Reading-width helpers for wide pages. */
.pg > p, .pg > ul, .pg > ol { max-width: 46rem; }
.pg-narrow { max-width: 52rem; margin-inline: auto; }
.pg-center > p, .pg-center > ul, .pg-center > h3 { max-width: 40rem; margin-inline: auto; }
.pg > p.pg-buttons { max-width: none; }
.pg-videos > .embed-podcast:only-child { max-width: 660px; }
