/* =====================================================================
   Courageous experience site - Grace palette re-skin (Meta, 2026-11-01)
   Isolated proposal. Load AFTER app.css and courageous-tokens.css:
     <link rel="stylesheet" href="/static/courageous-tokens.css">
     <link rel="stylesheet" href="/static/courageous-grace.css">
   Retires the Ember/brown look. Every color below comes from the shared
   token set; this sheet holds only experience-specific mapping.
   Base file: app.css sha256 e5c3eb3313e091b6df3b7b2cda398c180873a5710c5419e41d7f0512002cd726
   (byte-identical on the Mac source and the live server, verified 2026-11-01.)
   ===================================================================== */

/* ---- Base: Montserrat, warm light / deep-navy dark ---------------- */
body { font-family: var(--font); background: var(--bg); background-image: var(--bg-grad);
  background-attachment: fixed; color: var(--fg); }
h1, h2, h3 { font-family: var(--font); letter-spacing: -.01em; text-transform: none; }
h1 { font-weight: 800; }
a { color: var(--link); }

/* The old sheet's dark blocks set brown values on the same selectors;
   the token file already re-points every variable, so the app simply
   follows. These two rules neutralize the ember-only decorations that
   referenced retired variables. */
:root[data-theme="ember"] h1, :root[data-theme="ember"] h2 { font-family: var(--font); text-transform: none; letter-spacing: -.01em; }
:root[data-theme="ember"] .hero h1 { color: var(--hero-fg); font-size: 2.6rem; }

/* ---- Disclosure banner: navy in both modes -------------------------
   Was a pale warning strip (light) / brown stone bar (ember). The
   disclosure text itself is unchanged; only its dress changes. */
