/* =============================================================================
   TFOE-PE Membership — "Civic Modern" design system.
   Hand-authored, token-driven, zero-build. Heritage navy/gold/crimson palette
   is preserved exactly; typography & surfaces are contemporary (grotesque type,
   soft floating shadows, generous radii). Brand/accent/danger colors are
   overridden at runtime by an inline :root{} block emitted from Fraternity
   Settings (see base.html), so this file stays static + cacheable.
   ============================================================================= */

/* ---------- Design tokens --------------------------------------------------- */
:root {
  /* Brand triad — DEFAULTS; overridden inline from the settings table. */
  --brand: #1b2a4a;          /* deep eagle navy */
  --accent: #c2922e;         /* heraldic gold / brass */
  --danger: #a6243a;         /* restrained crimson */

  /* Surfaces & ink */
  --surface: #f7f4ec;        /* parchment — tables, inputs, tints (NOT the page bg) */
  --surface-2: #f1ecdf;      /* slightly deeper parchment */
  --raised: #ffffff;         /* cards */
  --ink: #1a1a1a;            /* primary text */
  --ink-soft: #55514a;       /* secondary text */
  --ink-faint: #8a847a;      /* tertiary / meta */
  --on-brand: #f6f1e4;       /* text on navy */
  --on-accent: #2a1d05;      /* text on gold */

  /* Brand-derived helpers (color-mix has broad evergreen support; fallbacks set below) */
  --brand-tint: color-mix(in srgb, var(--brand) 7%, var(--surface));
  --brand-line: color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-deep: color-mix(in srgb, var(--brand) 82%, #000);
  --accent-tint: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-soft: color-mix(in srgb, var(--accent) 30%, transparent);
  --danger-tint: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --ok: #2f6b46;
  --ok-tint: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --info-tint: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --warn-tint: color-mix(in srgb, var(--accent) 22%, var(--surface));

  /* Typography — contemporary grotesque pairing (display has character, body is clean) */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", Tahoma, Geneva, system-ui, sans-serif;
  --step--1: clamp(0.79rem, 0.77rem + 0.10vw, 0.85rem);
  --step-0: clamp(0.97rem, 0.94rem + 0.15vw, 1.06rem);
  --step-1: clamp(1.17rem, 1.10rem + 0.34vw, 1.40rem);
  --step-2: clamp(1.40rem, 1.27rem + 0.66vw, 1.85rem);
  --step-3: clamp(1.69rem, 1.46rem + 1.12vw, 2.44rem);
  --step-4: clamp(2.03rem, 1.66rem + 1.82vw, 3.22rem);

  /* Space scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Radii, shadow, motion — generous modern rounding, soft layered elevation */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow:
    0 1px 2px rgba(27, 42, 74, 0.04),
    0 4px 12px -4px rgba(27, 42, 74, 0.10),
    0 14px 34px -16px rgba(27, 42, 74, 0.16);
  --shadow-lg:
    0 2px 6px rgba(27, 42, 74, 0.06),
    0 12px 28px -8px rgba(27, 42, 74, 0.18),
    0 30px 64px -22px rgba(27, 42, 74, 0.32);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1120px;
}

/* color-mix fallbacks for older engines (applied first, overridden above where supported) */
@supports not (background: color-mix(in srgb, #000, #fff)) {
  :root {
    --brand-tint: #ecead9;
    --brand-line: rgba(27, 42, 74, 0.18);
    --brand-deep: #16223c;
    --accent-tint: #efe2c4;
    --accent-soft: rgba(194, 146, 46, 0.3);
    --danger-tint: #f1dcdc;
    --ok-tint: #dfeae1;
    --info-tint: #e7e9ef;
    --warn-tint: #efe1c6;
  }
}

/* ---------- Modern reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100dvh; line-height: 1.6; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:where(ul, ol)[class] { list-style: none; padding: 0; }
/* The `hidden` attribute must beat component display rules (e.g. .lightbox{display:flex}),
   which otherwise win by equal specificity + source order and render JS-toggled elements
   (lightbox overlay, album select-bar, upload list) on page load. */
[hidden] { display: none !important; }

/* ---------- Base ------------------------------------------------------------ */
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  /* The PAGE background is parchment (--surface #f7f4ec); cards/tables sit on it in white. */
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--brand);
  text-wrap: balance;
}
h1 { letter-spacing: -0.035em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { text-wrap: pretty; }

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

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

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
}
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }

/* ---------- Layout primitives ---------------------------------------------- */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2rem, 540px); margin-inline: auto; }
.stack > * + * { margin-block-start: var(--flow, var(--sp-4)); }
.stack-lg > * + * { margin-block-start: var(--sp-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.grid { display: grid; gap: var(--sp-5); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
/* Member stat cards: exactly 2 columns on smaller screens, 4 on wide screens (never 3). */
.stat-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.skip-link {
  position: absolute; left: var(--sp-3); top: -3rem;
  background: var(--brand); color: var(--on-brand);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--sp-3); }

/* Decorative "rule + medallion" divider */
.rule {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--accent); margin-block: var(--sp-4);
}
.rule::before, .rule::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(to var(--dir, right), transparent, var(--brand-line));
}
.rule::after { --dir: left; }
.rule__node { width: 8px; height: 8px; rotate: 45deg; background: var(--accent); border-radius: 1px; }

