/* ============================================================
   pack12tx.org — single stylesheet
   Tokens, base, layout, components.
   Mobile-first. No frameworks.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Color — paper, ink, scout red. Deliberately small palette. */
  --c-paper:      #FAF7F2;     /* warm cream page background */
  --c-paper-2:    #F2EDE3;     /* slightly deeper, for sections */
  --c-card:       #FFFFFF;
  --c-ink:        #16181C;     /* near-black, warm navy undertone */
  --c-ink-2:      #3B3F46;     /* secondary text */
  --c-ink-3:      #6B6F77;     /* muted */
  --c-rule:       #DCD5C7;     /* hairline rules on cream */
  --c-rule-2:     #E7E1D4;
  --c-red:        #CE1126;     /* BSA scout red */
  --c-red-deep:   #A60D1E;
  --c-khaki:      #8C7A5B;
  --c-canvas:     #2B2F36;     /* deep ink for footer */
  --c-canvas-2:   #1B1E22;

  /* Type scale — modular, conservative */
  --f-display: "Roboto Slab", "Georgia", "Times New Roman", serif;
  --f-body:    "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.875rem;   /* 14 */
  --fs-base: 1rem;       /* 16 */
  --fs-md:   1.125rem;   /* 18 */
  --fs-lg:   1.375rem;   /* 22 */
  --fs-xl:   1.75rem;    /* 28 */
  --fs-2xl:  2.25rem;    /* 36 */
  --fs-3xl:  3rem;       /* 48 */
  --fs-4xl:  3.75rem;    /* 60 */

  /* Spacing scale */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;
  --s-9:  6rem;

  /* Misc */
  --radius:     6px;
  --radius-sm:  3px;
  --shadow-sm:  0 1px 2px rgba(22,24,28,.05);
  --shadow-md:  0 4px 14px rgba(22,24,28,.08);
  --container:  1140px;
  --container-narrow: 720px;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Global safety net against horizontal-scroll: any long unbreakable
   string (URLs, location text, technical IDs) inside a text-bearing
   element wraps instead of forcing the layout wider than the viewport.
   `anywhere` only breaks when there's no other option. */
a, p, h1, h2, h3, h4, h5, h6, li, td, dd, dt, blockquote, cite, code, pre {
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: var(--c-red-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--c-red); }
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0 0 var(--s-4); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0 0 var(--s-4); text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--c-rule); margin: var(--s-6) 0; }

/* ---------- Containers ---------- */
.container        { max-width: var(--container);        margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--s-5); }

/* ---------- Eyebrow / micro labels ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-ink-3);
  margin: 0 0 var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--c-red);
}
.eyebrow.no-rule::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 22px;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn { white-space: nowrap; }
.btn-primary,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited {
  background: var(--c-red);
  color: #fff;
  border-color: var(--c-red-deep);
  text-decoration: none;
}
a.btn-primary:hover,
.btn-primary:hover { background: var(--c-red-deep); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
  text-decoration: none;
}
a.btn-secondary:link, a.btn-secondary:visited { color: var(--c-ink); text-decoration: none; }
.btn-secondary:hover, a.btn-secondary:hover { background: var(--c-ink); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-rule);
  text-decoration: none;
}
a.btn-ghost:link, a.btn-ghost:visited { color: var(--c-ink); text-decoration: none; }
.btn-ghost:hover { border-color: var(--c-ink); color: var(--c-ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 18px 28px; font-size: var(--fs-md); }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-rule);
  position: relative;
  z-index: 10;
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--c-ink);
}
.brand__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: var(--c-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 20px;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}
.brand__sub {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
  margin-top: 2px;
}

.nav {
  display: none;
}
.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin: 0;
  padding: 0;
}
.nav a:not(.btn) {
  color: var(--c-ink);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .15s ease;
  white-space: nowrap;
}
.nav a:not(.btn):hover { border-bottom-color: var(--c-red); }
.nav a:not(.btn).is-active {
  border-bottom-color: var(--c-red);
  color: var(--c-ink);
}
.nav__cta {
  margin-left: var(--s-3);
}

/* mobile menu button */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--c-rule);
  background: transparent;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink);
  cursor: pointer;
}
.nav-toggle__bars {
  display: inline-block;
  width: 16px; height: 10px;
  position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after, .nav-toggle__bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--c-ink);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 4px; }
