/* ==========================================================================
   pisowifipauses.ph — shared stylesheet
   The only stylesheet on the site. Design system locked in BLUEPRINT.md §5.
   Order: 1 variables · 2 reset · 3 base · 4 layout · 5 components ·
          6 utilities · 7 responsive · 8 motion, forced colours & print
   Spacing rule: padding, margin, gap and offsets use --space-* tokens only.
   Colour rule: colours come from the tokens below, never literals.
   ========================================================================== */


/* 1. VARIABLES
   ========================================================================== */

:root {
  /* Brand */
  --color-primary: #0B6B66;
  --color-primary-hover: #08524E;
  --color-secondary: #102A43;
  --color-secondary-hover: #0A1E31;
  --color-accent: #F5B301;
  --color-accent-hover: #DB9E00;

  /* Neutrals */
  --color-bg: #FFFFFF;
  --color-surface: #F4F7FA;
  --color-surface-alt: #E8EEF4;
  --color-border: #D3DCE6;
  --color-text: #142334;
  --color-text-muted: #4B5B6C;
  --color-text-on-dark: #FFFFFF;
  --color-text-muted-on-dark: #C9D4E0;

  /* Status */
  --color-success: #166534;
  --color-warning: #92400E;
  --color-danger: #B42318;

  /* Focus */
  --color-focus: #F5B301;
  --color-focus-inner: #102A43;

  /* Typography */
  --font-display: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-xs: 0.875rem;
  --fs-sm: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;

  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.65;

  --ls-tight: -0.02em;
  --ls-normal: 0;
  --ls-wide: 0.06em;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --border-width: 1px;

  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 42, 67, 0.10);
  --shadow-lg: 0 12px 32px rgba(16, 42, 67, 0.14);

  /* Layout */
  --container-max: 1200px;
  --content-max: 800px;
  --sidebar-width: 288px;
  --header-height: 64px;
  --tap-min: 44px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
}

/* Headings: one self-hosted variable file, Latin subset, weights 700–800
   (19 KB, preloaded in every <head>). Licence: /fonts/OFL.txt.
   Body text uses the device's own font, so it downloads nothing. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin-700-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Arial Bold tuned to the same metrics, so the swap does not shift the layout */
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial");
  font-weight: 700 800;
  size-adjust: 100.65%;
  ascent-override: 103.13%;
  descent-override: 22.06%;
  line-gap-override: 0%;
}


/* 2. RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* Zero specificity, so any component class can set its own list padding */
:where(ul[class], ol[class]) {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

dialog {
  padding: 0;
}


/* 3. BASE
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-secondary);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

h4 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: var(--fw-semibold);
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
  margin-block: var(--space-7);
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

/* Two-tone ring: gold reads on navy, the navy inner ring reads on white */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--color-focus-inner);
}

