/* SARAF 2026 — Programme scientifique (PWA)
   Layout: hero band → sticky toolbar → timeline of time slots; on wide screens each slot
   mirrors the printed programme (Salle 1 | Salle 2), on phones it stacks.
   Every rule is scoped under .saraf-prog so the WordPress theme is left untouched. */

.saraf-prog {
  --sp-bg: #FBF8F1;
  --sp-surface: #FFFFFF;
  --sp-ink: #1B1F1D;
  --sp-muted: #59615C;
  --sp-line: #E6DFCF;
  --sp-soft: #F3EEE2;
  --sp-accent: #0A3326;
  --sp-on-accent: #FBF8F1;
  --sp-accent-ink: #0A3326;
  --sp-gold: #C8A45A;
  --sp-gold-ink: #8A6A22;
  --sp-tag: #E7EEE8;
  --sp-hero: #0A3326;
  --sp-hero-ink: #FBF8F1;
  --sp-hero-muted: #BFCBC3;
  --sp-live: #B4432B;
  --sp-on-live: #FFFFFF;
  --sp-warn-bg: #FBEFD9;
  --sp-warn-ink: #7A5212;
  --sp-mark: #F4E3B5;

  --sp-display: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sp-body: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --sp-radius: 14px;
  --sp-sticky-top: 0px;

  font-family: var(--sp-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--sp-ink);
  background: var(--sp-bg);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
  border-radius: 0;
  text-align: left;
}
.saraf-prog *, .saraf-prog *::before, .saraf-prog *::after { box-sizing: border-box; }

/* Dark palette: only on pages that opt in (the installed app, the preview) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .saraf-prog.sp-auto-dark {
    --sp-bg: #0B1712; --sp-surface: #11221B; --sp-ink: #EDE8DC; --sp-muted: #A4ADA6;
    --sp-line: #24392F; --sp-soft: #15291F; --sp-accent: #C8A45A; --sp-on-accent: #0B1712;
    --sp-accent-ink: #D8BB78; --sp-gold: #C8A45A; --sp-gold-ink: #D8BB78; --sp-tag: #1A3127;
    --sp-hero: #06140F; --sp-hero-ink: #F4EFE3; --sp-hero-muted: #A9B7AE;
    --sp-live: #E0704F; --sp-on-live: #1B0B05; --sp-warn-bg: #3A2C12; --sp-warn-ink: #F0CF8C; --sp-mark: #5A4719;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .saraf-prog.sp-auto-dark {
  --sp-bg: #0B1712; --sp-surface: #11221B; --sp-ink: #EDE8DC; --sp-muted: #A4ADA6;
  --sp-line: #24392F; --sp-soft: #15291F; --sp-accent: #C8A45A; --sp-on-accent: #0B1712;
  --sp-accent-ink: #D8BB78; --sp-gold: #C8A45A; --sp-gold-ink: #D8BB78; --sp-tag: #1A3127;
  --sp-hero: #06140F; --sp-hero-ink: #F4EFE3; --sp-hero-muted: #A9B7AE;
  --sp-live: #E0704F; --sp-on-live: #1B0B05; --sp-warn-bg: #3A2C12; --sp-warn-ink: #F0CF8C; --sp-mark: #5A4719;
  color-scheme: dark;
}

.saraf-prog button, .saraf-prog input, .saraf-prog select {
  font: inherit; color: inherit; margin: 0; letter-spacing: normal; text-transform: none;
  box-shadow: none; min-height: 0; line-height: 1.2;
}
.saraf-prog button { cursor: pointer; background: none; border: 0; }
.saraf-prog :focus-visible { outline: 2px solid var(--sp-gold); outline-offset: 2px; }
.saraf-prog h1, .saraf-prog h2, .saraf-prog h3, .saraf-prog p, .saraf-prog ol, .saraf-prog ul { margin: 0; padding: 0; }
.saraf-prog ol, .saraf-prog ul { list-style: none; }
.saraf-prog svg { display: block; flex-shrink: 0; }
.saraf-prog mark { background: var(--sp-mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.saraf-prog [hidden] { display: none !important; }
.saraf-prog .sp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hero ---------- */
.sp-hero {
  background: var(--sp-hero);
  color: var(--sp-hero-ink);
  padding: 28px 20px 26px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.sp-hero::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--sp-gold) 0 64px, transparent 64px);
}
.sp-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sp-eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sp-gold);
}
.sp-hero h1 {
  font-family: var(--sp-display); font-weight: 700; font-size: clamp(36px, 7vw, 60px);
  line-height: 1; letter-spacing: -0.01em; color: var(--sp-hero-ink); text-wrap: balance;
}
.sp-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--sp-hero-muted); }
.sp-hero-meta strong { color: var(--sp-hero-ink); font-weight: 600; }
.sp-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.sp-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-pill-btn {
  height: 40px; padding: 0 16px; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; border: 1px solid rgba(200,164,90,.55) !important;
  color: var(--sp-hero-ink) !important; background: transparent !important;
}
.sp-pill-btn:hover { background: rgba(200,164,90,.14) !important; }
.sp-pill-btn.sp-solid { background: var(--sp-gold) !important; color: #0A3326 !important; border-color: var(--sp-gold) !important; }
.sp-status {
  font-size: 12px; font-weight: 600; color: var(--sp-hero-muted); display: inline-flex; align-items: center; gap: 6px;
}
.sp-status i { width: 8px; height: 8px; border-radius: 50%; background: #6FBF8E; display: inline-block; }
.sp-status.off i { background: var(--sp-gold); }
.sp-version { font-size: 12px; color: var(--sp-hero-muted); }
.sp-ios-tip {
  font-size: 13px; color: var(--sp-hero-ink); background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px;
}

/* ---------- Toolbar ---------- */
.sp-toolbar {
  position: sticky; top: var(--sp-sticky-top); z-index: 20;
  background: var(--sp-bg); border-bottom: 1px solid var(--sp-line);
  padding: 12px 20px 10px; display: flex; flex-direction: column; gap: 10px;
}
.sp-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--sp-soft); border-radius: 12px; padding: 4px; gap: 4px; }
.sp-views button {
  height: 40px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--sp-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.sp-views button[aria-selected="true"] { background: var(--sp-surface); color: var(--sp-ink); box-shadow: 0 1px 2px rgba(10,51,38,.12); }
.sp-count { font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sp-accent); color: var(--sp-on-accent); display: inline-flex; align-items: center; justify-content: center; }
.sp-count[data-zero="true"] { background: var(--sp-line); color: var(--sp-muted); }