.nav-toggle__bars::after { bottom: 0; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--c-rule);
  background: var(--c-paper);
  padding: var(--s-4) 0 var(--s-5);
}
.mobile-menu.is-open { display: block; }
.mobile-menu__list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4);
}
.mobile-menu__list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-rule-2);
  color: var(--c-ink);
  text-decoration: none;
  font-size: var(--fs-md);
  font-family: var(--f-display);
}
.mobile-menu__list a::after {
  content: "›";
  color: var(--c-ink-3);
  font-size: 1.4em;
}

@media (min-width: 880px) {
  .nav { display: flex; align-items: center; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--s-7) 0 var(--s-8);
  background: var(--c-paper);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: minmax(0, 1fr);
}
.hero__title {
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
}
.hero__title em {
  font-style: normal;
  color: var(--c-red);
}
.hero__lede {
  font-size: var(--fs-md);
  color: var(--c-ink-2);
  max-width: 38ch;
  margin-bottom: var(--s-5);
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}
.hero__ctas .meta {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
  padding-left: var(--s-3);
  border-left: 1px solid var(--c-rule);
}
.hero__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--c-paper-2);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__badge {
  position: absolute;
  top: var(--s-4);
  left: var(--s-4);
  z-index: 2;
  background: var(--c-paper);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink);
}
.hero__factbar {
  margin-top: var(--s-6);
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
  padding: var(--s-4) 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}
.hero__fact {
  display: flex;
  flex-direction: column;
}
.hero__fact-label {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
  margin-bottom: 4px;
}
.hero__fact-value {
  font-family: var(--f-display);
  font-size: var(--fs-md);
  color: var(--c-ink);
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 880px) {
  .hero { padding: var(--s-8) 0 var(--s-9); }
  .hero__grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--s-7);
    align-items: center;
  }
  .hero__title { font-size: var(--fs-4xl); }
  .hero__factbar { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Section header ---------- */
.section { padding: var(--s-8) 0; }
.section--alt { background: var(--c-paper-2); }
.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.section__head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.section__head h2 { margin: 0; }
.section__head a { font-size: var(--fs-sm); }

/* ---------- Two-column home grid: events + announcement ---------- */
.home-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .home-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-7); }
}

/* Events list */
.event-list { list-style: none; margin: 0; padding: 0; }
.event {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--c-rule);
  align-items: start;
}
.event:last-child { border-bottom: 1px solid var(--c-rule); }
.event__date {
  text-align: center;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  background: var(--c-card);
}
.event__date-mo {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-red);
  font-weight: 600;
}
.event__date-day {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}
.event__body { min-width: 0; }  /* let the 1fr grid column actually shrink */
.event__body h3 {
  font-size: var(--fs-md);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.event__body h3 a { color: var(--c-ink); text-decoration: none; }
.event__body h3 a:hover { color: var(--c-red); text-decoration: underline; }
.event__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  min-width: 0;
}
.event__meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.event__meta a, .event__meta span { overflow-wrap: anywhere; word-break: break-word; }
.event__cta {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-red-deep);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
  padding-top: 4px;
}
.event__cta:hover { color: var(--c-red); }

/* Announcement card */
.announce {
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: var(--s-5);
  position: relative;
}
.announce__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-rule-2);
}
.announce__pin {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--c-red);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.announce__date {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}
.announce__title {
  font-size: var(--fs-lg);
  margin: 0 0 var(--s-3);
}
.announce__body {
  font-size: var(--fs-base);
  color: var(--c-ink-2);
}
.announce__body p:last-child { margin-bottom: 0; }
.announce__sig {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-rule-2);
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  font-style: italic;
}