/* ---------- App shell: header / nav ---------------------------------------- */
.topline { height: 4px; background: linear-gradient(90deg, var(--brand), var(--accent) 55%, var(--brand)); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--brand);
  color: var(--on-brand);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.9);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 64px; }

.brand-lockup { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: inherit; }
.brand-lockup .emblem { width: 38px; height: 38px; flex: none; color: var(--accent); }
.brand-lockup img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
/* When the emblem slot is filled by an uploaded logo image, contain it within the slot. */
img.emblem { width: 100%; height: 100%; object-fit: contain; }
.brand-lockup__text { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.brand-lockup__name { font-family: var(--font-display); font-weight: 700; font-size: 1.14rem; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.brand-lockup__motto { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: color-mix(in srgb, var(--accent) 85%, white); white-space: nowrap; }

.nav { display: flex; align-items: center; gap: var(--sp-2); }
.nav a, .nav .navlink {
  color: var(--on-brand); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); position: relative;
  transition: background 0.18s var(--ease);
}
.nav a:hover, .nav .navlink:hover { background: color-mix(in srgb, white 10%, transparent); }
.nav a.is-active { color: #fff; }
.nav a.is-active::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 4px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav__sep { width: 1px; height: 22px; background: color-mix(in srgb, white 20%, transparent); margin-inline: var(--sp-1); }

.nav-toggle {
  display: none; background: transparent; border: 1px solid color-mix(in srgb, white 30%, transparent);
  color: var(--on-brand); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3);
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--brand-deep); padding: var(--sp-3);
    border-bottom: 2px solid var(--accent);
  }
  .nav.is-open { display: flex; }
  .nav a, .nav .navlink { padding: var(--sp-3); }
  .nav a.is-active::after { display: none; }
  .nav a.is-active { background: color-mix(in srgb, white 12%, transparent); }
  .nav__sep { display: none; }
}

/* ---------- Main / footer --------------------------------------------------- */
.site-main { flex: 1; padding-block: var(--sp-6) var(--sp-8); }
.page-head { margin-block-end: var(--sp-5); }
.page-head h1 { margin-block-start: var(--sp-1); }

.site-footer {
  background: var(--brand-deep); color: var(--on-brand);
  padding-block: var(--sp-6);
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--sp-5); justify-content: space-between; align-items: center; }
/* Footer brand lockup: the logo/crest sits beside the org name. */
.footer-brand { display: flex; align-items: center; gap: var(--sp-4); }
.footer-brand__mark { flex: none; width: 46px; height: 46px; color: var(--accent); display: inline-grid; place-items: center; }
.footer-brand__mark img.emblem { border-radius: 8px; }
.site-footer a { color: color-mix(in srgb, var(--accent) 90%, white); }
.site-footer small { color: color-mix(in srgb, var(--on-brand) 75%, transparent); }

/* ---------- Cards ----------------------------------------------------------- */
.card {
  position: relative;
  background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
}
/* Feature card: a soft brand→gold gradient hairline border (modern, not a heritage stripe) */
.card--feature {
  border-color: transparent;
  background:
    linear-gradient(var(--raised), var(--raised)) padding-box,
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--brand) 35%, transparent) 55%, var(--brand-line)) border-box;
}
.card--pad-lg { padding: var(--sp-6); }
.card__title { font-size: var(--step-1); margin-block-end: var(--sp-1); letter-spacing: -0.02em; }

.stat {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent);
  border-radius: var(--radius);
  padding: var(--sp-5); box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent-soft); }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); color: var(--brand); line-height: 1; letter-spacing: -0.03em; }
.stat__label { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--step--1); color: var(--ink-soft); font-weight: 600; }
.stat--accent .stat__num { color: var(--accent); }

/* Action variant (in .grid--cards): an icon chip beside a readable label */
.grid--cards .stat { flex-direction: row; align-items: center; gap: var(--sp-4); }
.grid--cards .stat .stat__num {
  flex: none; display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border-radius: 12px;
  background: var(--accent-tint); color: var(--accent);
  font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; line-height: 1;
  letter-spacing: normal;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.grid--cards .stat:hover .stat__num { background: var(--accent); color: var(--on-accent); }
.grid--cards .stat .stat__label {
  text-transform: none; letter-spacing: -0.01em;
  font-size: var(--step-0); color: var(--ink); font-weight: 600;
}

/* ---------- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 600; font-size: 0.95rem; line-height: 1; text-decoration: none; letter-spacing: -0.01em;
  padding: 0.78rem 1.3rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: transform 0.14s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(27, 42, 74, 0.18), 0 8px 20px -8px rgba(27, 42, 74, 0.5); }
.btn--primary:hover { background: var(--brand-deep); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(27, 42, 74, 0.22), 0 12px 26px -8px rgba(27, 42, 74, 0.55); }
.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(27, 42, 74, 0.14), 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, #000); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); transform: translateY(-1px); }
.btn--ghost { background: var(--raised); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: var(--shadow); }
.btn--ghost:hover { background: var(--brand-tint); border-color: var(--accent-soft); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: 0 1px 2px rgba(27, 42, 74, 0.14), 0 8px 20px -10px color-mix(in srgb, var(--danger) 80%, #000); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 86%, #000); transform: translateY(-1px); }
.btn--sm { padding: 0.5rem 0.85rem; font-size: 0.85rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- Forms ----------------------------------------------------------- */
.field { display: block; }
.field + .field { margin-block-start: var(--sp-4); }
.field__label { display: block; font-weight: 600; font-size: 0.9rem; margin-block-end: var(--sp-2); color: var(--brand); }
.field__req { color: var(--danger); margin-inline-start: 2px; }
.field__hint { font-size: var(--step--1); color: var(--ink-soft); margin-block-start: var(--sp-2); }
.field__error { font-size: var(--step--1); color: var(--danger); margin-block-start: var(--sp-2); font-weight: 500; }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent);
  border-radius: var(--radius-sm); padding: 0.72rem 0.9rem; color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent); background: var(--raised);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 6rem; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.95rem; }
