/* small-group study workspace
   Desktop-first with a single narrow breakpoint. Long-form reading is the point, so the
   measure is capped and body text stays large enough to read for twenty minutes. */

:root {
  /* Blue theme. Colour values copied from the OVV Control Panel's own
     templates/base.html (its :root and --skin-* tokens) so the two sites match.
     Values only: no Control Panel code, markup or dependency is used here, and
     small-group keeps its own layout, spacing and type.

     Surfaces follow the Control Panel's arrangement: the page is the deepest
     colour, cards sit above it, and form controls are inset — darker than the
     card they sit on, but still lighter than the page.

     Contrast against the page: ink 14.7:1, ink-soft 11.4:1, ink-faint 7.3:1,
     link 8.8:1; button text on the fill 5.0:1. All above WCAG AA. */

  --page: #070d18;          /* --skin-bg */
  --canvas: #0c1626;        /* --skin-canvas */
  --card: #1b2a43;          /* --skin-surface */
  --field: #17243a;         /* --skin-control / --skin-surface-raised */
  --raised: #1b2a43;        /* --skin-surface */
  --deep: #0f172a;          /* --skin-surface-deep */

  --ink: #edf5ff;           /* --skin-text */
  --ink-soft: #b9c8da;      /* --skin-text-soft */
  --ink-faint: #91a3bc;     /* --skin-muted */
  --ink-subtle: #7186a2;    /* --skin-subtle */

  --rule: #2a3b55;          /* --skin-border */
  --rule-strong: #354965;   /* --skin-border-strong */

  --accent: #65b5ff;            /* --blue: links, rules, emphasis */
  --accent-fill: #1677a6;       /* --skin-action-info: solid buttons */
  --accent-fill-hover: #0e7490; /* --skin-action-info-hover */
  --accent-soft: #122f4a;       /* --skin-info-zone */
  --on-accent: #ffffff;         /* --skin-action-text */

  --ok: #43f0ad;            /* --skin-good-border */
  --ok-bg: #123b31;         /* --skin-good-zone */
  --err: #ff7189;           /* --skin-bad-border */
  --err-bg: #491d2a;        /* --skin-bad-zone */
  --warn: #f0b94d;          /* --skin-warn-border */
  --info-bg: #122f4a;       /* --skin-info-zone */

  --focus: #6bb6ff;         /* --skin-info-border */
  --hover: rgba(89, 169, 255, .10);  /* --skin-hover */
  --shadow: 0 22px 80px rgba(0, 0, 0, .34);

  --radius: 8px;
  --measure: 38rem;

  /* Native form controls, scrollbars and autofill follow the dark theme. */
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  /* The Control Panel's faint blue glow at the top of the page (--skin-body-bg). */
  background: radial-gradient(circle at 58% -20%, rgba(48, 116, 196, .16), transparent 38%), var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.65;
}

h1, h2, h3, h4, .brand, .mainnav, button, input, select, textarea, table, .tag, .savestate, .hint {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1 { font-size: 1.85rem; line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .4rem; }

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

.skip {
  position: absolute; left: -9999px;
}
.skip:focus { left: 1rem; top: .5rem; background: var(--raised); color: var(--ink); border: 1px solid var(--accent); padding: .5rem 1rem; z-index: 10; }

/* ---------------------------------------------------------------- chrome */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
.topbar__inner {
  max-width: 68rem; margin: 0 auto; padding: .6rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.05rem; }
.mainnav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
.mainnav a { text-decoration: none; color: var(--ink-soft); padding: .2rem 0; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.topbar__account { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.topbar__who { color: var(--ink-faint); }

.page { max-width: 68rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.centred { max-width: 26rem; margin: 3rem auto; }

.footer {
  max-width: 68rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule); color: var(--ink-faint); font-size: .85rem;
}
.footer p { margin: .25rem 0; }

/* ----------------------------------------------------------- components */

.lede { color: var(--ink-soft); max-width: var(--measure); }
.muted { color: var(--ink-faint); font-size: .9rem; }
.hint { display: block; color: var(--ink-faint); font-size: .84rem; margin-top: .25rem; }

.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 1.25rem 0; box-shadow: var(--shadow);
}
.card--highlight { border-color: var(--accent); background: var(--accent-soft); }
.card__title { margin-top: 0; font-size: 1.1rem; }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; max-width: var(--measure); }
.flash--ok { background: var(--ok-bg); color: var(--ok); }
.flash--error { background: var(--err-bg); color: var(--err); }
.flash--info { background: var(--info-bg); color: var(--ink-soft); }

.notice {
  background: var(--info-bg); border-left: 3px solid var(--ink-faint);
  padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem; color: var(--ink-soft); max-width: var(--measure);
}

.tag {
  display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .1rem .45rem; border-radius: 3px; vertical-align: middle;
}
.tag--active { background: var(--accent-fill); color: var(--on-accent); }
.tag--source { background: var(--rule); color: var(--ink-soft); }
.tag--leader { background: var(--info-bg); color: var(--ink-soft); }

button, .button {
  font-size: .95rem; padding: .55rem 1.1rem; border-radius: var(--radius);
  /* The solid action fill, not the lighter link blue: white text needs the darker
     of the two to stay readable. */
  border: 1px solid var(--accent-fill); background: var(--accent-fill); color: var(--on-accent);
  cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover {
  background: var(--accent-fill-hover); border-color: var(--accent-fill-hover);
}
button.linkish {
  background: none; border: none; color: var(--accent); padding: 0;
  text-decoration: underline; font-size: .9rem;
}

input, select, textarea {
  font-size: 1rem; padding: .55rem .7rem; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--field); color: var(--ink); width: 100%;
}
label { display: block; margin-bottom: .9rem; font-size: .92rem; color: var(--ink-soft); }
label input, label select, label textarea { margin-top: .3rem; }

/* A field being typed into should be obvious without relying on the focus ring alone. */
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
::placeholder { color: var(--ink-faint); opacity: 1; }
::selection { background: var(--accent-fill); color: var(--on-accent); }

.stack { max-width: 24rem; }
.stack--tight { max-width: 30rem; margin-top: 1rem; }
.inline { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; margin: .5rem 0; }
.inline label { margin-bottom: 0; }
.inline select, .inline input { width: auto; min-width: 12rem; }

.grid { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: .75rem; }
.grid th, .grid td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); }
.grid th { color: var(--ink-faint); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.grid form { margin: 0; }

.token { display: block; word-break: break-all; background: var(--field); color: var(--ink); border: 1px solid var(--rule); padding: .6rem .8rem; border-radius: var(--radius); font-size: .85rem; }

/* -------------------------------------------------------------- reading */

.lesson { max-width: var(--measure); }
.lesson__meta { color: var(--ink-faint); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .2rem; }
.lesson__body p { margin: 0 0 1.1rem; }
.lesson__h { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }
.lesson__list { padding-left: 1.3rem; }
.lesson__list li { margin-bottom: .5rem; }
.blank-item { display: inline-block; min-width: 8rem; border-bottom: 1px dotted var(--ink-faint); }
.lesson__closing { margin: 2rem 0; font-style: italic; color: var(--ink-soft); }

.scripture, .pull {
  margin: 1.4rem 0; padding: .3rem 0 .3rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--ink-soft);
}
.pull { border-left-color: var(--rule); font-style: italic; }
.scripture p, .pull p { margin: 0 0 .4rem; }
.scripture cite, .pull cite { display: block; font-size: .85rem; font-style: normal; color: var(--ink-faint); }