/* ---------- Quick links ---------- */
.quicklinks {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (min-width: 700px) { .quicklinks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 880px) { .quicklinks { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.quicklink {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-4);
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--c-ink);
  transition: border-color .15s ease, transform .1s ease;
  min-height: 110px;
}
.quicklink:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
  transform: translateY(-1px);
}
.quicklink__num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
}
.quicklink__title {
  font-family: var(--f-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.2;
}
.quicklink__sub {
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  margin-top: auto;
}

/* ---------- Inner page (Den) ---------- */
.page-hero {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-rule);
  padding: var(--s-7) 0 var(--s-6);
}
.crumb {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-ink-3);
  margin-bottom: var(--s-4);
}
.crumb a { color: var(--c-ink-3); text-decoration: none; }
.crumb a:hover { color: var(--c-ink); }
.crumb__sep { margin: 0 8px; opacity: .5; }

.page-hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  align-items: center;
}
@media (min-width: 720px) {
  .page-hero__row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); }
}
.page-hero__title { font-size: var(--fs-3xl); margin: 0 0 var(--s-2); }
.page-hero__sub {
  font-size: var(--fs-md);
  color: var(--c-ink-2);
  margin: 0;
}
.rank-badge {
  width: 110px;
  height: 110px;
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: var(--s-3);
  display: grid;
  place-items: center;
}
.rank-badge img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Den info block */
.info-block {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  background: var(--c-card);
  margin: var(--s-6) 0 var(--s-7);
  overflow: hidden;
}
@media (min-width: 720px) {
  .info-block { grid-template-columns: repeat(3, 1fr); }
}
.info-block__cell {
  padding: var(--s-5);
  border-bottom: 1px solid var(--c-rule-2);
}
@media (min-width: 720px) {
  .info-block__cell { border-bottom: 0; border-right: 1px solid var(--c-rule-2); }
  .info-block__cell:last-child { border-right: 0; }
}
.info-block__cell:last-child { border-bottom: 0; }
.info-block__label {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-ink-3);
  margin-bottom: var(--s-2);
}
.info-block__value {
  font-family: var(--f-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-ink);
}
.info-block__value a { color: var(--c-ink); text-decoration: none; border-bottom: 1px solid var(--c-rule); }
.info-block__value a:hover { color: var(--c-red); border-bottom-color: var(--c-red); }
.info-block__sub {
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  margin-top: 4px;
  font-family: var(--f-body);
  font-weight: 400;
}

/* Prose (markdown body) */
.prose {
  max-width: 68ch;
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--c-ink);
}
.prose h1 { font-size: var(--fs-3xl); margin-top: var(--s-7); }
.prose h2 { font-size: var(--fs-xl); margin-top: var(--s-6); margin-bottom: var(--s-3); }
.prose h3 { font-size: var(--fs-lg); margin-top: var(--s-5); margin-bottom: var(--s-2); }
.prose p  { margin-bottom: var(--s-4); }
.prose ul, .prose ol { margin: 0 0 var(--s-4) 0; padding-left: 1.4em; }
.prose li { margin-bottom: var(--s-2); }
.prose strong { color: var(--c-ink); }
.prose blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--c-red);
  background: var(--c-paper-2);
  font-size: var(--fs-md);
  color: var(--c-ink-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { margin: var(--s-6) 0; }

/* page sidebar */
.page-layout {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: minmax(0, 1fr);  /* minmax(0,1fr) lets content shrink past min-content */
  padding: var(--s-7) 0;
}
@media (min-width: 960px) {
  .page-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s-8); }
}
/* Long unbreakable strings inside article/aside (URLs, location text) must
   wrap rather than force the grid track wider. Belt + suspenders. */
.page-layout > article, .page-layout > aside { min-width: 0; }
.page-layout a, .page-layout .announce, .page-layout .prose { overflow-wrap: anywhere; word-break: break-word; }
.sidebar { display: flex; flex-direction: column; gap: var(--s-5); }
.sidebar-card {
  border: 1px solid var(--c-rule);
  background: var(--c-card);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.sidebar-card h4 {
  font-size: var(--fs-md);
  margin: 0 0 var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-rule-2);
}
.sidebar-card ul { list-style: none; margin: 0; padding: 0; }
.sidebar-card li {
  padding: 8px 0;
  font-size: var(--fs-sm);
  border-bottom: 1px dotted var(--c-rule-2);
}
.sidebar-card li:last-child { border-bottom: 0; }
.sidebar-card li a { color: var(--c-ink); text-decoration: none; display: flex; justify-content: space-between; align-items: center; }
.sidebar-card li a:hover { color: var(--c-red); }
.sidebar-card li.is-current a { color: var(--c-red); font-weight: 600; }
.sidebar-card li .grade {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-ink-3);
}
.sidebar-card--tinted { background: var(--c-paper-2); }
.sidebar-card--tinted h4 { border-bottom-color: var(--c-rule); }