.checkbox input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .field + .field { margin-block-start: 0; }
fieldset { border: 1px solid var(--brand-line); border-radius: var(--radius); padding: var(--sp-5); }
legend { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--brand); padding-inline: var(--sp-2); font-size: var(--step-1); }

.error-summary {
  border: 1px solid var(--danger); background: var(--danger-tint);
  border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); color: color-mix(in srgb, var(--danger) 75%, #000);
}

/* ---------- Badges & pills -------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--step--1); font-weight: 600;
  padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.badge--active { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge--applicant { background: var(--info-tint); color: var(--brand); border-color: var(--brand-line); }
.badge--inactive { background: var(--surface-2); color: var(--ink-faint); border-color: var(--brand-line); }
.badge--accent { background: var(--accent-tint); color: color-mix(in srgb, var(--accent) 70%, #000); border-color: var(--accent-soft); }
.badge--kuya { background: var(--accent); color: var(--on-accent); border-color: color-mix(in srgb, var(--accent) 60%, #000); }
.badge--kuya::before { content: "\2605"; width: auto; height: auto; border-radius: 0; background: none; }
/* Compact badge for dense table cells (e.g. business category) — no status dot. */
.badge--sm { font-size: 0.72rem; padding: 0.1em 0.5em; gap: 0; }
.badge--sm::before { display: none; }

/* ---------- Signature component: the 5-Is stage-track ----------------------- */
.stage-track { display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; --node: color-mix(in srgb, var(--brand) 20%, var(--surface)); }
.stage-track__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); flex: 1 1 0; min-width: 64px; text-align: center; padding-block-start: var(--sp-2); }
.stage-track__step::before {
  content: ""; position: absolute; top: calc(var(--sp-2) + 9px); left: -50%; width: 100%; height: 2px;
  background: var(--node); z-index: 0;
}
.stage-track__step:first-child::before { display: none; }
.stage-track__dot {
  position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--node); display: grid; place-items: center;
}
.stage-track__label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 600; }
/* completed steps */
.stage-track__step.is-done .stage-track__dot { background: var(--accent); border-color: var(--accent); }
.stage-track__step.is-done::before { background: var(--accent); }
.stage-track__step.is-done .stage-track__dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--on-accent); }
/* current step */
.stage-track__step.is-current .stage-track__dot { background: var(--raised); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stage-track__step.is-current .stage-track__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.stage-track__step.is-current .stage-track__label { color: var(--brand); }

/* Caption naming the current stage, shown under a dots-only pipeline. */
.stage-track__caption { font-size: var(--step--1); color: var(--ink-soft); margin-block-start: var(--sp-2); }
.stage-track__caption strong { color: var(--brand); font-weight: 600; }

/* Compact variant — always dots-only + caption; for narrow card columns
   (e.g. the applications grid) where labelling every node would overlap. */
.stage-track--compact { flex-wrap: nowrap; }
.stage-track--compact .stage-track__step { min-width: 0; }
.stage-track--compact .stage-track__label { display: none; }

/* Full progress track (a member's current stage): keep the labelled track on
   wide screens and hide the now-redundant caption… */
@media (min-width: 601px) {
  .stage-track--progress:not(.stage-track--compact) + .stage-track__caption { display: none; }
}
/* …but on narrow screens collapse it to the same dots + caption, since the five
   long labels would otherwise overlap and the connectors would bleed out. */
@media (max-width: 600px) {
  .stage-track--progress:not(.stage-track--compact) { flex-wrap: nowrap; }
  .stage-track--progress:not(.stage-track--compact) .stage-track__step { min-width: 0; }
  .stage-track--progress:not(.stage-track--compact) .stage-track__label { display: none; }
}

/* ---------- Kuya panel (replaces the pipeline once a member is a Kuya) ------ */
.kuya-panel { display: grid; gap: var(--sp-4); }
.kuya-panel__actions { display: flex; justify-content: flex-end; }

.awards-empty {
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5);
  border: 1px dashed color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: var(--radius); background: var(--brand-tint);
}
.awards-empty__icon {
  width: 44px; height: 44px; flex: none; color: var(--accent);
  display: grid; place-items: center;
}
.awards-empty__title { font-weight: 700; color: var(--brand); margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }

/* ---------- Tables (collapse to cards on mobile) --------------------------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; background: var(--raised);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
.table th, .table td { padding: 0.95rem 1.1rem; text-align: left; vertical-align: middle; }
.table thead th {
  background: color-mix(in srgb, var(--brand) 4%, var(--raised));
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); font-weight: 600;
  border-bottom: 1px solid var(--brand-line);
}
.table tbody td { border-bottom: 1px solid color-mix(in srgb, var(--brand) 7%, transparent); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.14s var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.table tbody td a:not(.btn) { color: var(--brand); font-weight: 600; text-decoration: none; }
.table tbody td a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* Denser rows for list-heavy tables (business directory / my businesses). */
.table--compact { font-size: 0.9rem; }
.table--compact th, .table--compact td { padding: 0.5rem 0.7rem; }