.banner { background: var(--grace-navy); color: #fff; border-bottom: 3px solid var(--grace-orange); }
.banner strong { color: #fff; }
:root[data-theme="ember"] .banner { background: var(--grace-navy); color: #fff; border-bottom-color: var(--grace-orange); }
:root[data-theme="dark"] .banner, :root[data-theme="ember"] .banner { background: #0A0E13; }
.lang-notice { background: var(--panel-2); color: var(--fg); border-bottom: 1px solid var(--line); }

/* ---- Header -------------------------------------------------------- */
header.site { background: var(--panel); border-bottom: 1px solid var(--line); }
:root[data-theme="ember"] header.site { background: var(--panel); border-bottom-color: var(--line); }
:root[data-theme="ember"] header.site .brand, :root[data-theme="ember"] nav a, :root[data-theme="ember"] .who { color: var(--fg); }
:root[data-theme="ember"] .brand .muted { color: var(--muted); }
.brand { font-weight: 800; letter-spacing: .01em; }
.brand .mark { border-radius: 50%; }
nav a { font-weight: 600; border-radius: var(--radius-pill); }
nav a:hover { background: var(--accent-soft); }
nav a[aria-current="page"] { background: var(--accent); color: #fff; }
:root[data-theme="ember"] nav a[aria-current="page"] { background: var(--accent); color: #fff; }
:root[data-theme="ember"] header.site .btn { background: var(--panel); color: var(--fg); border-color: var(--line); }
:root[data-theme="ember"] .navtoggle summary { color: var(--fg); border-color: var(--line); }
:root[data-theme="ember"] .navtoggle[open] nav { background: var(--panel); border-bottom-color: var(--line); }

/* Theme toggle becomes the shared pill (tokens file styles the base;
   here it takes the quiet-button dress inside this app's header). */
.theme { white-space: nowrap; }

/* ---- Buttons: one system, every state ------------------------------
   primary / default(secondary) / quiet (.btn-quiet, new) / danger,
   with hover, focus-visible (in app.css), pressed, disabled, loading. */
.btn { border-radius: var(--radius-pill); font-weight: 700; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--fg); padding: .6rem 1.1rem;
  transition: background .15s ease, border-color .15s ease, transform .06s ease, filter .15s ease; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-hover); }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--link); }
.btn-quiet:hover { background: var(--accent-soft); border-color: transparent; color: var(--link); }
.btn:disabled, .btn[disabled], button:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn[aria-busy="true"], button[aria-busy="true"] { cursor: progress; opacity: .75; }
.btn[aria-busy="true"]::after, button[aria-busy="true"]::after { content: ""; display: inline-block;
  width: 14px; height: 14px; margin-left: .5rem; vertical-align: -2px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: cg-spin .7s linear infinite; }
@keyframes cg-spin { to { transform: rotate(360deg); } }
.btn-sm { border-radius: var(--radius-pill); }

/* ---- Hero: navy stage, white Grace logo, orange rule ---------------
   Markup addition in templates.py patch P-2 adds:
     <img class="hero-logo" src="/static/brand/gfc_logo_light.png" alt="Grace Family Church">
   The logo file is the near-white monochrome mark, made for dark
   grounds (blue logo is for light grounds; rule in DESIGN.md). */
.hero { background: var(--hero-bg); color: var(--hero-fg); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin: 0 -16px; padding: 2.75rem 16px 2.25rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(90deg, var(--grace-orange) 0%, var(--grace-orange) 55%, var(--grace-blue) 100%); }
.hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px;
  border-radius: 50%; border: 34px solid rgba(224,88,41,.16); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero::after { z-index: 0; }
.hero h1 { color: var(--hero-fg); font-size: 2.75rem; max-width: 16ch; }
.hero .lede { color: var(--hero-soft); }
.hero-logo { height: 44px; width: auto; margin-bottom: 1.1rem; }
.hero .btn { background: transparent; color: #fff; border-color: #43566A; }
.hero .btn:hover { border-color: #fff; color: #fff; }
.hero .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero .btn-primary:hover { background: var(--accent-hover); }
:root[data-theme="ember"] .hero { background: var(--hero-bg); color: var(--hero-fg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
:root[data-theme="ember"] .hero .lede { color: var(--hero-soft); }
:root[data-theme="ember"] .hero .btn { background: transparent; color: #fff; border-color: #43566A; }
:root[data-theme="ember"] .hero .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 800px) { .hero h1 { font-size: 2.1rem; } .hero-logo { height: 36px; } }

/* ---- Cards, panels, depth ------------------------------------------ */
.panel, .card { border-radius: var(--radius-lg); border-color: var(--line); box-shadow: var(--shadow); }
.card { transition: box-shadow .15s ease, transform .15s ease; }
.card:hover { box-shadow: var(--shadow-lg); }
.panel.warn { background: var(--warn-bg); border-color: var(--warn); }
.panel.next { border: 2px solid var(--accent); background: var(--accent-soft); }

/* ---- Status pills: honest words, token colors ----------------------
   Labels are fixed by the templates.py patch P-5 (pending, approved,
   waitlisted, declined). Colors: pending = amber, approved = green,
   waitlisted = blue, declined = red, in both modes (see tokens). */
.pill { font-weight: 700; padding: .15rem .6rem; }
.pill-approved, .pill-active, .pill-checked_in, .pill-printed, .pill-published, .pill-open, .pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-pending, .pill-in_review, .pill-queued, .pill-retry_scheduled, .pill-claimed, .pill-contacted { background: var(--warn-bg); color: var(--warn); }
.pill-waitlisted, .pill-full { background: var(--wait-bg); color: var(--wait); }
.pill-declined, .pill-rejected, .pill-refused, .pill-failed, .pill-failed_final, .pill-closed, .pill-unpublished, .pill-urgent { background: var(--bad-bg); color: var(--bad); }

/* ---- Tags ------------------------------------------------------------ */
.tag { background: var(--pill); border-radius: var(--radius-pill); font-weight: 600; }

/* ---- Forms: thumb-first ---------------------------------------------- */
input:not([type="checkbox"]), select, textarea { border-radius: 12px; border-color: var(--line-strong);
  background: var(--panel); color: var(--fg); }
input[type="checkbox"] { accent-color: var(--accent); }
label.check { min-height: var(--target); align-items: flex-start; padding-top: .35rem; }
/* The join form's submit stays in thumb reach on phones: the patched
   markup wraps it in .form-actions (templates.py patch P-3). */
@media (max-width: 700px) {
  .form-actions { position: sticky; bottom: 0; padding: .7rem 0 calc(.7rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, var(--panel) 30%); }
  .form-actions .btn { width: 100%; text-align: center; padding: .85rem 1rem; font-size: 1.05rem; }
}
main { padding-bottom: calc(3rem + env(safe-area-inset-bottom)); }

/* ---- Tables, chat, misc ---------------------------------------------- */
table { border-radius: var(--radius); overflow: hidden; }
.msg.bot { background: var(--accent-soft); }
.msg.me { background: var(--pill); }
.flash { border-radius: 12px; }
.flash-ok { border-color: var(--ok); background: var(--ok-bg); }
.flash-warn { border-color: var(--warn); background: var(--warn-bg); }
.flash-error { border-color: var(--bad); background: var(--bad-bg); }
code { background: var(--pill); }

/* ---- Footer ------------------------------------------------------------ */
footer.site { background: var(--grace-navy); color: #C9D4DE; border-top: 3px solid var(--grace-orange); }
footer.site a { color: #fff; }
:root[data-theme="ember"] footer.site { background: var(--grace-navy); color: #C9D4DE; border-top-color: var(--grace-orange); }
:root[data-theme="ember"] footer.site a { color: #fff; }
:root[data-theme="dark"] footer.site, :root[data-theme="ember"] footer.site { background: #0A0E13; }

/* ======================================================================
   Phone and skinny-width pass (Jason, 2026-11-01, iPhone screenshots).
   Fixes: header controls crammed and wrapped to a second row, tables
   running off the right edge, text and headings with no breathing room,
   a banner that ate a fifth of the screen, and stretched buttons.
   ====================================================================== */
@media (max-width: 640px) {
  body { line-height: 1.6; }
  .banner { font-size: .76rem; line-height: 1.4; padding: .5rem 14px; text-align: left; }
  .banner strong { display: block; }

  /* one tidy header row: brand, Menu, language, theme */
  header.site .row { flex-wrap: nowrap; gap: .4rem; min-height: 56px; padding-top: .3rem; padding-bottom: .3rem; }
  header.site .brand { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .5rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
  header.site .brand .muted { display: none; }
  header.site .navtoggle, header.site .lang, header.site .theme { flex: 0 0 auto; }
  header.site .navtoggle summary { padding: 0 .85rem; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
  header.site .lang { margin-left: 0; min-width: 44px; min-height: 44px; padding: 0 .5rem; display: inline-flex; align-items: center; justify-content: center; }
  header.site .theme { margin-left: 0; width: 44px; min-height: 44px; padding: 0; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
  header.site .theme::before { content: none; }
  .navtoggle[open] nav ul { gap: .25rem; }
  .navtoggle[open] nav a { display: flex; align-items: center; min-height: 48px; padding: 0 .9rem; }

  /* breathing room */
  main.wrap { padding-top: 2rem; }
  h1 { margin: 0 0 1rem; line-height: 1.2; }
  h2 { margin: 2.25rem 0 .85rem; line-height: 1.25; }
  h3 { margin: 0 0 .5rem; line-height: 1.3; }
  main p, main li { margin-top: 0; margin-bottom: .85rem; }
  .lede { margin-bottom: 1.5rem; }
  .card, .panel { padding: 1rem 1.1rem; margin-bottom: 1rem; }
  .card p, .panel p { margin: 0 0 .7rem; }
  .card > :last-child, .panel > :last-child { margin-bottom: 0; }
  .grid2, .grid3 { gap: 1rem; }
  ul.plain li, ul.events li { padding: .6rem 0; margin-bottom: 0; }
  label { margin: 1rem 0 .35rem; }
  .flash { margin: 1rem 0; }
  .tags { gap: .5rem; }

  /* buttons: content-sized, never stretched, groups wrap with a gap */
  .btn, button.btn { width: auto; max-width: 100%; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; white-space: normal; text-align: center; }
  .hero .btn { margin: 0 .5rem .6rem 0; }
  .actions, .btnrow { display: flex; flex-wrap: wrap; gap: .6rem; }
  form button, form .btn { margin-top: 1rem; }
  .form-actions .btn { width: 100%; }
  .filters .btn { justify-self: start; min-width: 7.5rem; }

  /* tables become stacked cards (labels are added by app.js) */
  .tablewrap { overflow: visible; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack { border: 0; background: transparent; }
  table.stack thead { position: absolute; left: -9999px; }
  table.stack tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .5rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
  table.stack td { border: 0; padding: .6rem 0; display: block; overflow-wrap: anywhere; }
  table.stack td + td { border-top: 1px solid var(--line); }
  table.stack td::before { content: attr(data-label); display: block; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
  table.stack td:not([data-label])::before, table.stack td[data-label=""]::before { content: none; }
  table.stack td form, table.stack td .btn { margin-top: 0; }
}
@media (max-width: 360px) {
  header.site .brand { font-size: .95rem; }
  header.site .brand img { width: 28px; height: 28px; }
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 1.85rem; }
}

/* Shared visitor controls, November 2 availability follow-up. */
.ui-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; max-width: 100%; text-decoration: none; line-height: 1.35; cursor: pointer; }
.resource-card { display: flex; flex-direction: column; gap: .7rem; }
.resource-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.4; }
.resource-card h3 a { text-decoration: none; }
.resource-card h3 a:hover { text-decoration: underline; text-underline-offset: .2em; }
.resource-card p { margin: 0; }
.resource-card .resource-action { align-self: flex-start; margin-top: auto; }
.resource-action { border-radius: 12px; border-color: var(--link); color: var(--link); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
a.tag { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .4rem .85rem; border: 1px solid var(--line-strong); text-decoration: none; color: var(--link); }
a.tag:hover, a.tag.tag-on { background: var(--link); color: var(--panel); border-color: var(--link); }
span.tag { min-height: 0; padding: .15rem .45rem; background: transparent; border-radius: 4px; }
header.site .theme { gap: .4rem; }
header.site .theme::before { content: none; }
::selection { background: var(--accent); color: #fff; }
input, textarea { caret-color: var(--link); }
@media (max-width: 640px) {
  .resource-card { padding: 1.2rem; gap: .8rem; }
  .resource-card p { margin: 0; }
  .resource-card .resource-action { margin-top: .25rem; }
  header.site .theme .theme-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Menu photographs share one composition across home and calendar. */
.menu-photo { margin: 0 0 1.25rem; }
.menu-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; }
.menu-photo figcaption { margin-top: .5rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