/* ---------- Event detail map ---------- */
.event-map {
  width: 100%;
  background: var(--c-paper-2);
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}
.event-map iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}
@media (min-width: 720px) {
  .event-map iframe { height: 420px; }
}

/* ---------- Form (Join) ---------- */
.join-layout {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: minmax(0, 1fr);
  padding: var(--s-7) 0 var(--s-8);
}
@media (min-width: 960px) {
  .join-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-8); align-items: start; }
}

.join-intro h1 { font-size: var(--fs-2xl); }
.join-intro p { font-size: var(--fs-md); color: var(--c-ink-2); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: var(--s-5) 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: var(--s-4);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--c-ink);
  border-radius: var(--radius-sm);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink);
  background: var(--c-paper);
}
.steps strong {
  display: block;
  font-family: var(--f-display);
  font-size: var(--fs-md);
  margin-bottom: 2px;
}
.steps p { margin: 0; color: var(--c-ink-2); font-size: var(--fs-sm); }

.form-card {
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: var(--s-6);
  position: relative;
}
.form-card::before {
  content: "FORM 1A";
  position: absolute;
  top: -10px;
  left: var(--s-5);
  background: var(--c-paper);
  padding: 0 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--c-ink-3);
}
.form-card h2 { font-size: var(--fs-xl); margin-top: 0; }
.form-card__sub {
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  margin-bottom: var(--s-5);
}

.field { margin-bottom: var(--s-4); }
.field--row { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .field--row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.field label, .field__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-2);
  margin-bottom: 6px;
  font-weight: 600;
}
.field__label .req { color: var(--c-red); }
.field__hint { color: var(--c-ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-size: var(--fs-xs); }
.field__hint--error { color: var(--c-red); }
.field__hint--error.field__hint--block { margin-bottom: var(--s-4); }

.input, .select, .textarea {
  width: 100%;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  color: var(--c-ink);
  background: var(--c-paper);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  line-height: 1.4;
  transition: border-color .15s ease, background-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-ink);
  background: #fff;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2316181C' stroke-width='1.5' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.privacy {
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: var(--c-paper);
  border: 1px dashed var(--c-rule);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  line-height: 1.5;
}
.privacy strong { color: var(--c-ink); display: block; font-family: var(--f-display); font-size: var(--fs-sm); margin-bottom: 4px; }

.form-actions {
  margin-top: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: stretch;
}
.form-actions .skip {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
}
.form-actions .skip a { color: var(--c-ink-2); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-canvas);
  color: #D9D5CB;
  padding: var(--s-8) 0 var(--s-5);
  margin-top: var(--s-8);
  font-size: var(--fs-sm);
}
.site-footer a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.site-footer a:hover { border-bottom-color: var(--c-red); color: #fff; }
.footer-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--s-7); }
}
.footer__brand .brand__mark { background: var(--c-red); }
.footer__brand .brand__name, .footer__brand .brand__sub { color: #fff; }
.footer__brand .brand__sub { color: rgba(255,255,255,.55); }
.footer__about {
  margin-top: var(--s-4);
  color: rgba(255,255,255,.7);
  max-width: 38ch;
  line-height: 1.55;
}
.footer__h {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,.5);
  margin: 0 0 var(--s-3);
}
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { padding: 6px 0; }
.footer__list a { border-bottom: 0; opacity: .85; }
.footer__list a:hover { opacity: 1; }
.footer__social { display: flex; gap: var(--s-3); margin-top: var(--s-3); }
.footer__social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.footer__bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.footer__copy {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,.5);
  letter-spacing: 0.04em;
}
.footer__disclaimer {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,.55);
  max-width: 88ch;
}
.footer__disclaimer strong { color: rgba(255,255,255,.8); font-weight: 600; }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.muted { color: var(--c-ink-3); }
.divider-mark {
  display: flex; align-items: center; gap: var(--s-3);
  margin: var(--s-6) 0;
}
.divider-mark::before, .divider-mark::after {
  content: ""; flex: 1; height: 1px; background: var(--c-rule);
}
.divider-mark span {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--c-ink-3);
}