[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* Sprite icons (/icons/icons.svg) are drawn as 2px strokes */
.icon {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* 4. LAYOUT
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Article body: <div class="container page-body"> holding the featured image,
   an aside with the TOC, and .page-body__main with the .content sections,
   callouts and the author box. One column on phones and tablets; from 1024px
   the aside becomes a sticky right-hand column (see the 1024px block in the responsive section). */
.page-body {
  padding-block: var(--space-6) var(--space-7);
}

.page-body > * + *,
.page-body__main > * + * {
  margin-top: var(--space-7);
}

/* Reading column with vertical rhythm */
.content {
  max-width: var(--content-max);
}

.content > * + * {
  margin-top: var(--space-4);
}

.content > h3 {
  margin-top: var(--space-6);
}

.content > h2 + *,
.content > h3 + * {
  margin-top: var(--space-3);
}

/* Direct 35–45 word answer right under an H2 (featured snippets, AI answers) */
.answer {
  padding-left: var(--space-4);
  font-size: var(--fs-lg);
  color: var(--color-secondary);
  border-left: 4px solid var(--color-accent);
}

.content ul:not([class]),
.content ol:not([class]) {
  padding-left: var(--space-5);
}

.content li + li {
  margin-top: var(--space-2);
}

.content li::marker {
  color: var(--color-primary);
}

.content figure img {
  border-radius: var(--radius-lg);
}

figcaption {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Full-width bands */
.section {
  padding-block: var(--space-7);
}

.section--alt {
  background-color: var(--color-surface);
}

/* Tables scroll sideways on narrow screens instead of widening the page */
.table-wrap {
  overflow-x: auto;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
}

.table-wrap table {
  width: 100%;
  font-size: var(--fs-sm);
}

.table-wrap th,
.table-wrap td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-width) solid var(--color-border);
}

.table-wrap th {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
  background-color: var(--color-surface-alt);
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}


/* 5. COMPONENTS
   ========================================================================== */

/* 5.1 Skip link -------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
  background-color: var(--color-accent);
  border-radius: var(--radius-md);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* 5.2 Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  color: var(--color-text-on-dark);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  color: var(--color-text-on-dark);
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn--secondary {
  color: var(--color-primary);
  background-color: var(--color-bg);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  color: var(--color-primary-hover);
  background-color: var(--color-surface);
  border-color: var(--color-primary-hover);
}

.btn--accent {
  color: var(--color-secondary);
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--accent:hover {
  color: var(--color-secondary);
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Navy sections only */
.btn--ghost {
  color: var(--color-text-on-dark);
  background-color: transparent;
  border-color: var(--color-text-on-dark);
}

.btn--ghost:hover {
  color: var(--color-text-on-dark);
  background-color: color-mix(in srgb, var(--color-text-on-dark) 10%, transparent);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* 5.3 Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: var(--color-text-on-dark);
  background-color: var(--color-secondary);
  box-shadow: var(--shadow-md);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--header-height);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  margin-right: auto;
  border-radius: var(--radius-sm);
}

.site-logo img {
  width: auto;
  height: 32px;
}

.nav-toggle,
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding-inline: var(--space-2);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.nav-toggle:hover,
.search-toggle:hover {
  background-color: var(--color-secondary-hover);
}

.nav-toggle__label {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

/* 5.4 Navigation — mobile first: a panel under the header -------------- */

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-height));
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  padding: var(--space-2) var(--space-4) var(--space-5);
  background-color: var(--color-secondary);
  border-top: var(--border-width) solid var(--color-secondary-hover);
  box-shadow: var(--shadow-lg);
}

/* main.js only flips aria-expanded; CSS does the showing */
.nav-toggle[aria-expanded="true"] + .site-nav {
  display: block;
  animation: reveal var(--duration-base) var(--ease-out);
}

body:has(.nav-toggle[aria-expanded="true"]) {
  overflow: hidden;
}

.site-nav__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: var(--border-width) solid var(--color-secondary-hover);
}

.site-nav__link {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-text-on-dark);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.site-nav__link:hover {
  color: var(--color-text-on-dark);
  background-color: var(--color-secondary-hover);
}

/* Current page or current silo: gold bar on the left (bottom on desktop) */
.site-nav__link[aria-current="page"],
.is-current-section > .site-nav__link {
  box-shadow: inset 4px 0 0 var(--color-accent);
}

.site-nav__sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-sm);
}

.site-nav__sub-toggle:hover {
  background-color: var(--color-secondary-hover);
}

.site-nav__sub-toggle .icon {
  transition: transform var(--duration-base) var(--ease-out);
}

.site-nav__sub-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.site-nav__sub {
  display: none;
  grid-column: 1 / -1;
  padding: 0 0 var(--space-2) var(--space-4);
}

.site-nav__sub-toggle[aria-expanded="true"] + .site-nav__sub {
  display: block;
  animation: reveal var(--duration-base) var(--ease-out);
}

.site-nav__sub a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-dark);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.site-nav__sub a:hover,
.site-nav__sub a[aria-current="page"] {
  color: var(--color-text-on-dark);
  background-color: var(--color-secondary-hover);
}

/* 5.5 Search dialog ----------------------------------------------------- */

.search-dialog {
  width: calc(100% - 2 * var(--space-4));
  max-width: 640px;
  margin: var(--space-8) auto auto;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.search-dialog::backdrop {
  background-color: var(--color-secondary);
  opacity: 0.7;
}

.search {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.search__label {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
}

/* Shared text-field look: search, calculator, contact form */
.search__input,
.calc input,
.form input,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-md);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: var(--border-width) solid var(--color-text-muted);
  border-radius: var(--radius-sm);
}

