/* Shared base for every homepage prototype in this project.
   Only structure lives here: reset, picture placeholder frame, form status, the prototype switcher.
   Every colour and typeface comes from each page's own token block (style.css).
   Copied to prototypes/assets/proto.css by kit/scripts/scaffold.py. */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
:where(ul[class], ol[class]) { list-style: none; padding: 0; }   /* :where() keeps this at zero specificity */
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
p, li, dd { text-wrap: pretty; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--skip-bg, #000); color: var(--skip-ink, #fff);
  text-decoration: none; transition: top 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.skip:focus { top: 12px; }

/* Picture placeholders. The page sets --ph-bg, --ph-ink, --ph-font (and optionally --ph-size, --ph-pad);
   --ar sets the aspect ratio. The label names the photo that belongs in the slot. */
.ph {
  position: relative; display: grid; align-content: end;
  aspect-ratio: var(--ar, 4 / 3); width: 100%; min-width: 0;
  background: var(--ph-bg, #ddd); color: var(--ph-ink, #333);
  overflow: hidden; isolation: isolate;
}
.ph__label {
  position: relative; z-index: 1; display: block; max-width: 34ch;
  padding: var(--ph-pad, 12px 14px); font-family: var(--ph-font, inherit);
  font-size: var(--ph-size, 0.75rem); line-height: 1.35; letter-spacing: 0.01em;
}
.ph__label b { display: block; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.92em; margin-bottom: 2px; }

/* Honest form feedback (proto.js fills [data-status]) */
[data-status] { min-height: 1.4em; font-size: 0.875rem; }
[data-status][data-state="error"] { color: var(--error, #b3261e); }
[aria-invalid="true"] { outline: 2px solid var(--error, #b3261e); outline-offset: 1px; }

/* Prototype switcher: a small chip, bottom left, out of the page's way.
   A page can move it with .proto-switch { left: ... } in its own style.css (e.g. beside a side rail). */
.proto-switch {
  position: fixed; left: 12px; bottom: 12px; z-index: 90;
  font: 600 12px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #111; background: #fff; border: 1px solid rgb(0 0 0 / 0.18);
  border-radius: 999px; box-shadow: 0 6px 20px -8px rgb(0 0 0 / 0.35);
}
.proto-switch[open] { border-radius: 14px; }
.proto-switch summary {
  list-style: none; cursor: pointer; padding: 8px 14px; min-height: 36px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.proto-switch summary::-webkit-details-marker { display: none; }
.proto-switch summary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--switch-dot, #111); }
.proto-switch nav { display: grid; padding: 4px 6px 8px; max-height: min(70vh, 520px); overflow-y: auto; }
.proto-switch a { padding: 7px 10px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.proto-switch a:hover { background: #f1efeb; }
.proto-switch a[aria-current="page"] { background: #111; color: #fff; }
.proto-switch :focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.is-capture .proto-switch { display: none; }   /* screenshots taken by kit/scripts/capture.py */

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