/* ============================================================
   CMS — custom editor at /cms/. Public-site components above
   are reused (form-card, field, input, btn, page-hero, prose,
   sidebar-card, eyebrow). Below are the small additions the CMS
   needs that don't already exist: the user/breadcrumb strip,
   dashboard cards, list tables, and inline action buttons.
   ============================================================ */

.cms-shell {
  padding: var(--s-5) 0 var(--s-8);
  min-height: 60vh;
}

/* Logout strip, top right of the CMS shell. */
.cms-userbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 var(--s-3);
}
.cms-userbar form { margin: 0; }
.cms-userbar__logout { padding: 8px 14px; font-size: var(--fs-sm); }

/* Page heading inside the CMS shell */
.cms-page-head { margin: 0 0 var(--s-6); }
.cms-page-head .eyebrow { margin-bottom: var(--s-2); }
.cms-page-head--row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.cms-page-head__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

/* Action menu (cotton: c-action-menu)
   Trigger button + popover panel. Items are top-level <a> or <button>
   children of the panel; styled uniformly so callers don't have to think. */
.action-menu { position: relative; display: inline-block; }
.action-menu__trigger { gap: var(--s-2); padding: 10px 14px; font-size: var(--fs-sm); }
.action-menu__trigger[aria-expanded="true"] { border-color: var(--c-ink); color: var(--c-ink); }
.action-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 220px;
  padding: var(--s-2);
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(16, 18, 28, 0.12);
}
.action-menu--right .action-menu__panel { right: 0; }
.action-menu--left  .action-menu__panel { left: 0; }
.action-menu__panel > a,
.action-menu__panel > button,
.action-menu__panel > form > button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--s-2) var(--s-3);
  font-family: var(--f-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-ink);
  background: none;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.action-menu__panel > a:hover,
.action-menu__panel > button:hover,
.action-menu__panel > form > button:hover { background: var(--c-paper-2); color: var(--c-ink); }
.action-menu__panel > form { margin: 0; }
.action-menu__item--danger,
.action-menu__panel > .action-menu__item--danger { color: var(--c-red-deep); }
.cms-h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-2xl);
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
  color: var(--c-ink);
}

/* Dashboard cards — same idea as quicklink, slightly larger. */
.cms-cards {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) { .cms-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cms-cards { grid-template-columns: repeat(3, 1fr); } }
.cms-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--c-ink);
  transition: border-color .15s ease, transform .1s ease;
  min-height: 130px;
}
.cms-card:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
  transform: translateY(-1px);
}
.cms-card__num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
}
.cms-card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-lg);
  line-height: 1.2;
}
.cms-card__sub {
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  margin-top: auto;
}

/* Tables (lists) */
/* Scroll wrapper: on narrow viewports the table outgrows the container
   and the user swipes horizontally instead of every cell wrapping. The
   right-edge fade is a scroll affordance — only painted when there's
   actually content to scroll to (background-attachment: local trick). */
.cms-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--c-card), var(--c-card)) left center / 20px 100% no-repeat local,
    linear-gradient(to right, var(--c-card), var(--c-card)) right center / 20px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent) left center / 12px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(0, 0, 0, 0.08), transparent) right center / 12px 100% no-repeat scroll;
}
.cms-table-scroll:focus { outline: 2px solid var(--c-red); outline-offset: 2px; }
.cms-table-scroll:focus:not(:focus-visible) { outline: none; }
.cms-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: var(--fs-sm);
}
.cms-table thead th {
  background: var(--c-paper-2);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-rule);
}
.cms-table tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-rule-2);
  vertical-align: middle;
}
.cms-table tbody tr:last-child td { border-bottom: 0; }
.cms-table tbody tr:hover td { background: var(--c-paper); }
.cms-table a { color: var(--c-ink); text-decoration: none; font-weight: 600; }
.cms-table a:hover { color: var(--c-red); }
.cms-table__actions {
  text-align: right;
  white-space: nowrap;
}
.cms-mono {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  background: var(--c-paper-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Inline row actions (link-styled buttons) */
.cms-action {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-2);
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  text-decoration: none;
}
.cms-action:hover { color: var(--c-red); }
.cms-action--danger { color: var(--c-red-deep); }
.cms-action--danger:hover { color: #7b0a17; }

/* Definition list, used on /cms/ops/roles/<id>/ for label / value pairs.
   Two columns on wide screens, stacked on narrow ones. */
.cms-defs {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--s-2) var(--s-4);
  margin: 0;
}
.cms-defs dt {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-3);
  margin: 0;
}
.cms-defs dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-ink);
}
@media (max-width: 600px) {
  .cms-defs { grid-template-columns: 1fr; gap: var(--s-1) 0; }
  .cms-defs dd { margin-bottom: var(--s-2); }
}

