/* CTC Event Schedule — display.
   Layout idea: rooms run across, the day runs down; whole-group events span every room.
   Phones get a stacked timeline. Everything is scoped to .ctc-es so the theme is left alone. */

.ctc-es {
  --es-bg: #f3f5f4;
  --es-surface: #ffffff;
  --es-ink: #18222d;
  --es-muted: #5a6572;
  --es-line: #d9dfe2;
  --es-accent: #1d5b86;
  --es-now: #c8322b;

  --es-session-bg: #fdf1d8;  --es-session-bd: #c98a12;
  --es-plenary-bg: #e2ecf6;  --es-plenary-bd: #1d5b86;
  --es-meal-bg: #e5f0e4;     --es-meal-bd: #4a8a4e;
  --es-optional-bg: #efecf7; --es-optional-bd: #7466a6;
  --es-group-bg: #fae8e4;    --es-group-bd: #bf5d48;
  --es-break-bg: #eef1f2;    --es-break-bd: #8a959f;

  --es-font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;

  background: var(--es-bg);
  color: var(--es-ink);
  font-family: var(--es-font);
  font-size: 16px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  color-scheme: light;
}
.ctc-es *, .ctc-es *::before, .ctc-es *::after { box-sizing: border-box; }
.ctc-es h1, .ctc-es h2, .ctc-es h3, .ctc-es p, .ctc-es ol, .ctc-es li {
  margin: 0; padding: 0; color: inherit; font-family: var(--es-font);
  letter-spacing: normal; text-transform: none; background: none; border: 0;
}
.ctc-es ol, .ctc-es li { list-style: none; }
.ctc-es li::before, .ctc-es li::marker { content: none; }
.ctc-es button {
  font: inherit; font-size: 14px; color: var(--es-ink); background: var(--es-surface);
  border: 1px solid var(--es-line); border-radius: 8px; padding: 7px 12px; margin: 0;
  cursor: pointer; line-height: 1.2; text-transform: none; letter-spacing: normal;
  box-shadow: none; width: auto; min-height: 0; height: auto; text-decoration: none;
}
.ctc-es button:hover { background: var(--es-bg); }
.ctc-es :focus-visible { outline: 3px solid var(--es-accent); outline-offset: 2px; }