.sp-search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px;
  background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: 12px; color: var(--sp-muted);
}
.sp-search:focus-within { border-color: var(--sp-accent-ink); }
.sp-search input {
  flex: 1; min-width: 0; height: 44px; border: 0 !important; background: transparent !important; outline: none;
  font-size: 15px; color: var(--sp-ink); padding: 0 !important;
}
.sp-search input::placeholder { color: var(--sp-muted); opacity: 1; }
.sp-search input::-webkit-search-cancel-button { display: none; }
.sp-clear { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--sp-muted); }
.sp-clear:hover { background: var(--sp-soft); }

.sp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-days { display: flex; gap: 6px; }
.sp-days button {
  height: 44px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--sp-line) !important; background: var(--sp-surface) !important;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-width: 76px;
}
.sp-days button b { font-size: 13px; font-weight: 800; color: var(--sp-ink); }
.sp-days button small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sp-muted); }
.sp-days button[aria-pressed="true"] { background: var(--sp-accent) !important; border-color: var(--sp-accent) !important; }
.sp-days button[aria-pressed="true"] b, .sp-days button[aria-pressed="true"] small { color: var(--sp-on-accent); }
.sp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-chip {
  height: 36px; padding: 0 13px; border-radius: 18px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--sp-line) !important; background: transparent !important; color: var(--sp-ink) !important; white-space: nowrap;
}
.sp-chip[aria-pressed="true"] { background: var(--sp-ink) !important; border-color: var(--sp-ink) !important; color: var(--sp-bg) !important; }
.sp-select {
  height: 36px; border-radius: 18px; border: 1px solid var(--sp-line) !important; background: var(--sp-surface) !important;
  padding: 0 32px 0 13px !important; font-size: 13px; font-weight: 700; color: var(--sp-ink) !important; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px !important; background-size: 5px 5px, 5px 5px !important; background-repeat: no-repeat !important;
}
.sp-sep { width: 1px; height: 24px; background: var(--sp-line); }

/* ---------- Content ---------- */
.sp-main { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 22px; min-height: 50vh; }
.sp-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--sp-muted); }
.sp-summary strong { color: var(--sp-ink); font-weight: 800; }
.sp-day-head { display: flex; align-items: baseline; gap: 12px; padding-top: 4px; }
.sp-day-head h2 { font-family: var(--sp-display); font-weight: 700; font-size: 28px; line-height: 1.1; color: var(--sp-ink); }
.sp-day-head span { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sp-gold-ink); }