/* Slim progress bar for collection funding. Width is set inline (style="width:N%"). */
.progress { height: 8px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.progress__bar { height: 100%; border-radius: inherit; background: var(--accent); }

/* Avatar autocomplete (contributor field) — a floating suggestion menu with member photos. */
.autocomplete { position: relative; }
.autocomplete__menu {
  position: absolute; z-index: 50; inset-inline: 0; top: 100%; margin-block-start: var(--sp-1);
  list-style: none; padding: var(--sp-1); display: flex; flex-direction: column; gap: 2px;
  max-height: 300px; overflow-y: auto;
  background: var(--raised); border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.autocomplete__option {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); cursor: pointer;
}
.autocomplete__option:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); }

@media (max-width: 720px) {
  .table--responsive { border: none; box-shadow: none; border-radius: 0; background: transparent; }
  .table--responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--responsive tr { display: block; border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent); border-radius: var(--radius); margin-block-end: var(--sp-3); background: var(--raised); padding: var(--sp-3); box-shadow: var(--shadow); }
  .table--responsive td { display: flex; justify-content: space-between; gap: var(--sp-4); border-bottom: 1px solid color-mix(in srgb, var(--brand) 7%, transparent); padding: var(--sp-2) var(--sp-3); text-align: right; }
  .table--responsive td:last-child { border-bottom: none; }
  .table--responsive td::before { content: attr(data-label); font-weight: 600; color: var(--brand); text-align: left; }
}

