/* Public Practice Engine demo — shared styling.

   One stylesheet for the landing, practice, studio, catalogue, and error
   pages so the public surface reads as one product. Deliberately restrained:
   the demo's job is to make a workflow legible, not to be decorative. */

:root {
  --ink: #17181c;
  --ink-soft: #4a4d57;
  --ink-faint: #6f7480;
  --paper: #fbfaf8;
  --panel: #ffffff;
  --line: #e2ddd5;
  --accent: #7a5c2e;
  --accent-soft: #f2ece2;
  --good: #256b4a;
  --warn: #8a4b12;
  --focus: #2b5fd9;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  padding: 0 1rem 4rem;
}

.wrap { max-width: 46rem; margin: 0 auto; }
.wrap-wide { max-width: 62rem; margin: 0 auto; }

/* --- demo label + header ------------------------------------------------ */

.demo-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  margin: 0 -1rem 2rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.01em;
}

header.site { padding: 1.5rem 0 2rem; }

h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.02rem; margin: 1.25rem 0 0.4rem; }

p { margin-bottom: 0.9rem; }

/* The reset zeroes padding, and list markers render outside the content box —
   so without padding here bullets hang over the edge of whatever card or
   disclosure contains them. Padding rather than margin keeps the marker in. */
ul, ol { padding-left: 1.4rem; margin-bottom: 0.9rem; }
/* Numerals plus a full stop are wider than a bullet, so an ordered list needs
   more room before its markers start hanging into the left margin. */
ol { padding-left: 2rem; }
li { margin-bottom: 0.3rem; }
li:last-child { margin-bottom: 0; }
/* A list running straight into a card reads as part of it; give it the same
   air a paragraph would have. */
ul + .card, ol + .card { margin-top: 1.5rem; }

/* Also emitted by the source renderer, and also flattened by the reset. */
blockquote {
  margin: 0 0 0.9rem;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* Source panels sit inside cards; keep their content off the edge. */
details > div > *:last-child { margin-bottom: 0; }
details > div table { margin: 0.4rem 0; }
p.lede { font-size: 1.1rem; color: var(--ink-soft); }
.muted { color: var(--ink-faint); font-size: 0.9rem; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- cards -------------------------------------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 { margin-top: 0; }

.choice-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin: 1.5rem 0;
}

.choice-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-decoration: none;
  color: inherit;
}

.choice-card:hover { border-color: var(--accent); }
.choice-card .kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.choice-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.choice-card p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0; }

/* --- buttons ------------------------------------------------------------ */

button, .btn {
  font: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0.6rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }
button:hover:not(:disabled) { border-color: var(--accent); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

/* --- forms -------------------------------------------------------------- */

label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
input[type="text"], input[type="number"], textarea, select {
  font: inherit;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 0.85rem;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
textarea.source-text { min-height: 16rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
legend { padding: 0 0.4rem; font-size: 0.9rem; color: var(--ink-soft); }

.option-row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.5rem; }
.option-row input[type="text"] { margin-bottom: 0; }
.option-row label { margin: 0; white-space: nowrap; }

/* --- answers ------------------------------------------------------------ */

.answers { display: grid; gap: 0.55rem; margin: 1rem 0; }

.answer-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  min-height: 48px;
  justify-content: flex-start;
}

.answer-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.chunk-tray { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.chunk {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
}
.chunk-slot {
  min-height: 3.2rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* --- feedback ----------------------------------------------------------- */

.feedback {
  border-left: 4px solid var(--line);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  background: var(--panel);
}
/* Result is carried by the words and the icon, never by colour alone. */
.feedback.correct { border-left-color: var(--good); }
.feedback.wrong { border-left-color: var(--warn); }
.feedback.recorded { border-left-color: var(--accent); }
.feedback .result-word { font-weight: 700; }

/* --- provenance / status pills ------------------------------------------ */

.pill {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  margin-right: 0.35rem;
}
.pill.state-raw::before { content: "○ "; }
.pill.state-prepared::before { content: "◑ "; }
.pill.state-edited::before { content: "◐ "; }
.pill.state-approved::before { content: "● "; }
.pill.state-draft::before { content: "○ "; }
.pill.state-published::before { content: "● "; }
.pill.state-dirty::before { content: "! "; }

.block-card { border-left: 3px solid var(--accent-soft); }
.block-card .block-text { white-space: pre-wrap; font-size: 0.95rem; margin: 0.6rem 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.table-scroll { overflow-x: auto; }

details { border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; background: var(--panel); }
summary { cursor: pointer; font-size: 0.95rem; min-height: 32px; }

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.85rem; }
.steps li { color: var(--ink-faint); }
.steps li[aria-current="step"] { color: var(--accent); font-weight: 700; }

.progress-line { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 0.5rem; }

footer.site {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.error-list { border-left: 4px solid var(--warn); padding: 0.75rem 1rem; background: var(--panel); margin-bottom: 1rem; }
.error-list ul { margin-left: 1.1rem; }

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

.skip-link {
  position: absolute; left: -9999px;
  background: var(--panel); padding: 0.6rem 1rem; border: 1px solid var(--accent);
}
.skip-link:focus { left: 1rem; top: 0.5rem; z-index: 10; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 34rem) {
  .card { padding: 1rem; }
  .button-row button, .button-row .btn { flex: 1 1 auto; }
}