.sp-timeline { display: flex; flex-direction: column; gap: 10px; }
.sp-slot { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.sp-time { padding-top: 14px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; gap: 1px; }
.sp-time b { font-size: 15px; font-weight: 800; color: var(--sp-accent-ink); }
.sp-time small { font-size: 12px; color: var(--sp-muted); }
.sp-cells { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
@media (min-width: 860px) {
  .sp-slot { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  .sp-cells.sp-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-hero { padding: 40px 32px 34px; }
  .sp-hero::after { left: 32px; right: 32px; }
  .sp-toolbar, .sp-main { padding-left: 32px; padding-right: 32px; }
}

/* Cards */
.sp-card {
  background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: var(--sp-radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.sp-card.sp-saved { border-color: var(--sp-gold); box-shadow: inset 0 0 0 1px var(--sp-gold); }
.sp-card-top { display: flex; align-items: flex-start; gap: 10px; }
.sp-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.sp-num { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-gold-ink); }
.sp-tag { font-size: 11.5px; font-weight: 700; color: var(--sp-accent-ink); background: var(--sp-tag); border-radius: 6px; padding: 3px 8px; }
.sp-room { font-size: 11.5px; font-weight: 700; color: var(--sp-muted); border: 1px solid var(--sp-line); border-radius: 6px; padding: 2px 7px; display: inline-flex; align-items: center; gap: 4px; }
.sp-live { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sp-on-live); background: var(--sp-live); border-radius: 6px; padding: 3px 7px; }
.sp-tbd { font-size: 11.5px; font-weight: 700; color: var(--sp-warn-ink); background: var(--sp-warn-bg); border-radius: 6px; padding: 3px 8px; }
.sp-save {
  width: 44px; height: 44px; margin: -10px -10px 0 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--sp-gold-ink) !important; flex-shrink: 0;
}
.sp-save:hover { background: var(--sp-soft) !important; }
.sp-card h3 { font-family: var(--sp-display); font-weight: 700; font-size: 23px; line-height: 1.15; color: var(--sp-ink); text-wrap: balance; }
.sp-mods { font-size: 13px; color: var(--sp-muted); line-height: 1.45; }
.sp-mods b { color: var(--sp-ink); font-weight: 700; }
.sp-talks { display: flex; flex-direction: column; border-top: 1px solid var(--sp-line); }
.sp-talk { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--sp-line); }
.sp-talk:last-child { border-bottom: 0; padding-bottom: 0; }
.sp-code { font-size: 12px; font-weight: 800; color: var(--sp-gold-ink); font-variant-numeric: tabular-nums; padding-top: 2px; }
.sp-talk p { font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--sp-ink); }
.sp-who { margin-top: 3px; font-size: 13px; color: var(--sp-muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sp-who b { color: var(--sp-ink); font-weight: 700; }
.sp-who em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--sp-warn-ink); background: var(--sp-warn-bg); border-radius: 5px; padding: 1px 6px; }

.sp-card.sp-minor { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.sp-minor-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--sp-tag); color: var(--sp-accent-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-minor-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-minor-body h3 { font-family: var(--sp-body); font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.sp-minor-body p { font-size: 13px; color: var(--sp-muted); }
.sp-minor .sp-save { margin: 0 -6px 0 0; }
.sp-card.sp-ceremonie { background: var(--sp-hero); border-color: var(--sp-hero); }
.sp-card.sp-ceremonie h3 { color: var(--sp-hero-ink); font-family: var(--sp-display); font-size: 22px; font-weight: 700; }
.sp-card.sp-ceremonie p { color: var(--sp-hero-muted); }
.sp-card.sp-ceremonie .sp-minor-ic { background: rgba(200,164,90,.18); color: var(--sp-gold); }
.sp-card.sp-ceremonie .sp-save { color: var(--sp-gold) !important; }
.sp-card.sp-ceremonie .sp-room { color: var(--sp-hero-muted); border-color: rgba(255,255,255,.2); }

.sp-break {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; background: var(--sp-soft);
  font-size: 13px; font-weight: 700; color: var(--sp-muted);
}
.sp-break svg { color: var(--sp-gold-ink); }

/* Speakers */
.sp-people { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 760px) { .sp-people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-person { background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sp-person-head { display: flex; gap: 12px; align-items: center; }
.sp-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--sp-accent); color: var(--sp-on-accent); display: flex; align-items: center; justify-content: center; font-family: var(--sp-display); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.sp-person-head h3 { font-size: 16px; font-weight: 800; line-height: 1.25; }
.sp-person-head p { font-size: 12.5px; color: var(--sp-muted); }
.sp-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-refs { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--sp-line); padding-top: 10px; }
.sp-ref { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.sp-ref small { font-weight: 800; color: var(--sp-accent-ink); font-variant-numeric: tabular-nums; line-height: 1.35; }
.sp-ref span { line-height: 1.4; }
.sp-ref span i { font-style: normal; color: var(--sp-muted); }
.sp-group-title { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-gold-ink); }

/* Agenda */
.sp-conflict { font-size: 12.5px; font-weight: 700; color: var(--sp-warn-ink); background: var(--sp-warn-bg); border-radius: 8px; padding: 6px 10px; }

.sp-empty { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sp-empty h2 { font-family: var(--sp-display); font-weight: 700; font-size: 26px; }
.sp-empty p { font-size: 14px; color: var(--sp-muted); max-width: 42ch; }
.sp-btn {
  height: 44px; padding: 0 18px; border-radius: 22px; background: var(--sp-accent) !important; color: var(--sp-on-accent) !important;
  font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px;
}

.sp-foot { padding: 18px 20px 28px; border-top: 1px solid var(--sp-line); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--sp-muted); }
@media (min-width: 860px) { .sp-foot { padding-left: 32px; padding-right: 32px; } }

@media (max-width: 520px) {
  .sp-slot { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sp-time { padding-top: 0; flex-direction: row; gap: 6px; align-items: baseline; }
  .sp-time small::before { content: "– "; }
  .sp-days { width: 100%; }
  .sp-days button { flex: 1; min-width: 0; }
  .sp-sep { display: none; }
  .sp-card h3 { font-size: 21px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sp-card, .sp-person { transition: border-color .15s ease, box-shadow .15s ease; }
}