/* ---------- Flash messages -------------------------------------------------- */
.flash-region { display: grid; gap: var(--sp-2); margin-block-end: var(--sp-5); }
.flash {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm); border: 1px solid var(--brand-line); background: var(--raised);
  animation: flash-in 0.3s var(--ease) both;
}
.flash__body { flex: 1; }
.flash__close { background: transparent; border: none; color: inherit; opacity: 0.6; font-size: 1.1rem; line-height: 1; padding: 2px; }
.flash__close:hover { opacity: 1; }
.flash--success { background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: color-mix(in srgb, var(--ok) 75%, #000); }
.flash--danger, .flash--error { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: color-mix(in srgb, var(--danger) 72%, #000); }
.flash--warning { background: var(--warn-tint); border-color: var(--accent-soft); color: color-mix(in srgb, var(--accent) 65%, #000); }
.flash--info { background: var(--info-tint); border-color: var(--brand-line); color: var(--brand); }

/* ---------- Auth / centered card pages ------------------------------------- */
.auth-shell { display: grid; place-items: center; min-height: calc(100dvh - 64px - 4px); padding-block: var(--sp-6); }
.auth-card { width: min(100% - 2rem, 440px); }
.auth-card .emblem { width: 56px; height: 56px; color: var(--accent); margin-inline: auto; }

/* ---------- Section heading with an icon chip ------------------------------ */
.section-head {
  display: flex; align-items: center; gap: var(--sp-3); margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-1);
  color: var(--brand); letter-spacing: -0.02em; line-height: 1.1;
}
.section-head__icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-tint); color: var(--accent);
  border: 1px solid var(--accent-soft);
}

/* ---------- Definition lists (profiles) ------------------------------------ */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-3) var(--sp-4); }
.dl dt { color: var(--ink-faint); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; align-self: center; }
.dl dd { color: var(--ink); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.dl__empty { color: var(--ink-faint); font-weight: 400; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 0; } .dl dt { margin-block-start: var(--sp-2); } .dl dd { margin-block-end: var(--sp-2); } }

/* ---------- Avatars --------------------------------------------------------- */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-soft); background: var(--brand-tint); flex: none; }
.avatar--lg { width: 110px; height: 110px; }
.avatar--sm { width: 38px; height: 38px; }
.avatar--placeholder { display: grid; place-items: center; color: var(--brand); font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.avatar--sm.avatar--placeholder { font-size: 0.8rem; }

/* ---------- Page-load reveal ------------------------------------------------ */
.reveal > * { animation: rise 0.5s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: 0.06s; }
.reveal > *:nth-child(3) { animation-delay: 0.12s; }
.reveal > *:nth-child(4) { animation-delay: 0.18s; }
.reveal > *:nth-child(5) { animation-delay: 0.24s; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Small utilities ------------------------------------------------- */
.mt-0 { margin-block-start: 0; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Applicants overview cards (dashboard) -------------------------- */
.applicant-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  list-style: none; padding: 0; margin: var(--sp-5) 0 0;
}
/* Directory variant: roomier gap + a fixed column rhythm — 1 → 2 → 4 (never 3),
   mirroring the member stat-grid. Four cards per row on wide screens. */
.applicant-grid--lg { gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 600px)  { .applicant-grid--lg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .applicant-grid--lg { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Flat tile (it lives inside the white "Applicants" section card — no nested elevation). */
.applicant-card {
  display: flex; flex-direction: column; gap: var(--sp-4); height: 100%;
  background: var(--surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm); padding: var(--sp-4);
  text-decoration: none; color: inherit;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.applicant-card:hover, .applicant-card:focus-visible {
  transform: translateY(-2px); background: var(--raised);
  border-color: var(--accent-soft); box-shadow: var(--shadow);
}
/* Raised variant: a white, elevated card for grids that sit directly on the page
   background (the member directory) rather than inside a white section card. */
/* The directory's raised tiles match the Applications-page card scale: roomier
   padding (sp-5) and the standard, larger card radius. Only the directory uses
   --raised, so the flat dashboard applicant tiles are left at their tighter scale. */
.applicant-card--raised { background: var(--raised); box-shadow: var(--shadow); padding: var(--sp-5); border-radius: var(--radius); border-color: color-mix(in srgb, var(--brand) 8%, transparent); }
.applicant-card--raised:hover, .applicant-card--raised:focus-visible { box-shadow: var(--shadow-lg); }
/* Top-align so the avatar stays pinned to the top when a long name wraps to
   two lines, instead of drifting to the vertical centre of the taller text. */
.applicant-card__head { display: flex; align-items: flex-start; gap: var(--sp-3); }
/* Vetting-comment count, pinned top-right of the card head. A soft pulsing glow draws the
   eye to applicants who already have input, without a heavy solid-gold fill. */
.comment-count {
  margin-inline-start: auto; align-self: flex-start; flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.3em;
  font-size: var(--step--1); font-weight: 700; line-height: 1;
  color: var(--brand); background: var(--brand-tint);
  border: 1px solid var(--brand-line); border-radius: var(--radius-pill);
  padding: 0.3em 0.6em;
  animation: comment-count-pulse 2s ease-out infinite;
}
.comment-count svg { width: 0.95em; height: 0.95em; color: var(--accent); }
@keyframes comment-count-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
.applicant-card__ident { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1; }
.applicant-card__name {
  font-family: var(--font-display); font-weight: 700; color: var(--brand);
  letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere;
}
.applicant-card__nick { font-size: var(--step--1); }
.applicant-card__ident .badge { align-self: flex-start; margin-block-start: var(--sp-1); }
/* Push the detail rows to the card's bottom so cards in a row align regardless of name length. */
.applicant-card__meta { gap: var(--sp-2) var(--sp-4); margin-block-start: auto; }

/* ---------- Applicant vetting comments ------------------------------------ */
/* Separate the thread (or its empty state) from the compose form / banner above it. */
.comment-list, .comment-empty {
  margin-block-start: var(--sp-5);
  padding-block-start: var(--sp-5);
  border-block-start: 1px solid var(--brand-line);
}
.comment-list { display: flex; flex-direction: column; list-style: none; margin-inline: 0; margin-block-end: 0; padding-inline: 0; padding-block-end: 0; }
.comment + .comment {
  margin-block-start: var(--sp-4);
  border-block-start: 1px solid var(--brand-line);
  padding-block-start: var(--sp-4);
}
.comment__body { white-space: pre-wrap; margin-block-start: var(--sp-3); }
.comment__actions { margin-block-start: var(--sp-3); }

/* ---------- Locked-area modal --------------------------------------------- */
/* Applicants who reach a members-only area get this instead of a redirect. The overlay
   itself is the dimmed backdrop; clicking it (outside the dialog) closes via JS. */
.locked-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: color-mix(in srgb, var(--brand-deep) 74%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.locked-modal[hidden] { display: none; }

.locked-modal__dialog {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100dvh - var(--sp-7));
  overflow-y: auto;
  background: var(--raised);
  border-radius: var(--radius-lg);
  border-block-start: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-7) var(--sp-6) var(--sp-6);
  text-align: center;
}

.locked-modal__crest {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-block-end: var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--accent);
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 65%, transparent);
}
.locked-modal__crest .emblem { width: 38px; height: 38px; }

.locked-modal__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
  color: var(--brand);
  margin-block: var(--sp-2) var(--sp-4);
}
.locked-modal__body {
  color: var(--ink-soft);
  font-size: var(--step-0);
  line-height: 1.6;
  text-wrap: pretty;
}
.locked-modal__body p { margin-block: 0 var(--sp-3); }
.locked-modal__kicker { color: var(--ink); font-weight: 600; }
.locked-modal__dismiss { margin-block-start: var(--sp-4); }

body.is-locked-open { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .locked-modal { animation: lockedFade 0.28s var(--ease) both; }
  .locked-modal__dialog { animation: lockedRise 0.44s var(--ease) both; }
  @keyframes lockedFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes lockedRise {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Events ---------------------------------------------------------- */
.event-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.event-card { background: var(--raised); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-card--featured { outline: 2px solid var(--accent-soft); }
.event-card__cover { display: block; position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)) center/cover no-repeat;
  background-blend-mode: normal; }
.event-card__cover::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 80% 0%, transparent, rgba(27,42,74,.35)); }
.event-card__date { position: absolute; left: var(--sp-3); top: var(--sp-3); z-index: 1;
  background: var(--raised); color: var(--brand); border-radius: var(--radius-sm); overflow: hidden;
  text-align: center; box-shadow: var(--shadow); min-width: 44px; }