/* Status pills (used on lead list) */
.cms-pill {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.cms-pill--ok   { background: #e8f5e9; color: #1f6f33; }
.cms-pill--warn { background: #fff8e1; color: #7a5d10; }
.cms-pill--ink  { background: var(--c-paper-2); color: var(--c-ink-2); }
.cms-pill--current { background: var(--c-ink); color: var(--c-card); }

/* Wizard stepper used on the Gmail send-mail-as guide. */
.cms-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0 0 var(--s-5);
  padding: 0;
  list-style: none;
}
.cms-stepper a,
.cms-stepper span { text-decoration: none; }

/* Copyable credential row used in the wizard SMTP step. */
.cms-credential {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--c-rule);
}
.cms-credential:last-child { border-bottom: 0; }
.cms-credential__label {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-3);
}
.cms-credential__value {
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  color: var(--c-ink);
  word-break: break-all;
}
.cms-credential__value--masked { color: var(--c-ink-3); }
@media (max-width: 600px) {
  .cms-credential {
    grid-template-columns: 1fr;
  }
}

/* Forms inside the CMS — reuses .field/.input/.select/.textarea */
.cms-form { max-width: 100%; }
/* Single-line text inputs and selects look stretched in a wide container.
   Cap them. Textareas and the markdown editor's grid still fill the
   full form width so preview panes get whatever the page allows. */
/* CMS form inputs fill the available column. The instruction text sits
   beside the label (top-right of the field), so the input visually
   "goes the distance" instead of leaving dead space on desktop. */
.cms-form .input,
.cms-form .select,
.cms-form select,
.cms-form .textarea,
.cms-form textarea { width: 100%; }
.cms-form .field { margin-bottom: var(--s-5); }
.cms-form-errors {
  border: 1px solid var(--c-red);
  background: #fdecea;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  margin-bottom: var(--s-5);
}
.cms-form-actions {
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  gap: var(--s-3);
}
/* If any button in a form-actions group is .btn-lg, every sibling button
   matches its padding + font-size. Stops the "primary lg next to default
   cancel = visibly different heights" mismatch from being possible. */
.cms-form-actions:has(.btn-lg) .btn { padding: 18px 28px; font-size: var(--fs-md); }

/* `danger` is a modifier on top of a base variant — semantic only,
   the visual is whatever that variant already gives us. Both reds
   below are the design-system tokens; no off-palette colors. */

/* Ghost danger: red text + red border on transparent (the standalone
   "Delete" link on edit pages). */
