/* ==========================================================
   IEEE ISICAS 2026 — Technical Program (dynamic, from program.json)
   All rules are scoped under .isp so they cannot clash with style.css.
   Colours of the sessions come from the Excel file (program.json).
   ========================================================== */
.isp {
  --isp-ink: var(--ink, #1f2937);
  --isp-muted: var(--muted, #667085);
  --isp-blue: var(--ieee-blue, #003f7d);
  --isp-blue-dark: var(--ieee-blue-dark, #08245c);
  --isp-blue-deep: var(--ieee-blue-deep, #06193f);
  --isp-blue-soft: var(--ieee-blue-soft, #eaf3ff);
  --isp-gold: var(--gold, #c99a2e);
  --isp-gold-light: var(--gold-light, #f4d37a);
  --isp-border: var(--border, #d8e0ea);
  --isp-line: rgba(0, 0, 0, 0.16);
  --isp-time-w: 96px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--isp-ink);
  line-height: 1.35;
}
.isp *, .isp *::before, .isp *::after { box-sizing: border-box; }

/* Full-width container: the grid needs more room than .content-layout */
.isp-wrap {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- toolbar ---------- */
.isp-toolbar {
  position: sticky;
  top: 86px; /* height of the sticky .site-header */
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--isp-border);
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 40, 90, 0.06);
  backdrop-filter: blur(6px);
}
.isp-daylinks { display: flex; flex-wrap: wrap; gap: 8px; }
.isp-daylinks a {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--isp-blue-dark);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}
.isp-daylinks a:hover, .isp-daylinks a:focus-visible { background: var(--isp-gold); color: var(--isp-blue-deep); }
.isp-search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.isp-search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.95rem;
  padding: 9px 14px;
  border: 1px solid var(--isp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--isp-ink);
}
.isp-search input:focus { outline: 2px solid var(--isp-gold); outline-offset: 1px; border-color: var(--isp-gold); }
.isp-count { font-size: 0.85rem; color: var(--isp-muted); white-space: nowrap; }

/* ---------- day ---------- */
.isp-day { margin-bottom: 44px; scroll-margin-top: 170px; }
.isp-day-title {
  margin: 0 0 14px;
  padding: 14px 20px;
  background: var(--isp-blue-dark);
  color: #fff;
  border-left: 6px solid var(--isp-gold);
  border-radius: 14px;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.isp-grid {
  background: #fff;
  border: 1px solid var(--isp-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 40, 90, 0.06);
}
.isp-row {
  display: grid;
  grid-template-columns: var(--isp-time-w) repeat(var(--isp-rooms, 4), minmax(0, 1fr));
  border-top: 1px solid var(--isp-border);
}
.isp-row:first-child { border-top: 0; }

/* room header row (Excel row 1: "ROOM R1B") */
.isp-rooms { background: #fff; }
.isp-rooms > div {
  padding: 10px 8px;
  text-align: center;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
}

/* time column */
.isp-time {
  padding: 10px 8px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #000;
  background: #fff;
  border-right: 1px solid var(--isp-border);
  white-space: nowrap;
}
.isp-time b { display: block; font-weight: 400; }

/* ---------- breaks (COFFEE BREAK / LUNCH / PLENARY) ---------- */
.isp-break .isp-band {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  padding: 8px 10px;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  background: #fff;
}
.isp-plenary .isp-band { background: var(--isp-blue-soft); color: var(--isp-blue-dark); font-weight: 700; }

/* ---------- sessions ---------- */
.isp-cell {
  min-width: 0;
  border-left: 1px solid var(--isp-line);
  background: var(--isp-c, #fff);
}
.isp-cell:nth-child(2) { border-left: 0; }
.isp-cell.isp-empty { background: repeating-linear-gradient(135deg, #fafbfd 0 8px, #f2f5f9 8px 16px); }
.isp-session { height: 100%; scroll-margin-top: 170px; }
.isp-session-head {
  padding: 6px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  color: #000;
  border-bottom: 1px solid var(--isp-line);
}
.isp-session-head .isp-room-tag { display: none; }
.isp-session-head .isp-sid { white-space: nowrap; }
.isp-papers { list-style: none; margin: 0; padding: 0; }
.isp-paper {
  padding: 7px 9px 8px;
  border-top: 1px solid var(--isp-line);
}
.isp-paper:first-child { border-top: 0; }
.isp-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  line-height: 1.3;
  margin-bottom: 2px;
}
.isp-id { color: #000; font-variant-numeric: tabular-nums; white-space: nowrap; }
.isp-xplore {
  color: #0563c1;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.isp-xplore:hover { color: var(--isp-blue-deep); text-decoration-thickness: 2px; }
.isp-title { font-size: 0.86rem; line-height: 1.3; color: #000; margin: 0; font-weight: 400; }
.isp-authors { font-size: 0.7rem; line-height: 1.3; color: #333; margin-top: 3px; }
.isp-abs { margin-top: 3px; font-size: 0.72rem; }
.isp-abs summary {
  cursor: pointer;
  color: var(--isp-blue);
  font-weight: 700;
  list-style: none;
  display: inline-block;
}
.isp-abs summary::-webkit-details-marker { display: none; }
.isp-abs summary::before { content: "+ "; }
.isp-abs[open] summary::before { content: "– "; }
.isp-abs p {
  margin-top: 4px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  color: #222;
  line-height: 1.45;
}

/* dark session fills (e.g. #BF9000): keep text readable */
.isp-dark .isp-xplore { color: #06193f; }
.isp-dark .isp-authors { color: #1a1a1a; }
.isp-dark .isp-abs summary { color: #06193f; }

/* ---------- search state ---------- */
.isp-searching .isp-break { display: none; }
.isp-searching .isp-paper.isp-hide { display: none; }
.isp-searching .isp-cell.isp-nomatch { opacity: 0.35; }
.isp-searching .isp-row.isp-nomatch { display: none; }
.isp-searching .isp-day.isp-nomatch { display: none; }
.isp mark { background: var(--isp-gold-light); color: inherit; padding: 0 1px; border-radius: 2px; }

.isp-note { margin-top: 10px; font-size: 0.8rem; color: var(--isp-muted); }
.isp-error {
  padding: 18px 20px;
  background: #fff8e6;
  border: 1px solid #f1d48c;
  border-left: 5px solid var(--isp-gold);
  border-radius: 14px;
  color: var(--isp-blue-dark);
}

/* ---------- tablet / phone: one session per line ---------- */
@media (max-width: 900px) {
  .isp-wrap { width: calc(100% - 22px); }
  .isp-toolbar { top: 70px; }
  .isp-rooms { display: none; }
  .isp-row { grid-template-columns: 1fr; }
  .isp-time {
    border-right: 0;
    border-bottom: 1px solid var(--isp-border);
    background: var(--isp-blue-soft);
    color: var(--isp-blue-dark);
    font-weight: 800;
    font-size: 0.9rem;
  }
  .isp-time b { display: inline; font-weight: 800; }
  .isp-time b + b::before { content: " – "; }
  .isp-break { grid-template-columns: var(--isp-time-w) 1fr; }
  .isp-break .isp-time { border-bottom: 0; background: #fff; color: #000; font-weight: 400; }
  .isp-break .isp-band { grid-column: 2; justify-content: flex-start; font-size: 1rem; }
  .isp-break .isp-band span + span { display: none; }
  .isp-cell { border-left: 0; border-top: 1px solid var(--isp-line); }
  .isp-cell.isp-empty { display: none; }
  .isp-session-head { text-align: left; }
  .isp-session-head .isp-room-tag {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 800;
    vertical-align: 1px;
  }
}

@media print {
  .isp-toolbar { display: none; }
  .isp-wrap { width: 100%; }
  .isp-grid { box-shadow: none; }
  .isp-day { break-before: page; }
  .isp-day:first-of-type { break-before: auto; }
  .isp-abs { display: none; }
  .isp-cell, .isp-row { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Guidance directly above the program search toolbar */
.isp-search-instructions { margin: 0 0 12px; color: var(--isp-ink); font-size: 1rem; line-height: 1.5; }