.search__input:focus-visible,
.calc input:focus-visible,
.form input:focus-visible,
.form textarea:focus-visible {
  border-color: var(--color-primary);
}

.search__results {
  display: grid;
  gap: var(--space-1);
  max-height: 50vh;
  overflow-y: auto;
}

.search__results:empty {
  display: none;
}

/* Result rows are written by search.js */
.search__results a {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.search__results a:hover,
.search__results a:focus {
  background-color: var(--color-surface);
}

.search__result-title {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
}

.search__result-url {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.search__empty {
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.search__close {
  justify-self: end;
}

/* 5.6 Breadcrumb -------------------------------------------------------- */

.breadcrumb {
  padding-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "\203A";
  color: var(--color-text-muted);
}

.breadcrumb__item a {
  display: inline-flex;
  align-items: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  color: var(--color-text-muted);
}

.breadcrumb__item a:hover {
  color: var(--color-primary);
}

.breadcrumb__item[aria-current="page"] {
  min-height: var(--tap-min);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

/* 5.7 Hero -------------------------------------------------------------- */

.hero {
  padding-block: var(--space-4) var(--space-6);
}

.hero__inner > * {
  max-width: var(--content-max);
}

.hero__title {
  margin-bottom: var(--space-4);
}

.hero__lead {
  font-size: var(--fs-lg);
}

.hero__actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.hero__note {
  margin-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.byline {
  margin-top: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.byline a {
  font-weight: var(--fw-semibold);
}

/* 5.8 Featured image ---------------------------------------------------- */

.feature-image img {
  width: 100%;
  max-width: var(--content-max);
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-lg);
}

/* 5.9 Table of contents ------------------------------------------------- */

.toc {
  max-width: var(--content-max);
  padding: var(--space-4) var(--space-5);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.toc__title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-secondary);
}

.toc__list {
  margin-top: var(--space-1);
  padding-left: var(--space-5);
  font-size: var(--fs-sm);
  list-style: decimal;
}

.toc__list li::marker {
  color: var(--color-text-muted);
}

.toc__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

/* 5.10 Steps ------------------------------------------------------------ */

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-5);
}

.step {
  counter-increment: step;
  position: relative;
  padding-left: var(--space-7);
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-extrabold);
  color: var(--color-secondary);
  background-color: var(--color-accent);
  border-radius: var(--radius-pill);
}

.step__title {
  margin-bottom: var(--space-2);
}

.step > p + p {
  margin-top: var(--space-3);
}

.step__figure,
.figure--phone {
  max-width: 240px;
  margin-top: var(--space-4);
}

.step__figure img,
.figure--phone img {
  background-color: var(--color-surface-alt);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* 5.11 Callout ---------------------------------------------------------- */

.callout {
  max-width: var(--content-max);
  padding: var(--space-4) var(--space-5);
  background-color: var(--color-surface-alt);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
}

.callout--warning {
  border-left-color: var(--color-warning);
}

.callout__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
}

.callout > p + p {
  margin-top: var(--space-2);
}

/* 5.12 Cards and related pages ------------------------------------------ */

.card-grid {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.card {
  position: relative;
  height: 100%;
  padding: var(--space-5);
  background-color: var(--color-bg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.card:hover,
.card:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.card__title {
  font-size: var(--fs-lg);
}

.card__link {
  color: var(--color-secondary);
  text-decoration: none;
}

.card__link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Stretched link: the whole card is the click target */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.card__link:focus-visible {
  outline: 0;
  box-shadow: none;
}

.card__link:focus-visible::after {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--color-focus-inner);
}

.card__text {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.related {
  padding-block: var(--space-7);
  background-color: var(--color-surface);
}

/* 5.13 FAQ -------------------------------------------------------------- */

.faq {
  padding-block: var(--space-7);
  border-top: var(--border-width) solid var(--color-border);
}

.faq h2 {
  margin-bottom: var(--space-3);
}

/* .faq__intro holds the H2 and its direct answer; .faq__list holds the H3 and
   the questions. They sit side by side from 1024px. */
.faq__intro {
  margin-bottom: var(--space-6);
}

.faq__title {
  margin-bottom: var(--space-2);
}

/* Questions column: lets long words wrap inside the desktop grid */
.faq__list {
  min-width: 0;
}

/* Each question is an H4 inside <summary> */
.faq__question h4 {
  font: inherit;
  color: inherit;
}

.faq__item {
  max-width: var(--content-max);
  border-bottom: var(--border-width) solid var(--color-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--tap-min);
  padding-block: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--color-secondary);
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  line-height: 1;
  color: var(--color-primary);
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-pill);
}

.faq__item[open] > .faq__question::after {
  content: "\2212";
}

.faq__question:hover {
  color: var(--color-primary);
}

.faq__answer {
  padding-bottom: var(--space-4);
}

.faq__answer > * + * {
  margin-top: var(--space-3);
}

/* 5.14 Author / trust box ----------------------------------------------- */

.author-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  max-width: var(--content-max);
  padding: var(--space-5);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.author-box__photo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-pill);
}

