/* SFR event calendar. Built on tokens.css (Swiss Food Research Design System 2026). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--surface-page); color: var(--text-body);
  font-family: var(--font-sans); font-size: var(--text-md); line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: var(--weight-bold); line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight); color: var(--text-heading); margin: 0 0 var(--space-4); }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
.h4 { font-size: var(--text-xl); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
a { color: var(--text-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text-link-hover); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
::selection { background: var(--sfr-cyan); color: var(--sfr-black); }
.sfr-note { font-weight: var(--weight-light); text-transform: uppercase; letter-spacing: var(--tracking-extended); font-size: var(--text-2xs); }
.sfr-sub01 { text-transform: uppercase; letter-spacing: var(--tracking-extended); font-size: var(--text-xs); }
.muted { color: var(--text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--layout-max); margin: 0 auto; padding: 0 var(--space-8); }

/* Header and footer, after the website UI kit */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--sfr-white); border-bottom: 1px solid var(--border-subtle); }
.header-row { height: 76px; display: flex; align-items: center; gap: var(--space-6); }
.logo { line-height: 0; }
.logo img { height: 52px; width: auto; }
.header-title { color: var(--text-muted); padding-left: var(--space-6); border-left: 1px solid var(--border-subtle); }
.account { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.account .who { color: var(--text-muted); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who strong { color: var(--text-heading); font-weight: var(--weight-semibold); }

.site-footer { background: var(--sfr-black); color: var(--sfr-paper-72); margin-top: var(--space-24); padding: var(--space-12) 0; font-size: var(--text-sm); }
.site-footer a { color: var(--sfr-white); }
.footer-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-10); align-items: start; }
.footer-row img { height: 48px; width: auto; }
.footer-row p { margin: 0; max-width: 60ch; }

/* Hero */
.hero { background: var(--gradient-general); color: var(--text-inverse); padding: var(--space-16) 0 var(--space-12); }
.hero h1 { color: var(--sfr-white); max-width: 22ch; }
.hero .eyebrow { color: var(--sfr-cyan); margin-bottom: var(--space-3); }
.hero .lead { font-size: var(--text-lg); color: var(--sfr-paper-72); max-width: 62ch; margin: 0; }
.hero-event h1 { font-size: var(--text-3xl); max-width: 30ch; }
.hero-date { font-size: var(--text-lg); color: var(--sfr-paper-72); margin: 0; }
.crumbs { margin-bottom: var(--space-6); font-size: var(--text-sm); }
.crumbs a { color: var(--sfr-paper-72); }
.crumbs a::before { content: "\2190  "; }