.event-card__date-m { display: block; background: var(--danger); color: #fff; font-size: .6rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 0; }
.event-card__date-d { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.3; }
.event-card__ribbon { position: absolute; right: 0; top: var(--sp-3); z-index: 1; background: var(--accent);
  color: var(--on-accent); font-size: .62rem; font-weight: 800; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.event-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.event-card__title { font-size: var(--step-1); margin: 0; }
.event-card__title a { text-decoration: none; }
.event-card__meta { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.event-card__rsvp-summary { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--step--1); }
.event-card__rsvp { display: flex; gap: var(--sp-2); margin-top: var(--sp-1); }
.event-card__rsvp .rsvp-opt { flex: 1; }

.avatar-stack { display: inline-flex; }
.avatar-stack > .avatar + .avatar { margin-inline-start: -8px; }
.avatar-stack .avatar { border: 2px solid var(--raised); }
.avatar-stack__more { background: var(--surface-2); color: var(--brand); }

.event-banner { border-radius: var(--radius-lg); overflow: hidden; position: relative; min-height: 200px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)) center/cover no-repeat; display: flex; align-items: flex-end; }
.event-banner__overlay { position: relative; z-index: 1; padding: var(--sp-6); color: var(--on-brand); width: 100%;
  background: linear-gradient(transparent, rgba(15,22,40,.78)); }
.event-banner__overlay h1 { color: var(--on-brand); }
.event-banner__overlay .eyebrow { color: var(--accent); }

/* RSVP segmented control — both options stay neutral until chosen; the picked one fills + checks. */
.rsvp-status { margin: 0; }
.rsvp-status__badge { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 700;
  padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-pill); }
.rsvp-status__badge--going { background: var(--ok-tint); color: var(--ok); }
.rsvp-status__badge--maybe { background: var(--warn-tint); color: var(--on-accent); }
.rsvp-toggle { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.rsvp-opt { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  flex: 1 1 150px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-pill);
  border: 2px solid var(--brand-line); background: var(--raised); color: var(--ink); font-weight: 700;
  transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s; }
.rsvp-opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.rsvp-opt__mark { font-size: 1.05em; line-height: 1; }
.rsvp-opt--going.is-active { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 0 3px var(--ok-tint); }
.rsvp-opt--maybe.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--warn-tint); }
.rsvp-opt--sm { flex: 1 1 0; padding: var(--sp-2) var(--sp-3); font-size: var(--step--1); }
.rsvp-hint { margin: 0; font-size: var(--step--1); }
.rsvp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.rsvp-col { background: var(--surface); border-radius: var(--radius-sm); padding: var(--sp-3); }
.rsvp-col__head { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 700; margin: 0 0 var(--sp-2); }

.attendance-table td { vertical-align: middle; }
.attendee-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.attendee-list li { display: flex; align-items: center; gap: var(--sp-2); }
.cover-thumb { width: 120px; height: 68px; object-fit: cover; border-radius: var(--radius-sm); }