.siglines__wrap { margin: 1.5rem 0; }
.siglines { font-family: monospace; font-size: .85rem; color: var(--ink-faint); margin: .5rem 0; }

.studylist { padding-left: 1.4rem; max-width: var(--measure); }
.studylist li { margin-bottom: .55rem; }
.studylist .muted { margin-left: .4rem; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .92rem; }

/* ------------------------------------------------------------ workspace */

.workspace { margin: 2.5rem 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.qlist { list-style: none; padding: 0; counter-reset: q; }
.q { margin: 0 0 2.25rem; padding: 0 0 1.5rem; border-bottom: 1px solid var(--rule); }
.q:last-child { border-bottom: none; }
.q__passage { margin: 0 0 .2rem; font-size: 1rem; color: var(--accent); }
.q__prompt { margin: 0 0 .7rem; }
.q__label { display: block; font-size: .82rem; color: var(--ink-faint); margin-bottom: .25rem; }
.answer { width: 100%; resize: vertical; line-height: 1.6; font-family: Georgia, serif; min-height: 6rem; }
.answer--tall { min-height: 10rem; }

.q__foot { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.savestate { margin-left: auto; font-size: .82rem; min-height: 1.2em; }
.savestate--saving { color: var(--ink-faint); }
.savestate--pending { color: var(--ink-soft); }
.savestate--ok { color: var(--ok); }
.savestate--error { color: var(--err); font-weight: 600; }
.share { margin-top: .4rem; }

.sharedq { margin: 1.75rem 0; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); max-width: var(--measure); }
.sharedq h3 { margin-top: 0; }
.sharedq__answers { list-style: none; padding: 0; }
.sharedq__answers li { margin-bottom: 1rem; }
.sharedq__body { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: .7rem .9rem; margin-top: .25rem; }

.resources { margin: 2.5rem 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.resources ul { list-style: none; padding: 0; }
.resources li { margin-bottom: .6rem; }
.res__note { display: block; color: var(--ink-faint); font-size: .85rem; }

.tnotes { background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--ink-soft); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 2rem 0; font-size: .9rem; }
.tnotes h4 { margin: 0 0 .3rem; color: var(--ink); }
.tnotes__tag { font-weight: 400; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.tnotes__lede { margin: 0 0 .6rem; color: var(--ink-soft); }
.tnotes ul { margin: 0; padding-left: 1.2rem; }
.tn__ref { color: var(--ink-faint); }

.notebook { list-style: none; padding: 0; max-width: var(--measure); }
.notebook li { margin-bottom: 1.25rem; }
.notebook h3 { margin: 0; }

.contentlist { list-style: none; padding: 0; }
.contentlist li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

.progress { font-size: .95rem; }

/* --------------------------------------------------------------- phone */

@media (max-width: 40rem) {
  html { font-size: 16px; }
  .page { padding: 1.25rem 1rem 3rem; }
  .topbar__inner { padding: .5rem 1rem; gap: .6rem; }
  .brand { width: 100%; }
  .mainnav { width: 100%; gap: .85rem; overflow-x: auto; padding-bottom: .2rem; }
  .topbar__account { margin-left: 0; width: 100%; justify-content: space-between; }
  .lesson, .notice, .lede, .sharedq { max-width: none; }
  .twocol { grid-template-columns: 1fr; gap: 1.5rem; }
  .q__foot { flex-direction: column; gap: .2rem; align-items: flex-start; }
  .savestate { margin-left: 0; }
  .inline { flex-direction: column; align-items: stretch; }
  .inline select, .inline input { min-width: 0; width: 100%; }
  .grid { display: block; overflow-x: auto; }
  .centred { margin: 1.5rem auto; }
  .siglines { font-size: .72rem; word-break: break-all; }
}