/* Buttons, after core/Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: inherit; font-weight: var(--weight-semibold); font-size: var(--text-sm); line-height: 1;
  padding: 12px 20px; border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: var(--transition-control); white-space: nowrap; }
.btn-sm { padding: 9px 16px; font-size: var(--text-xs); }
.btn-block { width: 100%; }
.btn-primary { background: var(--action-primary-bg); color: var(--action-primary-fg); }
.btn-primary:hover { background: var(--action-primary-bg-hover); color: var(--action-primary-fg); }
.btn-secondary { background: transparent; color: var(--action-secondary-fg); border-color: var(--action-secondary-border); }
.btn-secondary:hover { background: var(--action-secondary-bg-hover); color: var(--action-secondary-fg); }
.btn-ghost { background: transparent; color: var(--action-ghost-fg); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { text-decoration: underline; }
.btn:disabled { background: var(--action-disabled-bg); color: var(--action-disabled-fg); border-color: transparent; cursor: not-allowed; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: var(--space-10) 0 var(--space-6); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-right: auto; }
.chip { font: inherit; font-size: var(--text-xs); font-weight: var(--weight-medium); padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-body); cursor: pointer; transition: var(--transition-control); }
.chip:hover { border-color: var(--border-strong); }
.chip.is-on { background: var(--sfr-black); border-color: var(--sfr-black); color: var(--sfr-white); }
select, input[type="search"], input[type="email"], input[inputmode="numeric"] {
  font: inherit; font-size: var(--text-sm); padding: 10px 14px; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-heading); }
input[type="search"] { min-width: 220px; }
select:focus, input:focus { outline: none; border-color: var(--sfr-blue-02); box-shadow: var(--shadow-focus); }

/* Lists */
.section-head { font-size: var(--text-xl); margin: var(--space-10) 0 var(--space-4); }
.year-head { font-size: var(--text-md); color: var(--text-muted); font-weight: var(--weight-semibold); letter-spacing: 0; margin: var(--space-8) 0 var(--space-2); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.item { display: grid; grid-template-columns: 76px 1fr; gap: var(--space-6); padding: var(--space-5) 0; border-bottom: 1px solid var(--border-subtle); }
.item[hidden], .year[hidden] { display: none; }
.datebox { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); height: 76px; line-height: 1.05; }
.datebox .d { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text-heading); }
.datebox .m { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-extended); }
.datebox .y { font-size: var(--text-2xs); color: var(--text-muted); }
.datebox-year .y { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--text-heading); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.tag { font-size: var(--text-3xs); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: var(--tracking-extended);
  padding: 4px 8px; border-radius: var(--radius-sm); background: var(--sfr-chip); color: var(--sfr-blue-01); }
.tag-ig { background: var(--sfr-blue-01); color: var(--sfr-white); }
.tag-sfr { background: var(--sfr-black); color: var(--sfr-cyan); }
.tag-external { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted); }
.item-flag { font-size: var(--text-3xs); text-transform: uppercase; letter-spacing: var(--tracking-extended); color: var(--sfr-blue-02); padding: 4px 0; }
.item-title { display: block; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text-heading); text-decoration: none; line-height: var(--leading-snug); }
a.item-title:hover { color: var(--text-link); text-decoration: underline; }
.ext { color: var(--text-muted); font-weight: var(--weight-regular); }
.item-meta { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.empty { color: var(--text-muted); padding: var(--space-6) 0; }

/* Event page */
.event-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-16); margin-top: var(--space-12); }
.block { margin-bottom: var(--space-12); }
.summary p { font-size: var(--text-md); }
.facts { margin: 0 0 var(--space-6); padding: var(--space-6); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.facts div + div { margin-top: var(--space-4); }
.facts dt { font-size: var(--text-3xs); text-transform: uppercase; letter-spacing: var(--tracking-extended); color: var(--text-muted); }
.facts dd { margin: 2px 0 0; color: var(--text-heading); font-weight: var(--weight-medium); }
.event-side .btn-primary { width: 100%; margin-bottom: var(--space-3); }
.event-side { position: sticky; top: 100px; align-self: start; }
.programme { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.programme li { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); }
.p-time { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: var(--text-sm); padding-top: 2px; }
.p-title { display: block; color: var(--text-heading); font-weight: var(--weight-semibold); }
.p-who { display: block; font-size: var(--text-sm); color: var(--text-muted); }
.decks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.deck { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.deck-title { color: var(--text-heading); }
.deck-open .lock { width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 2px; position: relative; top: 2px; }
.deck-open .lock::before { content: ""; position: absolute; left: 1px; top: -7px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.deck-open.is-open .lock { display: none; }
.access-note.ok { color: var(--status-success); }

/* Sign-in dialog, after feedback/Dialog */
.dialog { border: 0; border-radius: var(--radius-lg); padding: var(--space-8); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text-body); }
.dialog::backdrop { background: rgb(3 10 33 / .56); }
.dialog-close { position: absolute; top: var(--space-3); right: var(--space-3); margin: 0; }
.dialog-close button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-heading); }
.divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-6) 0; color: var(--text-muted); font-size: var(--text-xs); }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border-subtle); }
.form-message { margin: var(--space-4) 0 0; font-size: var(--text-sm); min-height: 1.2em; }
.form-message.error { color: var(--status-critical); }
.toast { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); background: var(--sfr-black); color: var(--sfr-white);
  padding: 12px 20px; border-radius: var(--radius-pill); font-size: var(--text-sm); box-shadow: var(--shadow-md); z-index: 50; }