/* Button variants used by RSVP/attendance */
.btn--ok { background: var(--ok); color: #fff; }
.btn--ok:hover { filter: brightness(1.05); }
.btn--danger-soft { background: var(--danger-tint); color: var(--danger); border: 1.5px solid var(--danger); }

@media (max-width: 560px) { .rsvp-cols { grid-template-columns: 1fr; } }

/* ---------- Event album ----------------------------------------------------- */
.album-dropzone { border: 2px dashed var(--accent-soft); background: var(--accent-tint);
  border-radius: var(--radius); padding: var(--sp-5); text-align: center; }
.album-dropzone.is-dragover { background: var(--warn-tint); border-color: var(--accent); }
.album-dropzone__label { display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; cursor: pointer; }

.album-uploads { display: flex; flex-direction: column; gap: var(--sp-2); }
.upload-row { display: flex; align-items: center; gap: var(--sp-3); background: var(--surface);
  border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
.upload-row__name { flex: 1; font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row__pct { font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); min-width: 3.2em; text-align: right; }
.upload-bar { height: 7px; border-radius: var(--radius-pill); background: rgba(0,0,0,.08); overflow: hidden; flex: 1; }
.upload-bar__fill { height: 100%; border-radius: var(--radius-pill); width: 0;
  background: linear-gradient(90deg, var(--accent), #e0b558); transition: width .15s linear; position: relative; }
.upload-bar__fill::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  background-size: 40px 100%; animation: upload-shimmer 1s linear infinite; }
.upload-row.is-done .upload-bar__fill { background: var(--ok); }
.upload-row.is-done .upload-bar__fill::after { display: none; }
.upload-row.is-error .upload-bar__fill { background: var(--danger); }
@keyframes upload-shimmer { from { background-position: -40px 0; } to { background-position: 120px 0; } }

.album-selectbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  background: var(--brand); color: var(--on-brand); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-4); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); }
.album-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; margin: 0; }
.album-tile img { width: 100%; height: 100%; object-fit: cover; }
.album-tile.is-selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.album-tile__by { position: absolute; left: 0; right: 0; bottom: 0; font-size: .6rem; color: #fff;
  padding: var(--sp-3) var(--sp-2) var(--sp-1); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.album-tile__check { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; z-index: 2;
  border-radius: 6px; border: 2px solid #fff; background: rgba(255,255,255,.85); }
.album-tile.is-selected .album-tile__check { background: var(--accent); }
.album-tile__check::after { content: "✓"; color: #fff; font-weight: 900; font-size: 13px; display: none; }
.album-tile.is-selected .album-tile__check::after { display: block; }
.album-tile__trash { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; z-index: 2;
  border-radius: 7px; border: 0; background: rgba(26,26,26,.7); color: #fff; opacity: 0; transition: opacity .15s; }
.album-tile:hover .album-tile__trash, .album-tile:focus-within .album-tile__trash { opacity: 1; }
.album.is-selecting .album-tile__trash { display: none; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,14,24,.92);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-5); }
.lightbox__img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.lightbox__close { position: absolute; top: var(--sp-4); right: var(--sp-5); width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.2rem; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.7rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox__nav:hover { background: rgba(255,255,255,.28); }
.lightbox__nav--prev { left: var(--sp-5); }
.lightbox__nav--next { right: var(--sp-5); }

/* =============================================================================
   Public landing (editorial) — a single scrolling home page.
   Adds ONLY layout/composition over the existing tokens: one new display step,
   one AA-safe "ink gold" for small gold text on parchment, and section classes.
   No new colors, no framework, no inline styles. All images are same-origin.
   ============================================================================= */
:root {
  --step-5: clamp(2.6rem, 1.9rem + 3vw, 4.4rem);   /* oversized hero display */
  /* Darker brass for small/medium gold TEXT on parchment (raw --accent ~2.9:1 fails AA). */
  --accent-ink: color-mix(in srgb, var(--accent) 64%, #000);
}
@supports not (background: color-mix(in srgb, #000, #fff)) {
  :root { --accent-ink: #7c5c1b; }
}

/* Single gold accent-word inside the navy display headline (large text → AA at 3:1). */
.u-accent { color: var(--accent-ink); }

/* ---------- Shared image "plate": one gold crest-frame for photo AND placeholder --- */
.crest-frame {
  position: relative; padding: var(--sp-2);
  border-radius: calc(var(--radius-lg) + var(--sp-2));
  background: linear-gradient(135deg, var(--accent),
    color-mix(in srgb, var(--brand) 35%, transparent) 55%, var(--brand-line));
  box-shadow: var(--shadow-lg);
}
.media-frame {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.media-frame--wide { aspect-ratio: 4 / 3; }
.media-frame__img { width: 100%; height: 100%; object-fit: cover; }
/* A hero video sizes the frame to the video (16:9) rather than the portrait image
   ratio, so no empty plate shows below a landscape player. */
.media-frame--video { aspect-ratio: 16 / 9; }
.media-frame__video { width: 100%; height: 100%; }
.media-frame__video iframe { display: block; width: 100%; height: 100%; border: 0; }
.media-frame__ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}
.media-frame__ph .emblem { width: 42%; height: auto; color: var(--accent); opacity: .55; }
.figure-cap {
  position: absolute; inset-inline: var(--sp-3); inset-block-end: var(--sp-3);
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em;
  color: var(--on-brand); opacity: .85; text-align: center;
}
/* An uploaded hero/about image shown frameless — a transparent logo/PNG sits directly on
   the page; the drop-shadow follows the image's alpha so it lifts the shape, not a box. */
.landing-img-plain {
  display: block; width: 100%; max-width: 200px; height: auto; margin-inline: auto;
  filter: drop-shadow(0 14px 26px color-mix(in srgb, var(--brand) 22%, transparent));
}

/* ---------- Faint emblem watermarks (currentColor SVG — no image request) --------- */
.band-watermark, .hero-editorial__watermark {
  position: absolute; pointer-events: none; z-index: 0;
}
.band-watermark { inset-block: 0; inset-inline-start: -4%; width: min(45%, 360px);
  color: var(--on-brand); opacity: .06; display: grid; place-items: center; }
.band-watermark .emblem { width: 100%; height: auto; }
/* Hero emblem watermark removed — its faint ring read as an unwanted gradient behind
   the video. (Re-enable by restoring position/size/opacity here if a backdrop is wanted.) */
.hero-editorial__watermark { display: none; }
.hero-editorial__watermark .emblem { width: 100%; height: auto; }

/* ---------- Hero / masthead ------------------------------------------------------- */
.hero-editorial { position: relative; overflow: clip; padding-block: var(--sp-7) var(--sp-6); }
.hero-editorial__inner {
  position: relative; z-index: 1;
  display: grid; gap: var(--sp-6); align-items: center; grid-template-columns: 1fr;
}
@media (min-width: 820px) { .hero-editorial__inner { grid-template-columns: 1.05fr 1fr; gap: var(--sp-7); } }
/* On wide screens the video becomes the dominant column (bigger, fills the right side);
   the ≥820 rule keeps text/video balanced on tablets so the headline isn't crushed. */
@media (min-width: 1080px) { .hero-editorial__inner { grid-template-columns: 1fr 1.5fr; } }
.hero-editorial__display {
  font-family: var(--font-display); font-size: var(--step-5); line-height: .96;
  letter-spacing: -0.03em; color: var(--brand); text-wrap: balance; margin-block: var(--sp-2);
}
.hero-editorial__lede { font-size: var(--step-1); color: var(--ink-soft); font-style: italic; }
.hero-editorial__body { max-width: 52ch; }
.measure { max-width: 62ch; }
/* Mobile: video sits ABOVE the hero text (order:-1); desktop restores text-left/video-right. */
.hero-editorial__media { justify-self: center; width: min(100%, 700px); order: -1; }
@media (min-width: 820px) { .hero-editorial__media { justify-self: end; order: 0; } }
.hero-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); font-weight: 600;
}
.hero-stats .rule__node { flex: none; }

/* ---------- Editorial section scaffolding ----------------------------------------- */
/* Generous breathing space above/below every section (per request). */
.editorial-section { padding-block: clamp(4rem, 7vw, 7rem); scroll-margin-top: 84px; }
/* Centered section header (eyebrow + heading) and the lead description right beneath it. */
.editorial-head { display: flex; justify-content: center; text-align: center; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.editorial-head + p { text-align: center; margin-inline: auto; }
/* Section chapter numbers (01, 02, …) hidden per request — the eyebrow + heading carry each
   section. Kept as one rule so they can be restored by switching display back to inline. */
.editorial-head__num { display: none; }

/* About: logo on top, centered title + centered mission text / creed below. */
.about-centered { text-align: center; }
.about-centered__emblem { max-width: 320px; margin-inline: auto; }
/* Full-width, center-aligned prose (per request). */
.about-centered__prose { max-width: none; }
.creed {
  font-family: var(--font-display); font-size: var(--step-2); line-height: 1.2;
  color: var(--brand); text-wrap: balance;
  border-inline-start: 3px solid var(--accent); padding-inline-start: var(--sp-4);
}
/* Centered creed drops the left rule so the quote sits symmetrically. */
.creed--center { border-inline-start: none; padding-inline-start: 0; }
.creed cite { display: block; font-size: var(--step--1); font-style: normal; font-family: var(--font-body);
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent-ink); margin-block-start: var(--sp-2); }

/* The 5 Is plate — spans the full section width so the pipeline stretches edge to edge. */
.fiveis-plate { max-width: none; }

/* ---------- Impact / Record of Service (the single dark beat) ---------------------- */
.impact-band {
  position: relative; overflow: clip;
  background: var(--brand-deep); color: var(--on-brand);
  border-radius: var(--radius-lg); padding: var(--sp-7) var(--sp-5); text-align: center;
}
.impact-band__content, .cta-band__content { position: relative; z-index: 1; }
.impact-band .editorial-head { justify-content: center; }
.impact-band h2 { color: var(--on-brand); }
.impact-band .eyebrow { color: var(--accent); }
.impact-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-4);
  margin-block: var(--sp-6);
}
.impact-stats .stat {
  flex: 1 1 180px; max-width: 260px; align-items: center; text-align: center;
}
.stat--onbrand {
  background: transparent; box-shadow: none;
  border-color: color-mix(in srgb, var(--on-brand) 18%, transparent);
}
.stat--onbrand .stat__num { color: var(--accent); font-size: var(--step-4); }
.stat--onbrand .stat__label { color: color-mix(in srgb, var(--on-brand) 78%, transparent); }

/* ---------- Offers / the Eagle advantage ------------------------------------------ */
/* auto-FIT (not auto-fill): collapse empty tracks so a short row of cards stretches to
   fill the container width instead of leaving phantom columns on the right. */
.offer-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pillar-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.offer-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--raised); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent);
}
.offer-card__media, .offer-card__ph { aspect-ratio: 16 / 10; }
.offer-card__media img { width: 100%; height: 100%; object-fit: cover; }
.offer-card__ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); }
.offer-card__ph .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.offer-card__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); }
.offer-card__name { font-family: var(--font-display); font-weight: 700; color: var(--brand); font-size: var(--step-1); }
.offer-card__body .badge { align-self: flex-start; }