.author-box__body {
  font-size: var(--fs-sm);
}

.author-box__body > * + * {
  margin-top: var(--space-2);
}

.author-box__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
}

/* 5.15 CTA section ------------------------------------------------------ */

.cta {
  padding-block: var(--space-8);
  color: var(--color-text-muted-on-dark);
  background-color: var(--color-secondary);
}

.cta__inner {
  max-width: calc(var(--content-max) + 2 * var(--space-4));
  text-align: center;
}

.cta__title {
  color: var(--color-text-on-dark);
}

.cta__text {
  margin-top: var(--space-3);
  font-size: var(--fs-lg);
}

.cta__actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* 5.16 Footer ----------------------------------------------------------- */

.site-footer {
  padding-top: var(--space-8);
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-dark);
  background-color: var(--color-secondary);
  border-top: var(--border-width) solid var(--color-secondary-hover);
}

.site-footer a {
  color: var(--color-text-muted-on-dark);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  color: var(--color-text-on-dark);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-5);
}

.site-footer__title {
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-on-dark);
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding-block: var(--space-2);
  line-height: var(--lh-snug);
}

.site-footer__bottom {
  margin-top: var(--space-7);
  padding-bottom: var(--space-5);
  font-size: var(--fs-xs);
}

.site-footer__bottom > p {
  padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--color-secondary-hover);
}

/* 5.17 Time calculator -------------------------------------------------- */

.calc {
  display: grid;
  gap: var(--space-4);
  max-width: var(--content-max);
  padding: var(--space-5);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.calc__field label,
.form__field label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
}

.calc__result {
  display: block;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-secondary);
  background-color: var(--color-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
}

/* 5.18 Contact form ----------------------------------------------------- */

.form {
  display: grid;
  gap: var(--space-4);
  max-width: var(--content-max);
}

.form textarea {
  min-height: 160px;
  resize: vertical;
}

.form :user-invalid {
  border-color: var(--color-danger);
}

.form .btn {
  justify-self: start;
}

.form__hint {
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.form__status {
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-success);
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-md);
}

/* 5.19 404 page --------------------------------------------------------- */

.error-page .search {
  max-width: var(--content-max);
  padding: 0;
}

/* 5.20 Ad slot ---------------------------------------------------------- */

/* Space is reserved before the ad loads, so nothing below it jumps (CLS).
   Placed between sections only, never inside steps or forms. */
.ad-slot {
  max-width: var(--content-max);
  min-height: 300px;
  padding: var(--space-2);
  text-align: center;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
}

.ad-slot__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ad-slot .adsbygoogle {
  display: block;
  min-height: 250px;
}


/* 6. UTILITIES
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: var(--fs-xs); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }


/* 7. RESPONSIVE
   ========================================================================== */