@media (max-width: 860px) {
  .wrap { padding: 0 var(--space-5); }
  h1 { font-size: var(--text-3xl); }
  .hero-event h1 { font-size: var(--text-2xl); }
  .header-title { display: none; }
  .event-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .event-side { position: static; order: -1; }
  .footer-row { grid-template-columns: 1fr; gap: var(--space-5); }
  .item { grid-template-columns: 60px 1fr; gap: var(--space-4); }
  .datebox { height: 60px; }
  input[type="search"] { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Innovation Group icons and pictures (Design System 2026, assets/icons/ig and assets/visuals) */
.ig-icon, .hero-icon { display: inline-block; background: currentColor; flex: none;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ig-icon { width: 16px; height: 16px; margin: -2px 6px -2px 0; }
.tag { display: inline-flex; align-items: center; }
.hero-icon { width: 56px; height: 56px; color: var(--sfr-white); margin-bottom: var(--space-4); }
.hero-photo { position: relative; padding: var(--space-20, 80px) 0 var(--space-12);
  background: var(--scrim-left), var(--scrim-bottom), var(--hero-img) center / cover no-repeat, var(--sfr-black); }
.hero-photo .eyebrow { color: var(--sfr-cyan); }

/* Presentations: open in the browser viewer, or download */
.deck-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.deck-download { padding-left: var(--space-2); padding-right: var(--space-2); }

/* Registration, embedded from ti.to or Eventbrite on request */
.registration { padding: var(--space-6); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.reg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.reg-widget { margin-top: var(--space-4); min-height: 120px; }
.reg-widget iframe { width: 100%; border: 0; }
.facts dd a { color: var(--text-heading); }
.facts dd a:hover { color: var(--text-link); }

@media (max-width: 860px) {
  .hero-photo { background: var(--scrim-bottom), linear-gradient(rgb(3 10 33/.35), rgb(3 10 33/.35)), var(--hero-img) center / cover no-repeat, var(--sfr-black); }
  .deck { flex-wrap: wrap; }
}

/* SFR events and Innovation Group meetings: the SFR symbol, faded, behind the date */
.datebox-sfr { position: relative; overflow: hidden; isolation: isolate; }
.datebox-sfr::before { content: ""; position: absolute; z-index: -1; inset: 8px;
  background: url(img/symbol-sfr-black.svg) center / contain no-repeat; opacity: .14; }

/* Header tabs: Events | Radicle – Knowledge */
.hub-tabs { display: flex; gap: var(--space-1); padding-left: var(--space-6); border-left: 1px solid var(--border-subtle); }
.hub-tab { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-muted); text-decoration: none;
  padding: 8px 12px; border-radius: var(--radius-pill); white-space: nowrap; transition: var(--transition-control); }
.hub-tab:hover { color: var(--text-heading); background: var(--sfr-ink-04); }
.hub-tab.is-on { color: var(--text-heading); background: var(--sfr-chip); }

@media (max-width: 860px) {
  .hub-tabs { padding-left: var(--space-3); }
  .hub-tab { padding: 6px 8px; font-size: var(--text-xs); }
}
@media (max-width: 520px) { .logo img { height: 40px; } .hub-tabs { border-left: 0; padding-left: 0; } }

.hero-compact { padding: var(--space-10) 0 var(--space-8); }
.hero-compact h1 { font-size: var(--text-3xl); max-width: 30ch; margin-bottom: var(--space-3); }
.hero-compact .lead { font-size: var(--text-md); }
@media (max-width: 560px) {
  .header-row { flex-wrap: wrap; height: auto; padding: var(--space-3) 0; row-gap: var(--space-2); }
  .hub-tabs { order: 3; width: 100%; border-left: 0; padding-left: 0; }
  .hero-compact h1 { font-size: var(--text-2xl); }
}

/* Ads in the events list (config/ads.json): one card in the upcoming list */
.ad { margin: var(--space-4) 0; padding: var(--space-5) var(--space-6); border-radius: var(--radius-md);
  background: var(--sfr-blue-01); color: var(--sfr-white); }
.ad[hidden] { display: none; }
.ad-label { margin: 0 0 var(--space-2); font-size: var(--text-3xs); font-weight: var(--weight-medium); text-transform: uppercase;
  letter-spacing: var(--tracking-extended); color: var(--sfr-cyan); }
.ad-head { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: var(--leading-snug); color: var(--sfr-white); }
.ad-body { margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--sfr-paper-72); max-width: 60ch; }
.ad .btn-primary { background: var(--sfr-cyan); color: var(--sfr-blue-01); border-color: var(--sfr-cyan); }
.ad .btn-primary:hover { background: var(--sfr-white); border-color: var(--sfr-white); }

/* Member organisations attending an upcoming event (config/logo_wall.json) */
.logo-wall { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.lw-head { margin: 0 0 var(--space-4); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-heading); }
.lw-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.lw-tile { height: 56px; display: flex; align-items: center; justify-content: center; padding: 8px 10px;
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.lw-tile img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lw-dark { background: var(--sfr-blue-01); border-color: var(--sfr-blue-01); }
.lw-name { font-size: var(--text-3xs); line-height: 1.2; text-align: center; color: var(--text-heading); overflow-wrap: anywhere; }
.lw-dark .lw-name { color: var(--sfr-white); }
.lw-more { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.lw-more + .lw-more { margin-top: var(--space-1); }

/* Fallback when a mailto button opens nothing (no mail app set up in the browser) */
.mail-alt { margin-top: var(--space-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.mail-alt[hidden] { display: none; }
.mail-alt p { flex-basis: 100%; margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.ad .mail-alt p { color: var(--sfr-paper-72); }
.ad .mail-alt .btn { color: var(--sfr-white); border-color: var(--sfr-paper-24); }
.hub-tab[hidden] { display: none; }

/* Privacy page */
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--text-xl); margin: var(--space-8) 0 var(--space-3); }
.prose p { line-height: var(--leading-relaxed, 1.65); }

/* Statistics (staff only) */
.st-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.st-controls label { font-size: var(--text-sm); color: var(--text-muted); }
.st-controls input, .st-controls select { font: inherit; padding: 6px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #fff; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); margin: var(--space-6) 0; }
.st-kpi { background: var(--sfr-blue-01); color: var(--sfr-white); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 4px; }
.st-num { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.st-lab { font-size: var(--text-xs); color: var(--sfr-paper-72); }
.st-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-4); overflow-x: auto; }
.st-h { font-size: var(--text-md); margin: 0 0 var(--space-3); }
.st-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 0 var(--space-4); }
.st-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.st-table th { text-align: left; font-weight: var(--weight-medium); color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); padding: 6px 8px 6px 0; }
.st-table td { border-bottom: 1px solid var(--border-subtle); padding: 7px 8px 7px 0; vertical-align: top; }
.st-table .num { text-align: right; white-space: nowrap; }
.st-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.st-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.st-bar span { display: block; width: 100%; min-height: 1px; background: var(--sfr-blue-02); border-radius: 2px 2px 0 0; }
.st-axis { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-muted); margin: var(--space-2) 0 0; }
.st-dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin: 0; }
.st-dl dt { font-size: var(--text-xs); color: var(--text-muted); }
.st-dl dd { margin: 2px 0 0; font-size: var(--text-xl); font-weight: var(--weight-bold); }
.hero-compact + .wrap.block { padding-top: var(--space-8); }
