/* =========================================================
   SEPA Resource Library - main stylesheet (v0.4)
   Brand red: #651317
   ========================================================= */

:root {
  --red: #651317;
  --red-dark: #470d10;
  --red-tint: #f8eeee;
  --brass: #8c6a3f;
  --ink: #2a2420;
  --ink-soft: #5a534d;
  --paper: #fbfaf9;
  --card: #ffffff;
  --line: #e4ddd6;
  --focus: #3e5c76;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  margin: 0;
}

a { color: var(--red); }

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

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

/* =========================================================
   HOMEPAGE: centered logo on white, search, button cards
   ========================================================= */

body.home { background: #fff; }

.home-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-header { text-align: center; }
.home-logo { display: inline-block; }
.home-logo img { display: block; height: 130px; width: auto; }

.home-nav { margin-top: 20px; }

.search { display: block; max-width: 560px; margin: 0 auto; }
.search input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 11px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--red); }
.search input::placeholder { color: #8f877f; }

.nav-label {
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brass);
}

/* Button cards */
.nav-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(42, 36, 32, .06);
}
.nav-btn:hover { border-color: var(--red); background: var(--red-tint); color: var(--red); }

/* Small line icon above a button's text */
.btn-icon {
  width: 30px; height: 30px;
  fill: none; stroke: var(--red); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 4px;
}
.nav-btn:has(.btn-icon) { flex-direction: column; }

/* A button that shows a picture instead of text */
.nav-btn-image { padding: 0; overflow: hidden; }
.nav-btn-image img { display: block; width: 100%; height: 100%; max-height: 150px; object-fit: contain; }

.no-results { margin: 16px 0 0; font-size: 15px; color: var(--ink-soft); text-align: center; }

.home-footer {
  margin-top: auto;
  padding-top: 28px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .home-layout { padding: 20px 16px 12px; }
  .home-logo img { height: 104px; }
  .nav-list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nav-btn { min-height: 64px; font-size: 16px; }
}

/* =========================================================
   INSIDE PAGES (pages/*.html)
   ========================================================= */

.header {
  background: var(--red);
  color: #fff;
  padding: 24px;
}
.header h1 { color: #fff; font-size: 30px; }

.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
}
.section a { font-weight: 600; }

footer { text-align: center; padding: 30px; color: var(--ink-soft); }

/* =========================================================
   SHIFT SIGNUP PAGE (pages/shifts.html)
   ========================================================= */

.page-wrap { max-width: 760px; margin: 0 auto; padding: 20px 20px 48px; }

.page-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-logo { display: block; height: 72px; width: auto; }
.back-link { font-weight: 600; font-size: 16px; color: var(--red); }

.page-title { margin-top: 18px; font-size: 32px; color: var(--ink); }
.page-intro { margin: 6px 0 0; color: var(--ink-soft); }

.notice {
  margin: 16px 0 0; padding: 12px 16px; border-radius: 8px;
  background: #fbf3e4; border: 1px solid #ecd9b4; font-size: 15px;
}

.step { margin-top: 28px; }
.step[hidden] { display: none; }
.step-title { font-size: 21px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: 3px; margin-right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-family: 'Public Sans', Arial, sans-serif; font-size: 16px;
}

/* calendar */
.cal { margin-top: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month { font-size: 20px; }
.cal-nav {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fff; color: var(--red);
  font-size: 20px; cursor: pointer;
}
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow span { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); padding-bottom: 4px; }