.btn-ghost.btn-danger,
a.btn-ghost.btn-danger { color: var(--c-red-deep); border-color: var(--c-red-deep); }
.btn-ghost.btn-danger:hover,
a.btn-ghost.btn-danger:hover { background: var(--c-red-deep); color: #fff; }

/* Primary danger: visually identical to .btn-primary (same red token,
   white text). The earlier "deeper red bg" override drifted from the
   single-red rule. .btn-primary already supplies bg+color+border, and
   .btn-danger has no business changing them on a filled button. */

/* Pagination row */
.cms-pagination {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  margin-top: var(--s-5);
}

/* Messages */
.cms-messages {
  list-style: none;
  margin: 0 0 var(--s-5);
  padding: 0;
}
.cms-messages li {
  border-radius: var(--radius);
  border: 1px solid var(--c-rule);
  background: var(--c-card);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-2);
  font-size: var(--fs-sm);
}
.cms-messages li.error { border-color: var(--c-red); background: #fdecea; }
.cms-messages li.success { border-color: #b3d8b8; background: #e8f5e9; }

/* ---------- Utilities ----------
   Conservative spacing/typography helpers mapped to design tokens.
   Use these instead of inline `style="…"`. Add new utilities only when a
   pattern repeats; one-offs should become a component variant instead. */
.icon { display: inline-block; vertical-align: -2px; flex-shrink: 0; }
.text-ok { color: #1f6f33; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }
.mt-8 { margin-top: var(--s-8); }
.mt-9 { margin-top: var(--s-9); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-7 { margin-bottom: var(--s-7); }
.mb-8 { margin-bottom: var(--s-8); }
.mb-9 { margin-bottom: var(--s-9); }
.fs-xs  { font-size: var(--fs-xs); }
.fs-sm  { font-size: var(--fs-sm); }
.fs-md  { font-size: var(--fs-md); }
.fs-lg  { font-size: var(--fs-lg); }
.fs-xl  { font-size: var(--fs-xl); }
.fs-2xl { font-size: var(--fs-2xl); }
.text-muted { color: var(--c-ink-2); }
.text-quiet { color: var(--c-ink-3); }
.bg-paper-2 { background: var(--c-paper-2); }
.d-inline { display: inline; }
.cms-pill--saved { margin-left: var(--s-2); }

/* Row-margin variant of section__head — replaces inline margin-top. */
.section__head--mt7 { margin-top: var(--s-7); }

/* Centered styleguide demo helpers (used on /styleguide/). */
.sg-row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.sg-card-wide { max-width: 320px; }
.sg-render--canvas-dark {
  background: var(--c-canvas);
  color: rgba(255,255,255,.7);
  padding: var(--s-5);
  border-radius: var(--radius);
}
.sg-render--canvas-pad {
  background: var(--c-canvas);
  padding: var(--s-5);
  border-radius: var(--radius);
}

/* ---------- Hero rotator (home page) ---------- */
.hero__media--rotator { position: relative; }
.hero__media--rotator .hero__rotator-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}
.hero__media--rotator .hero__rotator-img.is-active { opacity: 1; }
/* First image stays painted under the rotation until JS boots, so the area
   never appears blank on slow networks or when JS is disabled. */
.hero__media--rotator .hero__rotator-img:first-of-type { opacity: 1; }
.hero__media--rotator .hero__rotator-img:first-of-type:not(.is-active) { opacity: 0; }

/* ---------- Page hero photo (above-prose) ---------- */
.page-hero-photo {
  margin: 0 0 var(--s-6);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-paper-2);
  border: 1px solid var(--c-rule);
}
.page-hero-photo img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.page-hero-photo figcaption {
  padding: var(--s-3) var(--s-4);
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink-3);
  background: var(--c-paper);
  border-top: 1px solid var(--c-rule);
}

/* ---------- Photo gallery ---------- */
.photos__section { margin: var(--s-7) 0; }
.photos__section-head { margin-bottom: var(--s-4); }
.photos__section-head h2 {
  font-size: var(--fs-xl);
  margin: var(--s-2) 0 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (min-width: 700px)  { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.photo-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  background: var(--c-card);
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.photo-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-khaki);
}
.photo-tile:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}
.photo-tile__media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--c-paper-2);
  overflow: hidden;
}
.photo-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tile__caption {
  display: block;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  border-top: 1px solid var(--c-rule);
}

/* ---------- Photo lightbox ---------- */
[x-cloak] { display: none !important; }
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 17, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}
.photo-lightbox__figure {
  max-width: min(1100px, 95vw);
  max-height: 90vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}
.photo-lightbox__figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.photo-lightbox__figure figcaption {
  color: #f4efe5;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
}
.photo-lightbox__close,
.photo-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox__close:hover,
.photo-lightbox__nav:hover { background: rgba(255, 255, 255, 0.18); }
.photo-lightbox__close { top: var(--s-4); right: var(--s-4); }
.photo-lightbox__nav--prev { left: var(--s-4); top: 50%; transform: translateY(-50%); }
.photo-lightbox__nav--next { right: var(--s-4); top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .photo-lightbox__nav--prev { left: var(--s-2); }
  .photo-lightbox__nav--next { right: var(--s-2); }
}

