/* ============================================================
   CHARITY BIB FINDER (charity.trackstar.art)
   Built on the shared token layer in trackstar-system.css and the
   live footer in trackstar-footer.css; the build copies both in so
   they never drift from the store. Mobile-first.
   Cards follow a departure-board idea: the charity name is the big
   thing, two facts sit under it, everything else is small.
   ============================================================ */

:root{
  /* trackstar.art ships Inter from theme settings; the token file
     still names Helvetica as its fallback, so pin Inter here. */
  --ts-font:Inter,'Helvetica Neue',Helvetica,Arial,sans-serif;
  --ts-text:#1A1A1A;
  --cf-amber:#B85F0A;          /* amber darkened to pass contrast as text */
  --cf-soft:#EDEBE6;           /* tag fill */
}

*,*::before,*::after{ box-sizing:border-box; }
[hidden]{ display:none !important; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; background:var(--ts-white); color:var(--ts-text);
  font-family:var(--ts-font); font-size:16px; line-height:1.35;
  letter-spacing:var(--ts-tracking);
}
a{ color:inherit; }
img{ max-width:100%; display:block; }
h1,h2,h3,p{ margin:0; }
input,select,button,textarea{ font:inherit; letter-spacing:inherit; color:inherit; }
.cf-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.cf-muted{ color:var(--ts-muted); }

.cf-wrap{ max-width:var(--ts-container); margin:0 auto; padding-inline:var(--ts-gutter); }
.cf-section{ padding-block:var(--ts-section-pad); }
.cf-section--tight{ padding-block:24px; }
@media (min-width:750px){ .cf-section--tight{ padding-block:40px; } }
.cf-panel{ background:var(--ts-gray); margin-inline:var(--ts-panel-inset); border-radius:var(--ts-panel-radius); }
.cf-panel + .cf-panel{ margin-top:var(--ts-panel-inset); }

/* Page titles share the card names' tight, poster-like set, just bigger. */
.cf-title{ font-size:clamp(44px, 7vw, 80px); line-height:0.98; letter-spacing:-0.05em; font-weight:700; text-wrap:balance; overflow-wrap:anywhere; }
.cf-h2{ font-size:28px; line-height:1.1; font-weight:700; text-wrap:balance; }
.cf-h3{ font-size:20px; line-height:1.15; font-weight:700; }
.cf-lede{ font-size:var(--ts-subhead); line-height:1.35; color:var(--ts-muted); max-width:46ch; margin-top:12px; }
.cf-body{ color:var(--ts-muted); margin-top:8px; }
.cf-head{ margin-bottom:var(--ts-title-gap); }
.cf-head--center{ text-align:center; }
.cf-head--center .cf-lede{ margin-inline:auto; }
@media (min-width:750px){
  .cf-h2{ font-size:36px; }
  .cf-h3{ font-size:22px; }
}

