/* St. Isidore Catholic School palette — from stisidore.org */
:root {
  --navy: #011e3a; --navy-2: #0b2e55; --blue: #2371d3; --blue-soft: #dce9fb;
  --gold: #fec733; --gold-dark: #d9a416; --gold-soft: #fff3cf;
  --bg: #f4f6f9; --tile: #fff; --line: #dfe4ea; --text: #3b3d49; --muted: #606973;
  --full: #9aa3ad; --full-soft: #eceff2; --ok: #1f8f4e; --ok-soft: #dcf3e5; --danger: #b42318;
  --hour: 52px;
  --heading: "Montserrat", system-ui, sans-serif;
  --body: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 var(--body); color: var(--text); }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--heading); font-weight: 700; color: var(--navy); letter-spacing: -.01em; }

/* ---- Header ---- */
/* wrap, so that if the nav can't fit beside the wordmark it drops to its own
   line instead of overlapping it — a backstop for whatever the breakpoints miss */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; row-gap: 10px;
  padding: 10px 24px; background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
/* .brand-mark is either the seal PNG or an inline cross SVG (settings.brand_mark). */
.brand .brand-mark { display: block; color: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
/* Header items never break mid-word — a wrapped "My signups" throws every
   baseline in the row out of line. They drop out by priority instead, in the
   media queries at the end of this file. */
.brand-school { font-family: var(--heading); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; white-space: nowrap; }
.brand-app { font-family: var(--heading); font-weight: 700; font-size: 18px; white-space: nowrap; }
.class-tag { margin-left: 14px; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: var(--navy);
  font-family: var(--heading); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.unofficial { color: var(--muted); font-size: 12px; }
.preview-card .unofficial { margin: 10px 0 0; opacity: .8; }
nav.user { display: flex; align-items: center; gap: 11px; font-weight: 500; flex-wrap: wrap; row-gap: 8px;
  margin-left: auto; }   /* keeps the links beside Sign out, away from the wordmark */
.top-action { margin: 0; }
nav.user a, .who { white-space: nowrap; }
.sep { color: rgba(255,255,255,.28); font-weight: 300; user-select: none; }
nav.user a { color: #fff; text-decoration: none; opacity: .9; }
nav.user a:hover { opacity: 1; }
nav.user form { margin: 0; }
.who { color: rgba(255,255,255,.7); }
.admin-badge { display: inline-block; margin-left: -6px; padding: 2px 9px; border-radius: 999px; background: var(--gold); color: var(--navy);
  font-family: var(--heading); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px; }

/* Week / Month toggle */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: 4px; }
.view-toggle a { padding: 7px 14px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.view-toggle a + a { border-left: 1px solid var(--line); }
.view-toggle a.active { background: var(--navy); color: #fff; }

/* Month grid */
.month { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); min-width: 680px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.month .dow-head { padding: 8px 4px; text-align: center; font-family: var(--heading); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfc; }
.month .cell { min-height: 108px; padding: 4px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month .cell:nth-child(7n+1) { border-left: 0; }
.month .cell.other { background: #f7f8fa; color: var(--muted); }
.month .cell.today { background: #f8fafe; }
.month .dom { display: inline-block; min-width: 26px; line-height: 26px; text-align: center; font-family: var(--heading); font-weight: 700;
  font-size: 13px; border-radius: 50%; color: inherit; text-decoration: none; }
.month .today .dom { background: var(--navy); color: var(--gold); }
.month .chips { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.month .chip { font-size: 11.5px; }
.month .chip .t { color: var(--muted); margin-right: 3px; }
.month .more { font-size: 11px; color: var(--muted); padding-left: 4px; }
@media (max-width: 640px) {
  .month .cell { min-height: 80px; }
  .month .chip .t { display: none; }
  .admin-badge { margin-left: 0; }
}

main { flex: 1; width: 100%; max-width: 1280px; margin: 24px auto; padding: 0 16px; }

/* Shown site-wide while settings.open_registration is on, so a testing-only
   setting can't quietly survive into go-live. */
.testing-banner { background: var(--gold-soft); border-bottom: 1px solid var(--gold-dark);
  color: #6b4d00; padding: 9px 24px; font-size: 13.5px; text-align: center; }
.testing-banner strong { color: #543f00; }

/* ---- Footer ---- */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.foot .motto { font-family: var(--heading); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }

/* ---- Common ---- */
.tile { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(1,30,58,.05); }
.form-tile { max-width: 520px; margin: 0 auto; }
.form-tile.wide { max-width: 760px; }
.form-tile h1 { margin-top: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.flash { background: var(--ok-soft); border: 1px solid var(--ok); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.flash.flash-bad { background: #fde8e6; border-color: var(--danger); color: var(--danger); }
.error { background: #fde8e6; border: 1px solid var(--danger); color: var(--danger); border-radius: 8px; padding: 10px 14px; }

label { display: block; margin: 12px 0 4px; font-weight: 500; color: var(--navy); }
input[type=email], input[type=password], input[type=text] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--tile); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.large { padding: 12px 26px; font-size: 16px; }
form .btn { margin-top: 16px; }

/* ---- Landing: obscured preview of the week + sign-in card ---- */
.preview-wrap { position: relative; }
.preview .week { filter: blur(2.5px); pointer-events: none; user-select: none; }
.preview .legend { filter: blur(1px); }
.block.ghost, .chip.ghost { background: var(--blue-soft); border-left-color: var(--blue); }
.block.ghost .block-title { color: var(--navy); opacity: .7; }
.preview-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(180deg, rgba(1,30,58,.18), rgba(1,30,58,.42)); border-radius: 8px; }
.preview-card { background: var(--tile); border-radius: 16px; padding: 30px 36px 26px; max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 12px 40px rgba(1,30,58,.35); border-top: 5px solid var(--gold); }
.preview-card .brand-mark { display: block; margin: 0 auto 10px; background: var(--navy); border-radius: 50%; padding: 4px; color: #fff; box-sizing: content-box; }
.preview-card svg.brand-mark { padding: 12px; }
.preview-card h2 { font-size: 26px; margin: 0 0 8px; text-transform: none; letter-spacing: -.01em; }
.preview-card .muted { margin: 0 0 20px; }
.preview-card .small { margin: 14px 0 0; }
.eyebrow { font-family: var(--heading); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dark); margin: 0 0 6px; }
.pillars { display: flex; justify-content: center; gap: 12px 40px; flex-wrap: wrap; margin: 28px 0 8px;
  font-family: var(--heading); font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--navy); }
.pillars span::before { content: "✦"; color: var(--gold-dark); margin-right: 10px; font-size: 11px; }

/* ---- Week grid ---- */
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.week-nav h1 { font-size: 20px; margin: 0 0 0 8px; }
.legend { margin-left: auto; color: var(--muted); font-size: 13px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 2px 0 10px; }
.sw.open { background: var(--blue-soft); border-left: 3px solid var(--blue); }
.sw.mine { background: var(--gold-soft); border-left: 3px solid var(--gold-dark); }
.sw.full { background: var(--full-soft); border-left: 3px solid var(--full); }

.week-scroll { overflow-x: auto; }
.week { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: 860px; }
.corner { border-bottom: 1px solid var(--line); }
.allday-label { font-size: 11px; color: var(--muted); text-align: right; padding: 4px 6px; }
.day-head { text-align: center; padding: 8px 4px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.day-head .dow { display: block; font-family: var(--heading); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.day-head .dom { display: inline-block; min-width: 30px; line-height: 30px; font-family: var(--heading); font-size: 16px; font-weight: 700; color: var(--navy); border-radius: 50%; }
.day-head.today .dom { background: var(--navy); color: var(--gold); }
.allday-cell { min-height: 26px; padding: 2px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.chip { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--blue-soft); border-left: 3px solid var(--blue); color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gutter { position: relative; }
.hour-label { height: var(--hour); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.hour-label:first-child { transform: none; padding-top: 1px; }
.day-col { position: relative; border-left: 1px solid var(--line); height: calc(var(--hours) * var(--hour)); }
.day-col.today { background: #f8fafe; }
.hour-line { height: var(--hour); border-top: 1px solid var(--line); }
.block { position: absolute; left: 2px; right: 3px; padding: 3px 6px; border-radius: 5px; font-size: 12px; line-height: 1.25; overflow: hidden;
  background: var(--blue-soft); border-left: 3px solid var(--blue); color: inherit; text-decoration: none; }
.block:hover { filter: brightness(.96); }
.block.mine, .chip.mine { background: var(--gold-soft); border-left-color: var(--gold-dark); }
.block.full, .chip.full { background: var(--full-soft); border-left-color: var(--full); color: var(--muted); }
.block-time { display: block; font-size: 11px; color: var(--muted); }
.block-title { display: block; font-weight: 600; color: var(--navy); }
.block.full .block-title { color: var(--muted); }
.block-meta { position: absolute; right: 5px; top: 3px; font-size: 11px; color: var(--muted); }
/* Capacity bar along the bottom edge: how much of the slot is already taken. */
.block-fill { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--blue); opacity: .55; border-radius: 0 2px 0 0; }
.block.mine .block-fill { background: var(--gold-dark); }
.block.full .block-fill { background: var(--full); }

/* ---- Event & account pages ---- */
.facts { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; margin: 16px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.desc { white-space: pre-line; }
.status.mine { color: var(--gold-dark); font-weight: 600; }
.blockers { background: var(--full-soft); border-radius: 8px; padding: 10px 14px 10px 30px; color: var(--muted); }
.roster-h { margin-top: 28px; }
.admin-panel { margin-top: 28px; padding: 16px 18px; border: 1px dashed var(--gold-dark); border-radius: 10px; background: #fffdf5; }
.admin-panel .roster-h { margin-top: 0; }
.admin-panel h3 { font-size: 14px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .08em; }
.admin-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.admin-actions .btn { margin: 0; }
form.inline { display: inline; margin-left: 8px; }
form.inline .btn { margin: 0; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.inline-form label { margin: 0; }
.inline-form .btn { margin: 0; }
.inline-form select { flex: 1 1 220px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; max-width: 100%; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.danger-zone .btn { margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
fieldset.group { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
fieldset.group legend { padding: 0 6px; font-family: var(--heading); font-weight: 700; font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
fieldset.group .check { margin: 8px 0; }
fieldset.group input[type=email] { margin-bottom: 8px; }
.ok-tag, .warn-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.admin-badge.vol { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.ok-tag { background: var(--ok-soft); color: var(--ok); }
.warn-tag { background: var(--gold-soft); color: var(--gold-dark); }
code { background: var(--full-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row label { flex: 1 1 120px; }
input[type=date], input[type=time], input[type=number], textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
textarea { resize: vertical; }
.roster li, .signup-list li { margin: 6px 0; }
.signup-list { padding-left: 18px; }
h2 { font-size: 16px; margin: 22px 0 6px; text-transform: uppercase; letter-spacing: .08em; }

/* --- Header, as the window narrows: drop the least useful thing first. --- */
@media (max-width: 1200px) { .brand-school { display: none; } }
@media (max-width: 1120px) { .class-tag { display: none; } }
@media (max-width: 1040px) { .who, .sep { display: none; } nav.user { gap: 16px; } }

/* Below this the row can't hold everything, so the nav takes its own line under
   the wordmark, with Sign out pushed to the right edge. */
@media (max-width: 820px) {
  header.top { padding: 9px 14px; row-gap: 8px; }
  /* Sign out (order 0) stays on the first row with the wordmark; the links
     take the second row. */
  nav.user { width: 100%; order: 3; margin-left: 0; justify-content: flex-start;
    gap: 18px; font-size: 15px; }
  /* A smaller mark keeps the stacked header from eating the screen. */
  .brand .brand-mark { width: 36px; height: 36px; }
  .brand { gap: 10px; }
  .brand-app { font-size: 17px; }
}

@media (max-width: 640px) {
  nav.user { gap: 13px; font-size: 14px; }
  .btn { padding: 7px 13px; }
  .preview-overlay { align-items: flex-start; padding: 40px 12px; }
  .preview-card { padding: 22px 20px 20px; }
}