/* ---------- Leader photos (public + CMS upload) ---------- */
.leader-photo {
  margin: 0 0 var(--s-3);
  width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-paper-2);
  border: 1px solid var(--c-rule);
}
.leader-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.leader-photo--default { object-fit: contain; padding: 8px; background: var(--c-paper-2); }

/* Image-crop upload widget (cotton: c-image-crop-upload) */
.image-crop input[type="file"] { display: none; }
.image-crop__preview { display: flex; align-items: center; gap: var(--s-4); }
.image-crop__current,
.image-crop__placeholder {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--c-paper-2);
  border: 1px solid var(--c-rule);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.image-crop__current { object-fit: cover; }
.image-crop__placeholder img { max-width: 80%; max-height: 80%; opacity: .6; }
.image-crop__pick { padding: 10px 16px; font-size: var(--fs-sm); }

.image-crop__modal {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(16, 18, 28, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
}
.image-crop__modal-card {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: var(--s-5);
  width: min(100%, 560px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(16, 18, 28, 0.35);
}
.image-crop__modal-title { margin: 0 0 var(--s-2); font-family: var(--f-display); font-size: var(--fs-xl); }
.image-crop__stage { background: #1a1c22; border-radius: var(--radius-sm); height: 380px; overflow: hidden; margin-bottom: var(--s-4); }
.image-crop__stage img { display: block; max-width: 100%; }
.image-crop__modal-actions { display: flex; gap: var(--s-3); }

/* ---------- CMS photo list/preview ---------- */
.cms-photo-thumb-cell { width: 92px; }
.cms-photo-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-rule);
  display: block;
}
.cms-photo-preview {
  margin: 0 0 var(--s-5);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-paper-2);
}
.cms-photo-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.cms-photo-preview figcaption {
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  background: var(--c-paper);
  border-top: 1px solid var(--c-rule);
}

/* ---------- Roster importer + Blasts (Phase 2/3) ----------
   Diff/summary cards used on /cms/roster/import/preview/ and the blast
   preview pane. Tokens reused from the rest of the CMS so these blend
   with everything else. */

.cms-h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  letter-spacing: -0.005em;
  margin: var(--s-6) 0 var(--s-3);
  color: var(--c-ink);
}
.cms-h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-lg);
  margin: 0 0 var(--s-3);
  color: var(--c-ink);
}
.cms-roster-den { margin-bottom: var(--s-7); }
.cms-roster-den .cms-table { margin-top: var(--s-3); }

.cms-summary {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: var(--s-5) 0;
}
@media (min-width: 700px) { .cms-summary { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .cms-summary { grid-template-columns: repeat(6, 1fr); } }
.cms-summary__cell {
  padding: var(--s-4);
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.cms-summary__num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--c-ink);
}
.cms-summary__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-3);
}

.cms-diff {
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-4);
}
.cms-diff--add { border-left-color: #2e7d32; }
.cms-diff--update { border-left-color: #c79100; }
.cms-diff--remove { border-left-color: var(--c-red); }
.cms-diff__list {
  list-style: disc;
  padding-left: var(--s-5);
  margin: 0;
}
.cms-diff__list li { margin-bottom: var(--s-1); }

.cms-callout {
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}
.cms-callout--warn { background: #fff8e1; border-color: #e6c66a; }
.cms-callout--info { background: #e7f1fb; border-color: #b9d4ec; }
.cms-callout--alert { background: #fdecea; border-color: var(--c-red); }
.cms-callout__list {
  margin: var(--s-2) 0 0;
  padding-left: var(--s-5);
}
.cms-callout__list li { margin-bottom: var(--s-1); font-size: var(--fs-sm); }

/* Blast composer specifics */
.cms-radio-row {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.cms-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  background: var(--c-card);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.cms-charcount {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  margin-top: var(--s-1);
}
.cms-charcount--over { color: var(--c-red); }
.cms-blast-preview {
  background: var(--c-paper);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  white-space: pre-wrap;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  color: var(--c-ink);
}