/* Tablet: 768px and up */
@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-5);
  }

  .cta__inner {
    max-width: calc(var(--content-max) + 2 * var(--space-5));
  }

  .page-body {
    padding-block: var(--space-7) var(--space-8);
  }

  .section,
  .related,
  .faq {
    padding-block: var(--space-8);
  }

  .hero {
    padding-block: var(--space-5) var(--space-7);
  }

  .hero__actions,
  .cta__actions {
    display: flex;
    flex-wrap: wrap;
  }

  .cta__actions {
    justify-content: center;
  }

  .step {
    padding-left: var(--space-8);
  }

  .step::before {
    width: 40px;
    height: 40px;
    font-size: var(--fs-md);
  }

  .step__figure,
  .figure--phone {
    max-width: 320px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .author-box {
    gap: var(--space-5);
  }

  .author-box__photo {
    width: 96px;
    height: 96px;
  }

  .search-dialog {
    margin-top: var(--space-9);
  }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-6);
  }

  .cta__inner {
    max-width: calc(var(--content-max) + 2 * var(--space-6));
  }

  h1 {
    font-size: var(--fs-4xl);
  }

  .hero {
    padding-block: var(--space-6) var(--space-8);
  }

  /* Centred hero on desktop */
  .hero__inner {
    text-align: center;
  }

  .hero__inner > * {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  /* Two-column article: image and main text on the left, sticky TOC on the
     right, together filling the container from edge to edge */
  .page-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    gap: var(--space-7);
    align-items: start;
  }

  .page-body > * + * {
    margin-top: 0;
  }

  .page-body > .feature-image,
  .page-body__main {
    grid-column: 1;
  }

  .page-body__aside {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .page-body__aside .toc__list {
    font-size: var(--fs-xs);
  }

  /* Steps: text on the left, the phone illustration beside it */
  .step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    grid-template-rows: auto auto 1fr;
    column-gap: var(--space-6);
    align-items: start;
  }

  .step > :not(.step__figure) {
    grid-column: 1;
  }

  .step__figure {
    grid-column: 2;
    grid-row: 1 / -1;
    margin-top: 0;
  }

  /* FAQ band: intro on the left, questions on the right */
  .faq__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-8);
    align-items: start;
  }

  .faq__intro {
    margin-bottom: 0;
  }

  .faq__item {
    max-width: none;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .site-logo img {
    height: 36px;
  }
}

/* Horizontal navigation: 1200px and up (= --container-max). Six items with
   their 44px sub-menu buttons do not fit beside the logo at 1024px, so the
   menu button stays until here. See BLUEPRINT.md §12. */
@media (min-width: 1200px) {
  .nav-toggle {
    display: none;
  }

  body:has(.nav-toggle[aria-expanded="true"]) {
    overflow: visible;
  }

  .site-nav {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    background-color: transparent;
    border-top: 0;
    box-shadow: none;
  }

  .site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  .site-nav__item {
    position: relative;
    display: flex;
    border-bottom: 0;
  }

  .site-nav__link {
    padding-inline: var(--space-3) var(--space-1);
  }

  .site-nav__link[aria-current="page"],
  .is-current-section > .site-nav__link {
    box-shadow: inset 0 -3px 0 var(--color-accent);
  }

  .site-nav__sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 260px;
    padding: var(--space-2);
    background-color: var(--color-bg);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }

  /* The last two menus open leftwards so they never pass the right edge */
  .site-nav__item:nth-last-child(-n + 2) > .site-nav__sub {
    left: auto;
    right: 0;
  }

  .site-nav__sub a {
    color: var(--color-text);
  }

  .site-nav__sub a:hover,
  .site-nav__sub a[aria-current="page"] {
    color: var(--color-primary);
    background-color: var(--color-surface);
  }
}

/* Hover also opens sub-menus, but only where a real pointer exists */
@media (min-width: 1200px) and (hover: hover) {
  .site-nav__item:hover > .site-nav__sub {
    display: block;
    animation: reveal var(--duration-base) var(--ease-out);
  }
}


/* 8. MOTION, FORCED COLOURS & PRINT
   ========================================================================== */

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(calc(-1 * var(--space-2)));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Windows High Contrast: keep edges that were drawn with shadows or fills */
@media (forced-colors: active) {
  .btn,
  .card,
  .callout,
  .toc,
  .author-box {
    border: var(--border-width) solid CanvasText;
  }

  .site-nav__link[aria-current="page"],
  .is-current-section > .site-nav__link {
    text-decoration: underline;
  }
}

@media print {
  .skip-link,
  .site-header,
  .search-dialog,
  .hero__actions,
  .related,
  .cta,
  .site-footer {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  .content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
