/* Volunteer signup — design system.
   Formatted to match stsimon.church: Poppins body, Montserrat headings,
   the parish blue (#1E73BE) with the orange (#FFA621) as secondary accent.
   Class names are the contract used by src/render.js. */

:root {
  --ink: #2a2a2a;
  --ink-soft: #313131;
  --muted: #848484;
  --line: #e4e4e4;
  --surface: #ffffff;
  --field: #ffffff;
  --canvas: #f7f7f7;
  --accent: #1e73be;
  --accent-hover: #0a8dce;
  --accent-ink: #ffffff;
  --accent-alt: #ffa621;
  --ok: #1e6b3a;
  --ok-bg: #e7f6ec;
  --warn: #8a5a00;
  --warn-bg: #fff4dd;
  --danger: #a41f1f;
  --danger-bg: #fdeaea;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(42 42 42 / 6%), 0 6px 18px rgb(42 42 42 / 8%);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Montserrat", var(--font);
  color-scheme: light;
}

/* Dark theme. public/theme.js stamps data-theme on <html> before first paint;
   a stored preference wins, otherwise it follows the OS setting. Only the
   colour tokens change, so markup and component rules stay theme-agnostic. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9edf2;
  --ink-soft: #cdd6e0;
  --muted: #a3aebc;
  --line: #2b333d;
  --surface: #1a2027;
  --field: #131920;
  --canvas: #10151a;
  --accent: #7ab8f0;
  --accent-hover: #a9d3f8;
  --accent-ink: #0b1016;
  --accent-alt: #ffb347;
  --ok: #86e0a8;
  --ok-bg: #14301f;
  --warn: #f2c979;
  --warn-bg: #33270f;
  --danger: #ff9b9b;
  --danger-bg: #37171a;
  --shadow: 0 1px 2px rgb(0 0 0 / 45%), 0 8px 22px rgb(0 0 0 / 35%);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--canvas);
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

p {
  margin: 0 0 0.9em;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

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

:focus-visible {
  outline: 3px solid var(--accent-alt);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

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

.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 0.85rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 3rem;
}

.brand-name {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-tagline {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.admin-identity {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  padding: 0.35rem 0.75rem 0.35rem 0.6rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* The toggle needs theme.js; without scripting the site stays light. */
.no-js .theme-toggle {
  display: none;
}

/* logo.jpg has a baked-in white background, so it sits on a small light plate. */
:root[data-theme="dark"] .brand-logo {
  background: #ffffff;
  border-radius: 4px;
  box-sizing: content-box;
  padding: 4px 6px;
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.site-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.25rem 0;
}

.site-foot p {
  margin: 0;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 1rem;
}

.intro {
  margin: 0 0 1.5rem;
}

.intro p {
  color: var(--ink-soft);
  max-width: 46rem;
}

.shift-list {
  display: grid;
  gap: 0.6rem;
}

/* One row per shift: <details>/<summary> keeps the collapse native, so the
   list is scannable and the signup form is one click away. */

.shift-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shift-row.is-full {
  border-style: dashed;
}

.shift-row summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
}

.shift-row summary::-webkit-details-marker {
  display: none;
}

.shift-row summary:hover .shift-cta {
  filter: brightness(1.08);
}

.shift-row[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

.shift-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.shift-head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.shift-meta {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 550;
}

/* Roster page header line (render.js rosterPage). */
.shift-when {
  color: var(--ink-soft);
  font-weight: 550;
  margin: 0 0 0.15rem;
}

.shift-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.shift-side {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.9rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.capacity-line {
  font-size: 0.88rem;
  color: var(--muted);
}

.shift-cta {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
}

.shift-caret {
  width: 0.45rem;
  height: 0.45rem;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: translateY(-0.12rem) rotate(45deg);
}

.shift-row[open] .shift-caret {
  transform: translateY(0.1rem) rotate(-135deg);
}

.shift-body {
  padding: 1rem 1.1rem 1.1rem;
}

meter {
  width: 100%;
  height: 0.6rem;
  border: none;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  display: block;
}

meter::-webkit-meter-bar {
  background: var(--line);
  border: none;
  border-radius: 999px;
}

meter::-webkit-meter-optimum-value {
  background: var(--accent);
  border-radius: 999px;
}

meter::-moz-meter-bar {
  background: var(--accent);
  border-radius: 999px;
}

.shift-body meter {
  margin: 0 0 0.9rem;
}

.shift-links {
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.shift-closed {
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin: 0;
  font-size: 0.92rem;
}

.signup-block {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

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

fieldset {
  border: 0;
  margin: 0 0 0.5rem;
  padding: 0;
}

legend {
  font-weight: 650;
  margin-bottom: 0.5rem;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 0 0.9rem;
}

@media (min-width: 40rem) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

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

.field {
  margin: 0 0 0.9rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 550;
  margin-bottom: 0.3rem;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

textarea {
  resize: vertical;
  min-height: 3.2rem;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
  margin: 0 0 0.9rem;
}

.actions {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-in-out;
}

.button:hover {
  filter: brightness(1.06);
}

.button-quiet {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
  font-weight: 550;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

.button-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  font-weight: 550;
  padding: 0.5rem 0.9rem;
}

.cancel-form {
  margin-top: 1rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------- banners --- */

.banner {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.5rem;
  border: 1px solid transparent;
}

.banner p {
  margin: 0;
}

.banner p + p {
  margin-top: 0.35rem;
}

.banner-title {
  font-weight: 650;
}

.banner-success {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: currentColor;
}

.banner-notice {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: currentColor;
}

.banner-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: currentColor;
}

.banner-warning {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ------------------------------------------------------------ edit/roster --- */

.breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.status-line {
  color: var(--muted);
  margin: 0 0 1rem;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 620;
  /* Tinted rings read on both palettes; color-mix degradation is a plain label. */
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}

.pill-ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.pill-wait {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
}

.pill-off {
  background: var(--line);
  color: var(--muted);
}

.facts {
  display: grid;
  gap: 0.5rem 1rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}

.facts div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facts dd {
  margin: 0.1rem 0 0;
  font-weight: 550;
}

.roster {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
}

.roster caption {
  text-align: left;
  font-weight: 650;
  padding: 0.4rem 0;
}

.roster th,
.roster td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.4rem;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- admin --- */

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.admin-nav a[aria-current="page"] {
  font-weight: 650;
  text-decoration: none;
  color: var(--ink);
}

.table-card {
  padding-bottom: 0.75rem;
}

.table-scroll {
  overflow-x: auto;
}

.table-card table,
.filters table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-card th,
.table-card td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  vertical-align: top;
}

.table-card th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.inline-form {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
}

.inline-check {
  font-size: 0.85rem;
  margin-right: 0.35rem;
  white-space: nowrap;
}

.filters .actions {
  margin-top: 0.2rem;
}

.muted {
  color: var(--muted);
}

.empty p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 30rem) {
  .card {
    padding: 1rem;
  }

  .shift {
    padding: 1rem;
  }
}