/* Modern, scannable benefit grid: one clean tile per perk, gold check chip + text. */
.benefit-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.benefit-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--raised); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--brand) 8%, transparent);
  box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.benefit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.benefit-card p { margin: 0; color: var(--ink); font-weight: 500; line-height: 1.4; }
.benefit-card__icon {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent-ink);
  border: 1px solid var(--accent-soft);
}
.benefit-card__icon svg { width: 1.15rem; height: 1.15rem; }

/* ---------- Officers / leadership ------------------------------------------------- */
.officer-grid {
  display: grid; gap: var(--sp-5); grid-template-columns: 1fr;
  list-style: none; padding: 0; margin: 0;
}
@media (min-width: 600px)  { .officer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .officer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.officer-card { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.officer-card__portrait { width: min(100%, 220px); }
.officer-card__name { font-family: var(--font-display); font-weight: 700; color: var(--brand); }
.officer-card__role {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; color: var(--accent-ink);
}
.officer-card__term { font-size: var(--step--1); color: var(--ink-faint); }

/* ---------- Join CTA + Contact close ---------------------------------------------- */
.cta-band { position: relative; overflow: clip; text-align: center;
  background: var(--brand-deep); color: var(--on-brand);
  border-radius: var(--radius-lg); padding: var(--sp-8) var(--sp-5); }
.cta-band h2 { color: var(--on-brand); }
.cta-band .eyebrow { color: var(--accent); }
.cta-band__actions { justify-content: center; }
.cta-band__content .measure { margin-inline: auto; }
/* Ghost button that keeps AA contrast on the navy bands */
.btn--on-brand {
  background: transparent; color: var(--on-brand); box-shadow: none;
  border-color: color-mix(in srgb, var(--on-brand) 45%, transparent);
}
.btn--on-brand:hover { background: color-mix(in srgb, var(--on-brand) 12%, transparent); transform: translateY(-1px); }

.contact-strip__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: flex-end; }

/* Admin contact inbox: preserve the sender's line breaks. */
.contact-msg__body { white-space: pre-wrap; }

/* Public "Recent Gatherings" event cards reuse the offer-card shell as a link. */
a.offer-card { text-decoration: none; color: inherit;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
a.offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-thumb { position: relative; aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); }
.event-thumb--cover { background-size: cover; background-position: center; background-repeat: no-repeat; }
.event-thumb--cover::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,22,40,.35), transparent 42%); }