.cal-day {
  position: relative;
  height: 52px; border-radius: 8px;
  border: 1.5px solid var(--line); background: #fff;
  font: inherit; font-weight: 600; font-size: 17px; color: var(--ink);
  cursor: pointer;
}
.cal-day.open:hover { border-color: var(--red); background: var(--red-tint); }
.cal-day.closed { background: #f6f4f2; color: #b3aaa2; border-color: transparent; cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--brass); }
.cal-day.picked { background: var(--red); border-color: var(--red); color: #fff; }
.cal-key { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); }

/* shifts */
.shift-list { margin-top: 14px; display: grid; gap: 10px; }
.shift-btn {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  text-align: left; padding: 16px 18px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  font: inherit; color: var(--ink); cursor: pointer;
}
.shift-btn strong { font-size: 18px; }
.shift-time { grid-column: 1; color: var(--ink-soft); font-size: 16px; }
.shift-spots { grid-column: 2; grid-row: 1 / 3; font-weight: 600; font-size: 15px; color: #2e7d4f; }
.shift-btn:hover { border-color: var(--red); background: var(--red-tint); }
.shift-btn:disabled { background: #f6f4f2; color: #b3aaa2; cursor: default; }
.shift-btn:disabled .shift-spots, .shift-btn:disabled .shift-time { color: #b3aaa2; }

/* form */
.picked { margin: 10px 0 4px; padding: 10px 14px; background: var(--red-tint); border-radius: 8px; font-weight: 600; }
.field { display: block; margin-top: 14px; font-weight: 600; font-size: 16px; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px; font: inherit; font-weight: 400;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.trap { position: absolute; left: -9999px; }
.form-error { margin: 14px 0 0; color: #a12020; font-weight: 600; }
.primary-btn {
  margin-top: 20px; width: 100%; padding: 16px;
  background: var(--red); color: #fff; border: none; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 18px; cursor: pointer;
}
.primary-btn:hover { background: var(--red-dark); }
.primary-btn:disabled { opacity: .6; }
.done h2 { font-size: 26px; color: var(--red); }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--red); text-decoration: underline; cursor: pointer; }

@media (max-width: 640px) {
  .page-logo { height: 56px; }
  .page-title { font-size: 26px; }
  .cal { padding: 10px; }
  .cal-grid { gap: 4px; }
  .cal-day { height: 44px; font-size: 16px; }
}

/* =========================================================
   DISCUSSION FORUMS (pages/forums.html)
   ========================================================= */

.forum-new-btn { margin-top: 24px; }
.forum-status { margin: 16px 0 0; color: var(--ink-soft); }

.topic-list { margin-top: 16px; display: grid; gap: 10px; }
.topic-card {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  color: var(--ink); text-decoration: none;
}
.topic-card:hover { border-color: var(--red); background: var(--red-tint); }
.topic-title { font-size: 18px; grid-column: 1; }
.topic-preview { grid-column: 1; color: var(--ink-soft); font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-meta { grid-column: 1; font-size: 13px; color: var(--ink-soft); }
.topic-count { grid-column: 2; grid-row: 1 / 4; align-self: center;
  font-size: 14px; font-weight: 600; color: var(--red); white-space: nowrap; }

.post { margin-top: 12px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
.post-main { margin-top: 8px; border-color: var(--red); }
.post-title { font-size: 24px; }
.post-meta { margin: 4px 0 8px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.replies-head { margin-top: 26px; font-size: 18px; }

.forum-form { margin-top: 28px; padding-top: 4px; }
.forum-form h2, .forum-form h3 { font-size: 21px; }

.forum-rules { margin-top: 32px; font-size: 14px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .topic-card { grid-template-columns: 1fr; }
  .topic-count { grid-column: 1; grid-row: auto; }
  .topic-preview { white-space: normal; }
}

/* ---------- shift page: day counts, custom + recurring ---------- */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #2e7d4f; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
.cal-day .count-badge { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); }
.cal-day.picked .count-badge { background: #fff; color: var(--red); }
.cal-key .count-badge { vertical-align: 1px; margin-right: 2px; }

.shift-spots.none { color: var(--ink-soft); font-weight: 500; }
.shift-extra { margin-top: 10px; display: grid; gap: 10px; }
.shift-btn-alt.active { border-color: var(--red); background: var(--red-tint); }

.panel { padding: 16px 18px; border: 1.5px solid var(--red); border-radius: var(--radius); background: #fff; }
.panel[hidden] { display: none; }
.panel-label { margin: 6px 0 8px; font-weight: 700; font-size: 16px; }
.panel-note { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); }

.tp-row { display: grid; grid-template-columns: 52px 44px 1fr 44px 140px; align-items: center; gap: 8px; margin: 10px 0; }
.tp-label { font-weight: 700; }
.tp-step {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fff; color: var(--red);
  font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1;
}
.tp-step:hover { border-color: var(--red); background: var(--red-tint); }
.tp-range { width: 100%; accent-color: var(--red); height: 28px; cursor: pointer; }
.tp-value { font-weight: 700; font-size: 17px; }
.tp-summary { margin: 10px 0 0; padding: 10px 14px; background: var(--red-tint); border-radius: 8px; font-weight: 600; }
.tp-min { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-toggle, .rec-choice {
  padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer;
}
.day-toggle.on, .rec-choice.on { background: var(--red); border-color: var(--red); color: #fff; }
.rec-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-picker[hidden] { display: none; }

@media (max-width: 640px) {
  .tp-row { grid-template-columns: 44px 40px 1fr 40px; }
  .tp-value { grid-column: 2 / 5; margin-top: -4px; }
  .tp-step { width: 40px; height: 40px; }
  .rec-choices { grid-template-columns: 1fr; }
  .day-toggle { padding: 10px 2px; font-size: 13px; }
}

/* ---------- shift page: step headings + thank-you pop-up ---------- */
.step-word { color: var(--red); margin-right: 4px; }
.step-sub { margin: 4px 0 0; color: var(--ink-soft); }
.step-sub strong { color: var(--ink); }

.thanks-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(42, 20, 18, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.thanks-overlay[hidden] { display: none; }
.thanks-box {
  width: 100%; max-width: 440px; background: #fff; border-radius: 16px;
  padding: 32px 28px 20px; text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  animation: thanks-pop .25s ease-out;
}
.thanks-check {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  background: #2e7d4f; color: #fff; font-size: 40px; line-height: 72px; font-weight: 700;
}
.thanks-box h2 { font-size: 34px; color: var(--red); }
.thanks-sub { margin: 4px 0 0; font-weight: 600; font-size: 18px; }
.thanks-detail { margin: 12px 0 0; color: var(--ink-soft); }
.thanks-box .back-link { display: inline-block; margin-top: 4px; }
body.no-scroll { overflow: hidden; }
@keyframes thanks-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .thanks-box { animation: none; } }