/* ---- buttons ---- */
.cf-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:52px; padding:16px 28px; border-radius:var(--ts-r-control);
  font-weight:700; font-size:16px; line-height:1; text-decoration:none; cursor:pointer;
  border:1.5px solid transparent; transition:background 150ms ease,color 150ms ease,border-color 150ms ease;
}
.cf-btn--primary{ background:var(--ts-purple); color:#fff; }
.cf-btn--primary:hover{ background:var(--ts-purple-hover); }
.cf-btn--secondary{ background:transparent; color:var(--ts-purple); border-color:var(--ts-purple); }
.cf-btn--secondary:hover{ background:var(--ts-purple); color:#fff; }
.cf-link{
  color:var(--ts-purple); font-weight:700; text-decoration:underline;
  text-decoration-thickness:1px; text-underline-offset:4px;
}
.cf-link:hover{ text-decoration-thickness:2px; }
@media (max-width:749px){ .cf-btn--block{ width:100%; } }
@media (min-width:750px){ .cf-btn--block{ width:auto; justify-self:start; } }

/* ---- header: one slim nav, not the store mega-nav ---- */
.cf-header{ border-bottom:1px solid var(--ts-border); background:#fff; position:sticky; top:0; z-index:20; }
.cf-header__inner{ display:flex; align-items:center; gap:16px; min-height:60px; }
.cf-logo{ display:flex; align-items:center; gap:10px; text-decoration:none; flex-shrink:0; }
.cf-logo img{ width:100px; height:auto; }
.cf-logo span{ font-weight:700; font-size:14px; padding-left:10px; border-left:1px solid var(--ts-border); white-space:nowrap; }
.cf-nav{ margin-left:auto; display:flex; gap:20px; }
.cf-nav a{ text-decoration:none; font-weight:500; font-size:15px; white-space:nowrap; }
.cf-nav a:hover,.cf-nav a[aria-current="page"]{ color:var(--ts-purple); }
.cf-nav a:first-child{ display:none; }
.cf-nav__extra{ display:none; }
@media (min-width:750px){
  .cf-logo img{ width:124px; }
  .cf-nav a:first-child,.cf-nav__extra{ display:inline; }
}

/* ---- breadcrumb ---- */
.cf-crumbs{ font-size:14px; color:var(--ts-muted); padding-top:20px; }
.cf-crumbs a{ text-decoration:none; }
.cf-crumbs a:hover{ color:var(--ts-purple); }
.cf-crumbs span[aria-hidden]{ margin-inline:6px; }

/* ---- hero ---- */
.cf-hero{ padding-block:32px; }
.cf-hero--center{ text-align:center; }
.cf-hero--center .cf-lede{ margin-inline:auto; }
@media (min-width:750px){ .cf-hero{ padding-block:56px 48px; } }

/* ---- inputs ---- */
.cf-input,.cf-select{
  width:100%; min-height:52px; padding:14px 16px; font-size:16px; /* 16px stops iOS zoom */
  background:#fff; border:1.5px solid var(--ts-border); border-radius:var(--ts-r-control);
}
.cf-input--big{ min-height:60px; font-size:18px; }
.cf-textarea{ min-height:120px; resize:vertical; line-height:1.4; background:var(--ts-gray); }
.cf-select{ appearance:none; padding-right:40px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231A1A1A' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 16px center; }
.cf-input:focus,.cf-select:focus{ outline:none; border-color:var(--ts-purple); }
.cf-label{ display:block; font-size:14px; font-weight:500; margin-bottom:6px; }
.cf-check{ display:flex; align-items:center; gap:10px; font-size:15px; cursor:pointer; min-height:44px; }
.cf-check input{ width:20px; height:20px; accent-color:var(--ts-purple); margin:0; }

/* ---- finder ---- */
.cf-finder__primary{ display:grid; gap:8px; }
@media (min-width:750px){ .cf-finder__primary{ grid-template-columns:2fr 1fr; } .cf-finder__primary--solo{ grid-template-columns:1fr; } }
.cf-finder__filters{ display:grid; gap:12px; grid-template-columns:1fr 1fr; margin-top:12px; }
.cf-finder__filters > div:first-child{ grid-column:1 / -1; }
.cf-finder__toggles{ grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:0 24px; }
@media (min-width:750px){
  .cf-finder__filters{ grid-template-columns:repeat(3,1fr); }
  .cf-finder__filters > div:first-child{ grid-column:auto; }
}
.cf-finder__heading{ margin:32px 0 12px; }
.cf-finder__bar{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.cf-finder__reset{ background:none; border:0; padding:0; cursor:pointer; color:var(--ts-purple); text-decoration:underline; text-underline-offset:4px; font-size:15px; font-weight:700; }
.cf-more{ margin-top:24px; text-align:center; }
.cf-browse{ margin-top:32px; text-align:center; font-size:15px; color:var(--ts-muted); }
.cf-browse a{ margin-inline:8px; white-space:nowrap; }
.cf-empty{ background:#fff; border-radius:var(--ts-r-card); padding:32px 16px; text-align:center; color:var(--ts-muted); }

/* ---- the card ---- */
.cf-list{ display:grid; gap:12px; }
@media (min-width:700px){ .cf-list{ grid-template-columns:repeat(2,1fr); } .cf-row{ min-height:228px; } }
@media (min-width:1000px){ .cf-list{ grid-template-columns:repeat(3,1fr); } }
.cf-row{
  display:flex; flex-direction:column; padding:20px;
  background:#fff; border-radius:var(--ts-r-card); text-decoration:none;
  transition:box-shadow 150ms ease;
}
.cf-row:hover{ box-shadow:0 0 0 1.5px var(--ts-purple); }
.cf-row__top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.cf-row__race{ font-size:15px; font-weight:700; line-height:1.3; }
.cf-row__name{
  display:block; margin:12px 0 24px;
  font-size:32px; line-height:1; font-weight:700; letter-spacing:-0.05em; text-wrap:balance;
  overflow-wrap:anywhere;
}
.cf-row__name--long{ font-size:24px; line-height:1.05; }
.cf-row__stats{ margin-top:auto; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cf-row__stats > :last-child{ text-align:right; }
.cf-row__k{ display:block; font-size:13px; color:var(--ts-muted); margin-bottom:2px; }
.cf-row__v{ display:block; font-size:24px; font-weight:700; line-height:1.1; letter-spacing:-0.04em; }
.cf-tag{ display:inline-block; padding:4px 10px; border-radius:var(--ts-r-pill); background:var(--cf-soft); font-size:12px; font-weight:500; white-space:nowrap; }

/* Cause tags: one soft tint per cause, dark text for contrast. No purple tint,
   purple is reserved for actions. */
.cf-tag--animals{ background:#F1E9DF; color:#6A4A1F; }
.cf-tag--cancer{ background:#FCE4EC; color:#8E1A45; }
.cf-tag--children-and-young-people{ background:#FFF1BF; color:#6E5100; }
.cf-tag--community-and-housing{ background:#EFE5D8; color:#614629; }
.cf-tag--disability-and-adaptive-sport{ background:#D5EFEA; color:#1B6356; }
.cf-tag--education-and-mentoring{ background:#DCEAFB; color:#1C4A82; }
.cf-tag--environment{ background:#DEF1D6; color:#2C641C; }
.cf-tag--health-and-research{ background:#D7EFF6; color:#0D5A6D; }
.cf-tag--hospitals-and-care{ background:#FCE0DA; color:#8F2A19; }
.cf-tag--mental-health-and-recovery{ background:#E2E8EF; color:#344658; }
.cf-tag--military-and-veterans{ background:#E8ECD3; color:#4A541B; }
.cf-tag--sport-and-running{ background:#FFE4CC; color:#813F00; }

/* Trackstar card: ink, like the boards it borrows from. Purple stays off it. */
.cf-row--promo{ background:var(--ts-ink); color:#fff; }
.cf-row--promo:hover{ box-shadow:0 0 0 1.5px var(--ts-ink); }
.cf-row--promo .cf-tag{ background:rgba(255,255,255,.14); color:#fff; }
.cf-row--promo .cf-row__k{ color:rgba(255,255,255,.6); }
.cf-row__promo{ margin-top:auto; display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.cf-row__promo img{ width:96px; height:96px; object-fit:cover; border-radius:var(--ts-r-card); background:#fff; flex-shrink:0; }
.cf-row__logo{ width:96px; height:auto; margin-top:2px; }
.cf-row__sub{ display:block; font-size:17px; font-weight:500; color:rgba(255,255,255,.85); }
.cf-row__cta{ display:block; margin-top:10px; font-weight:700; font-size:15px; text-decoration:underline; text-underline-offset:4px; }

/* calendar cards: same board shape, three smaller facts */
/* three dates read best as rows: label left, date right */
.cf-row__stats--3{ grid-template-columns:1fr; gap:0; }
.cf-row__stats--3 > span{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:8px 0; border-top:1px solid var(--ts-border); }
.cf-row__stats--3 > :last-child{ text-align:left; }
.cf-row__stats--3 .cf-row__k{ margin:0; }
.cf-row__v--sm{ font-size:18px; line-height:1.15; text-align:right; }
.cf-cal__status{ font-size:14px; font-weight:700; white-space:nowrap; }
.cf-cal--static:hover{ box-shadow:none; }
.cf-section:not(.cf-panel) .cf-row{ background:var(--ts-gray); }
.cf-list--one{ grid-template-columns:1fr !important; max-width:560px; }
.cf-cal__notes{ list-style:none; padding:0; margin:16px 0 0; display:grid; gap:8px; color:#3a3a3a; font-size:15px; max-width:72ch; }
.cf-cal__detail{ padding:20px 0; border-bottom:1px solid var(--ts-border); }
.cf-cal__detail h3 a{ text-decoration:none; }
.cf-cal__ics{ font-size:14px; margin-left:12px; }
.cf-finder__bar.cf-head{ align-items:baseline; }

/* ---- timeline: races down the left, months along the bottom ---- */
.cf-tl{ margin:0; position:relative; }
.cf-tl__legend{ display:flex; flex-wrap:wrap; gap:8px 20px; font-size:13px; color:var(--ts-muted); margin-bottom:16px; }
.cf-tl__legend span{ display:inline-flex; align-items:center; gap:8px; }
.cf-tl__key{ display:inline-block; width:20px; height:10px; border-radius:4px; }
.cf-tl__key--open, .cf-tl__bar--open{ background:var(--ts-purple); }
.cf-tl__key--fill, .cf-tl__bar--fill{ background:repeating-linear-gradient(45deg, rgba(70,0,214,.45) 0 3px, rgba(70,0,214,.12) 3px 7px); }
.cf-tl__key--soon, .cf-tl__bar--soon{ background:repeating-linear-gradient(45deg, rgba(184,95,10,.55) 0 3px, rgba(184,95,10,.15) 3px 7px); }
.cf-tl__key--closed, .cf-tl__bar--closed{ background:#B3AFA8; }
.cf-tl__key--race{ width:10px; height:10px; border-radius:50%; background:var(--ts-text); }
.cf-tl__key--today{ width:2px; height:14px; border-radius:0; background:#F28C28; }
.cf-tl__scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.cf-tl__inner{ position:relative; min-width:760px; --label:168px; padding-top:28px; }
@media (max-width:749px){ .cf-tl__inner{ --label:116px; } .cf-tl__name{ font-size:14px; } }
.cf-tl__row{ display:grid; grid-template-columns:var(--label) 1fr; align-items:center; min-height:48px; border-top:1px solid #ECEAE5; }
.cf-tl__row--axis{ border-top:1px solid var(--ts-border); min-height:36px; }
.cf-tl__label{ position:sticky; left:0; z-index:2; background:var(--ts-white); display:flex; flex-direction:column; gap:2px; padding:8px 12px 8px 0; text-decoration:none; }
.cf-tl__name{ font-weight:700; font-size:15px; line-height:1.1; }
.cf-tl__label .cf-status{ font-size:12px; font-weight:500; }
.cf-tl__label:hover .cf-tl__name{ color:var(--ts-purple); }
.cf-tl__track{ position:relative; height:48px; }
.cf-tl__row--axis .cf-tl__track{ height:36px; }
.cf-tl__grid, .cf-tl__layer{ position:absolute; top:28px; bottom:36px; left:var(--label); right:0; pointer-events:none; }
.cf-tl__layer{ z-index:3; }
.cf-tl__grid span{ position:absolute; top:0; bottom:0; width:1px; background:#F1EFEA; }
.cf-tl__today{ position:absolute; top:0; bottom:0; width:0; }
.cf-tl__today::before{ content:""; position:absolute; top:0; bottom:0; left:-1px; width:2px; background:#F28C28; }
.cf-tl__today span{ position:absolute; top:-22px; left:0; transform:translateX(-50%); background:var(--cf-amber); color:#fff; font-size:11px; font-weight:700; padding:2px 6px; border-radius:var(--ts-r-pill); white-space:nowrap; }
.cf-tl__bar{ position:absolute; top:50%; height:12px; margin-top:-6px; border-radius:4px; min-width:4px; cursor:default; outline-offset:2px; }
.cf-tl__race{ position:absolute; top:50%; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; background:var(--ts-text); box-shadow:0 0 0 2px var(--ts-white); z-index:1; }
.cf-tl__race--approx{ background:var(--ts-white); box-shadow:inset 0 0 0 2px var(--ts-text), 0 0 0 2px var(--ts-white); }
.cf-tl__note{ position:absolute; top:50%; transform:translateY(-50%); font-size:12px; color:var(--ts-muted); white-space:nowrap; }
.cf-tl__month{ position:absolute; top:8px; font-size:12px; color:var(--ts-muted); padding-left:4px; white-space:nowrap; }
.cf-tl__month b{ display:block; font-weight:700; color:var(--ts-text); font-size:11px; }
.cf-tl__tip{ position:absolute; z-index:10; max-width:260px; background:var(--ts-text); color:#fff; font-size:13px; line-height:1.35; padding:8px 10px; border-radius:var(--ts-r-card); pointer-events:none; }


/* collapsed Sources list under calendar views */
.cf-sources{ margin-top:24px; border-top:1px solid var(--ts-border); }
.cf-sources summary{ list-style:none; cursor:pointer; padding:16px 0; font-weight:700; font-size:16px; display:flex; align-items:center; gap:8px; }
.cf-sources summary::-webkit-details-marker{ display:none; }
.cf-sources summary::after{ content:"+"; color:var(--ts-purple); font-weight:400; font-size:20px; }
.cf-sources[open] summary::after{ content:"\2212"; }

/* status as text color, never a purple fill */
.cf-status--open{ color:var(--ts-purple); }
.cf-status--waitlist,.cf-status--not-yet-open{ color:var(--cf-amber); }
.cf-status--closed,.cf-status--unknown{ color:var(--ts-muted); }

.cf-badge{ display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border-radius:var(--ts-r-pill);
  border:1.2px solid var(--ts-purple); color:var(--ts-purple); font-size:13px; font-weight:700; }

/* ---- product moment: real print, store-card styling ---- */
.cf-print{ display:grid; gap:24px; align-items:center; }
@media (min-width:750px){ .cf-print{ grid-template-columns:1fr 1fr; gap:48px; } }
.cf-print__cards{ display:grid; gap:12px; grid-template-columns:repeat(2,1fr); }
.cf-print__cards--one{ grid-template-columns:minmax(0,320px); }
.cf-product{ text-decoration:none; display:block; }
.cf-product__img{ background:#fff; border-radius:var(--ts-r-card); aspect-ratio:1 / 1; overflow:hidden; }
.cf-product__img img{ width:100%; height:100%; object-fit:cover; transition:transform 300ms ease; }
.cf-product:hover .cf-product__img img{ transform:scale(1.03); }
.cf-product__name{ font-size:15px; margin-top:10px; line-height:1.25; }
.cf-product__price{ font-size:15px; color:var(--ts-muted); margin-top:2px; }
.cf-section:not(.cf-panel) .cf-product__img{ background:var(--ts-gray); }

/* ---- charity page ---- */
.cf-card{ background:#fff; border-radius:var(--ts-r-card); padding:24px; }
.cf-team{ display:grid; gap:24px; }
.cf-team__facts{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px 16px; }
@media (min-width:750px){ .cf-team__facts{ grid-template-columns:repeat(4,1fr); } }
.cf-fact__k{ display:block; font-size:13px; color:var(--ts-muted); }
.cf-fact__v{ font-size:28px; font-weight:700; line-height:1.1; margin-top:4px; }
.cf-fact__v small{ display:block; font-size:13px; font-weight:400; color:var(--ts-muted); margin-top:4px; letter-spacing:var(--ts-tracking); }
.cf-source{ font-size:13px; color:var(--ts-muted); }
.cf-related{ display:flex; flex-wrap:wrap; gap:8px; }
.cf-related a{ text-decoration:none; background:var(--ts-gray); border-radius:var(--ts-r-pill); padding:8px 14px; font-size:14px; }
.cf-related a:hover{ color:var(--ts-purple); }
.cf-related--causes a{ padding:8px 14px; font-size:14px; }
.cf-related--causes a:hover{ color:inherit; box-shadow:0 0 0 1.5px currentColor; }

/* ---- fundraising tools ---- */
.cf-split{ display:grid; gap:24px; }
@media (min-width:900px){ .cf-split{ grid-template-columns:1fr 1.2fr; gap:64px; align-items:start; } }
.cf-tool{ display:grid; gap:16px; }
.cf-tool--gray{ background:var(--ts-gray); }
.cf-tool--gray .cf-textarea{ background:#fff; }
.cf-tool__row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cf-tool__out{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; padding-top:16px; border-top:1px solid var(--ts-border); }
.cf-tool__out b{ display:block; font-size:32px; line-height:1.05; letter-spacing:-0.05em; margin-top:4px; }
.cf-tips{ display:grid; gap:12px; }
@media (min-width:750px){ .cf-tips{ grid-template-columns:repeat(2,1fr); } }

/* ---- prose ---- */
.cf-prose{ max-width:68ch; }
.cf-prose h2{ font-size:24px; line-height:1.15; font-weight:700; margin:32px 0 8px; }
.cf-prose h2:first-child{ margin-top:0; }
.cf-prose p,.cf-prose li{ color:#3a3a3a; line-height:1.5; }
.cf-prose p + p{ margin-top:12px; }
.cf-prose ol{ padding-left:20px; margin:12px 0 0; display:grid; gap:8px; }
.cf-prose a{ color:var(--ts-purple); font-weight:700; text-underline-offset:3px; }

/* ---- faq ---- */
.cf-faq{ max-width:760px; margin:0 auto; }
.cf-faq details{ border-bottom:1px solid var(--ts-border); }
.cf-faq summary{ list-style:none; cursor:pointer; padding:20px 32px 20px 0; font-weight:700; font-size:17px; position:relative; }
.cf-faq summary::-webkit-details-marker{ display:none; }
.cf-faq summary::after{ content:"+"; position:absolute; right:4px; top:16px; font-size:24px; font-weight:400; color:var(--ts-purple); }
.cf-faq details[open] summary::after{ content:"\2212"; }
.cf-faq details p{ padding-bottom:20px; color:#3a3a3a; line-height:1.5; max-width:64ch; }

/* ---- charity-facing ---- */
.cf-form{ display:grid; gap:16px; }
@media (min-width:750px){ .cf-form{ grid-template-columns:1fr 1fr; } .cf-form__full{ grid-column:1 / -1; } }
.cf-form__done{ background:#fff; border-radius:var(--ts-r-card); padding:24px; }

/* ---- footer: the store footer gets a fourth column for Resources ---- */
.tsf{ margin-top:var(--ts-section-pad); }
@media (min-width:750px){ .tsf__grid--4{ grid-template-columns:2fr 1fr 1fr 1fr; } }

/* ---- prototype-only notes (stripped by PROTOTYPE=false) ---- */
.cf-proto{ border:1.5px dashed var(--cf-amber); border-radius:var(--ts-r-card); padding:12px 16px; font-size:14px; color:#5b3a12; background:#FFF8F0; margin-top:16px; text-align:left; }
.cf-proto b{ color:var(--cf-amber); }