/* Full-page projector mode and browser full screen */
body.ctc-es-page { margin: 0; background: #f3f5f4; }
.ctc-es[data-mode="display"] { border-radius: 0; min-height: 100vh; }
.ctc-es:fullscreen { border-radius: 0; overflow: auto; }
.ctc-es.is-fs .ctc-es-controls, .ctc-es.is-fs .ctc-es-foot { display: none; }
.ctc-es-notice { font-family: var(--es-font, sans-serif); padding: 16px; }

/* ---------- Header ---------- */
.ctc-es-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 14px clamp(16px, 2vw, 32px); border-bottom: 1px solid var(--es-line); background: var(--es-surface);
}
.ctc-es-brand { flex: 1 1 320px; min-width: 0; }
.ctc-es .ctc-es-brand h1 { font-weight: 700; font-size: clamp(20px, 1.8vw, 34px); line-height: 1.1; text-wrap: balance; }
.ctc-es .ctc-es-brand p { margin-top: 2px; color: var(--es-muted); font-size: clamp(13px, 0.9vw, 17px); }
.ctc-es-clock { text-align: right; }
.ctc-es-clock .t { font-weight: 700; font-size: clamp(22px, 2vw, 40px); line-height: 1; }
.ctc-es-clock .d { color: var(--es-muted); font-size: 13px; }
.ctc-es-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctc-es-seg { display: inline-flex; border: 1px solid var(--es-line); border-radius: 8px; overflow: hidden; }
.ctc-es .ctc-es-seg button { border: 0; border-radius: 0; background: transparent; }
.ctc-es .ctc-es-seg button + button { border-left: 1px solid var(--es-line); }
.ctc-es .ctc-es-seg button[aria-pressed="true"] { background: var(--es-accent); color: #fff; font-weight: 700; }

.ctc-es-days { display: flex; gap: 6px; padding: 10px clamp(16px, 2vw, 32px); overflow-x: auto; border-bottom: 1px solid var(--es-line); }
.ctc-es .ctc-es-days button { flex: 0 0 auto; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.ctc-es .ctc-es-days button[aria-pressed="true"] { border-color: var(--es-accent); box-shadow: inset 0 0 0 1px var(--es-accent); font-weight: 700; }
.ctc-es-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--es-now); margin-left: 6px; vertical-align: middle; }
.ctc-es-dayhead { padding: 12px clamp(16px, 2vw, 32px) 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ctc-es .ctc-es-dayhead h2 { font-size: clamp(18px, 1.5vw, 28px); font-weight: 700; line-height: 1.2; }
.ctc-es-dayhead span { color: var(--es-muted); }
.ctc-es-main { padding: 0 clamp(16px, 2vw, 32px) 24px; }

/* ---------- Kinds ---------- */
.ctc-es .k-session  { --k-bg: var(--es-session-bg);  --k-bd: var(--es-session-bd); }
.ctc-es .k-plenary  { --k-bg: var(--es-plenary-bg);  --k-bd: var(--es-plenary-bd); }
.ctc-es .k-meal     { --k-bg: var(--es-meal-bg);     --k-bd: var(--es-meal-bd); }
.ctc-es .k-optional { --k-bg: var(--es-optional-bg); --k-bd: var(--es-optional-bd); }
.ctc-es .k-group    { --k-bg: var(--es-group-bg);    --k-bd: var(--es-group-bd); }
.ctc-es .k-break    { --k-bg: var(--es-break-bg);    --k-bd: var(--es-break-bd); }

/* ---------- Grid ---------- */
.ctc-es-gridwrap { margin-top: 12px; overflow-x: auto; }
.ctc-es-ghead, .ctc-es-gbody { display: grid; grid-template-columns: 74px repeat(var(--cols), minmax(150px, 1fr)); column-gap: 6px; }
.ctc-es-ghead { padding-bottom: 6px; }
.ctc-es-ghead div { font-weight: 700; font-size: clamp(14px, 1vw, 20px); padding: 6px 8px; border-bottom: 3px solid var(--es-line); }
.ctc-es-ghead div.tba { color: var(--es-muted); }
.ctc-es-ghead small { display: block; font-weight: 400; color: var(--es-muted); font-size: 12px; }
.ctc-es-gbody { position: relative; grid-template-rows: repeat(var(--slots), var(--slot, 18px)); }
.ctc-es-gline { grid-column: 1 / -1; border-top: 1px solid var(--es-line); pointer-events: none; }
.ctc-es-gline.half { border-top-style: dotted; opacity: .7; }
.ctc-es-glabel { grid-column: 1; font-size: clamp(11px, 0.75vw, 15px); color: var(--es-muted); transform: translateY(-0.6em); padding-right: 6px; text-align: right; white-space: nowrap; z-index: 1; }
.ctc-es-glabel.hour { color: var(--es-ink); font-weight: 700; }
.ctc-es-glabel.first { transform: none; }
.ctc-es-ev {
  position: relative; z-index: 2; margin: 2px 0; border-radius: 6px; overflow: hidden;
  background: var(--k-bg); border-left: 5px solid var(--k-bd);
  padding: 4px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 0;
  font-size: clamp(12px, 0.82vw, 18px);
}
.ctc-es-ev.k-optional { border-left-style: dashed; }
.ctc-es-ev.span { flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px 14px; flex-wrap: wrap; }
.ctc-es-ev .ttl { font-weight: 700; font-size: 1.08em; line-height: 1.15; }
.ctc-es-ev .ttl span { font-weight: 400; }
.ctc-es-ev .tm { color: var(--es-muted); font-size: .9em; white-space: nowrap; font-weight: 400; }
.ctc-es-ev .loc, .ctc-es-ev .note { font-size: .9em; }
.ctc-es-ev .note { color: var(--es-muted); }
.ctc-es-ev .who { font-weight: 700; font-size: 1.05em; }
.ctc-es-ev .topic { font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ctc-es-ev .room { font-size: .85em; color: var(--es-muted); }
.ctc-es-ev.tiny { padding-top: 0; padding-bottom: 0; margin: 1px 0; font-size: clamp(10px, 0.7vw, 15px); line-height: 1; }
.ctc-es-ev.tiny .ttl { font-size: 1em; }
.ctc-es-ev.is-now { box-shadow: 0 0 0 2px var(--es-now); }
.ctc-es-nowline { position: absolute; left: 68px; right: 0; height: 0; border-top: 2px solid var(--es-now); z-index: 4; pointer-events: none; opacity: .85; }
.ctc-es-nowline::before { content: attr(data-t); position: absolute; left: -68px; top: -0.75em; background: var(--es-now); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }

/* ---------- Now & next ---------- */
.ctc-es-nn { display: grid; gap: clamp(14px, 2vh, 28px); padding-top: clamp(14px, 2vh, 28px); }
.ctc-es .ctc-es-nnlabel { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: clamp(14px, 1.1vw, 22px); color: var(--es-muted); margin-bottom: 8px; }
.ctc-es .ctc-es-nnlabel.live { color: var(--es-now); }
.ctc-es-nncard { background: var(--k-bg); border-left: 8px solid var(--k-bd); border-radius: 10px; padding: clamp(14px, 1.6vw, 28px); }
.ctc-es .ctc-es-nncard h3 { font-size: clamp(26px, 3vw, 60px); line-height: 1.05; font-weight: 700; text-wrap: balance; }
.ctc-es .ctc-es-nncard h3 span { font-weight: 400; color: var(--es-muted); }
.ctc-es-nnnext .ctc-es-nncard h3 { font-size: clamp(22px, 2.2vw, 44px); }
.ctc-es-nnmeta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; font-size: clamp(16px, 1.4vw, 28px); }
.ctc-es-nnmeta .tm { font-weight: 700; }
.ctc-es-nnmeta .left { color: var(--es-muted); }
.ctc-es-offers { display: grid; gap: 12px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ctc-es-offer { background: var(--es-surface); border-radius: 8px; padding: 12px 14px; border: 1px solid var(--es-line); }
.ctc-es-offer .who { font-weight: 700; font-size: clamp(16px, 1.3vw, 26px); }
.ctc-es-offer .topic { font-weight: 700; margin-top: 4px; font-size: clamp(15px, 1.05vw, 21px); line-height: 1.2; }
.ctc-es-offer .desc { color: var(--es-muted); margin-top: 2px; font-size: clamp(14px, 0.9vw, 18px); }
.ctc-es-offer .room { margin-top: 8px; font-size: clamp(14px, 1vw, 19px); }
.ctc-es-offer .room b { color: var(--es-accent); }
.ctc-es .ctc-es-empty { color: var(--es-muted); font-size: clamp(18px, 1.6vw, 30px); }

/* ---------- List ---------- */
.ctc-es .ctc-es-list { margin-top: 12px; display: grid; gap: 10px; max-width: 760px; }
.ctc-es .ctc-es-li { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: start; }
.ctc-es-li .when { font-weight: 700; padding-top: 10px; font-size: 15px; }
.ctc-es-li .when small { display: block; font-weight: 400; color: var(--es-muted); }
.ctc-es-li .card { background: var(--k-bg); border-left: 5px solid var(--k-bd); border-radius: 8px; padding: 10px 12px; }
.ctc-es-li.k-optional .card { border-left-style: dashed; }
.ctc-es .ctc-es-li .card h3 { font-size: 17px; line-height: 1.2; font-weight: 700; }
.ctc-es-li .card .sub { color: var(--es-muted); font-size: 14px; margin-top: 2px; }
.ctc-es-li .card .loc { font-size: 14px; margin-top: 4px; }
.ctc-es-li .ctc-es-offers { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.ctc-es-li .ctc-es-offer { padding: 10px 12px; }
.ctc-es-li .ctc-es-offer .who { font-size: 16px; }
.ctc-es-li .ctc-es-offer .topic { font-size: 15px; }
.ctc-es-li .ctc-es-offer .desc, .ctc-es-li .ctc-es-offer .room { font-size: 14px; }
.ctc-es-li.is-now .card { box-shadow: 0 0 0 2px var(--es-now); }
.ctc-es-li.past { opacity: .55; }
.ctc-es-pill { display: inline-block; background: var(--es-now); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Footer ---------- */
.ctc-es-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 14px clamp(16px, 2vw, 32px) 20px; color: var(--es-muted); font-size: 13px; border-top: 1px solid var(--es-line); }
.ctc-es-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ctc-es-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--k-bg); border-left: 4px solid var(--k-bd); }

/* Narrow containers (phones, or a narrow theme column) */
.ctc-es.is-narrow .ctc-es-seg button[data-view="grid"],
.ctc-es.is-narrow .ctc-es-fsbtn { display: none; }
.ctc-es.is-narrow .ctc-es-clock { text-align: left; }
.ctc-es.is-narrow .ctc-es-li { grid-template-columns: 70px 1fr; }
