/* ==========================================================
   TBB Agenda Grid - frontend styles.
   All custom properties are scoped to .tbb-agenda so this never
   leaks variables into the rest of the theme. Dark mode is a data
   attribute on the same root element, toggled by agenda.js.

   Shape language: intentionally squared-off (4-6px radii), solid
   flat colour blocks, monospace for time/data, and a stripe-left
   card treatment - kept deliberately distinct from soft
   pill/glassmorphism conference-site templates.
   ========================================================== */

.tbb-agenda {
  --tbb-gutter-w: 90px;
  --tbb-room-count: 5; /* overridden inline by agenda.js to match the real room count */
  --tbb-surface: #ffffff;
  --tbb-surface-2: #f4f5fa;
  --tbb-surface-3: #ffffff;
  --tbb-border: #e2e4ec;
  --tbb-border-strong: #cfd2df;
  --tbb-text: #12142b;
  --tbb-text-dim: #6a6d80;
  --tbb-navy: #102d4f;      /* real hero/nav background, sampled from trueblueblazing.com */
  --tbb-accent: #29b4e9;    /* real "Blue" wordmark colour */
  --tbb-accent-2: #6b2ee5;  /* real purple accent, sampled from the site */
  --tbb-brand-pink: #cc3366; /* real pink accent, sampled from the site */
  --tbb-brand-orange: #dd7a01; /* real "Get Tickets" button colour */
  --tbb-radius: 4px;
  --tbb-font-display: 'Montserrat', sans-serif; /* real heading font on trueblueblazing.com */
  --tbb-font-round: 'Varela Round', sans-serif; /* real button font on trueblueblazing.com */
  --tbb-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tbb-font-mono: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* alias kept so existing rules resolve; no longer an actual monospace */

  background: var(--tbb-surface-2);
  color: var(--tbb-text);
  font-family: var(--tbb-font-body);
  -webkit-font-smoothing: antialiased;
}

.tbb-agenda[data-theme="dark"] {
  /* Dark mode intentionally sits close to the real trueblueblazing.com
     navy (#102d4f) rather than a generic near-black, so it reads as an
     extension of the brand rather than a different app. */
  --tbb-surface: #102d4f;
  --tbb-surface-2: #163c66;
  --tbb-surface-3: #174271;
  --tbb-border: #2a5686;
  --tbb-border-strong: #3a6a9e;
  --tbb-text: #f1f4f9;
  --tbb-text-dim: #a9bdd6;
}

.tbb-agenda * { box-sizing: border-box; }
.tbb-agenda a { color: inherit; }
.tbb-agenda button { font-family: inherit; }

/* ============ HERO ============ */
.tbb-hero {
  position: relative;
  padding: 52px 24px 68px;
  background:
    linear-gradient(180deg, rgba(16,45,79,0.45) 0%, rgba(16,45,79,0.92) 100%),
    var(--tbb-hero-photo, none) center 30% / cover no-repeat,
    var(--tbb-navy);
  overflow: hidden;
  color: #ffffff;
}
.tbb-hero-inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.tbb-hero-logo { height: 34px; margin-bottom: 20px; display: block; }
.tbb-hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; z-index: 1; }
.tbb-hero-wave svg { width: 100%; height: 40px; display: block; }
.tbb-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tbb-brand-orange);
  color: #ffffff;
  font-family: var(--tbb-font-round);
  font-size: 12px; font-weight: 400; letter-spacing: 0.02em;
  padding: 5px 10px; border-radius: 5px; text-transform: uppercase;
  margin-bottom: 18px;
}
.tbb-hero h1 { font-family: var(--tbb-font-display); font-size: clamp(26px, 4vw, 40px); margin: 0 0 10px; font-weight: 700; letter-spacing: -0.01em; }
.tbb-hero-meta { display: flex; flex-wrap: wrap; gap: 18px; color: #dfe1f0; font-size: 14px; font-family: var(--tbb-font-body); }

/* ============ CONTROLS BAR ============ */
.tbb-controls {
  position: sticky; top: 0; z-index: 40;
  background: var(--tbb-surface);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--tbb-brand-orange), var(--tbb-brand-pink), var(--tbb-accent-2), var(--tbb-accent)) 1;
  border-bottom: 1px solid var(--tbb-border);
}
.tbb-controls-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between;
}
.tbb-controls-right { display: flex; align-items: center; gap: 10px; }
.tbb-day-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.tbb-pill-btn {
  border: 1px solid var(--tbb-border);
  background: var(--tbb-surface-2);
  color: var(--tbb-text-dim);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--tbb-font-mono);
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.tbb-pill-btn:hover { color: var(--tbb-text); }
.tbb-pill-btn.active { background: var(--tbb-accent); border-color: var(--tbb-accent); color: #fff; }

.tbb-view-toggle { display: flex; gap: 20px; border-bottom: 2px solid var(--tbb-border); }
.tbb-view-toggle button {
  border: none; background: transparent; color: var(--tbb-text-dim);
  padding: 8px 2px; margin-bottom: -2px; border-bottom: 2px solid transparent;
  border-radius: 0; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tbb-view-toggle button.active { color: var(--tbb-text); border-bottom-color: var(--tbb-accent-2); }

.tbb-theme-toggle {
  height: 34px; border-radius: 6px; padding: 0 12px;
  border: 1px solid var(--tbb-border-strong); background: var(--tbb-surface);
  color: var(--tbb-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  flex: none;
  font: inherit; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(10,12,30,0.06);
  transition: border-color .15s, background .15s;
}
.tbb-theme-toggle:hover { border-color: var(--tbb-accent); background: color-mix(in srgb, var(--tbb-accent) 8%, var(--tbb-surface)); }
.tbb-theme-toggle-icon { font-size: 15px; line-height: 1; }
.tbb-theme-toggle-icon::before { content: "\2600"; } /* sun - shown in light mode */
.tbb-agenda[data-theme="dark"] .tbb-theme-toggle-icon::before { content: "\1F319"; } /* moon - shown in dark mode */
.tbb-theme-toggle-label { white-space: nowrap; }

.tbb-track-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 24px 0; max-width: 1180px; margin: 0 auto; }
.tbb-track-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--tbb-border);
  border-left: 3px solid var(--tbb-chip-color, var(--tbb-border));
  background: var(--tbb-surface-2);
  color: var(--tbb-text-dim);
  padding: 6px 12px 6px 10px;
  border-radius: 4px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: opacity .15s, border-color .15s, color .15s, background .15s;
}
.tbb-track-chip .tbb-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tbb-track-chip.active { color: var(--tbb-text); background: color-mix(in srgb, var(--tbb-chip-color, var(--tbb-accent)) 12%, var(--tbb-surface)); }
.tbb-track-chip.dimmed { opacity: 0.4; }

.tbb-filter-row {
  max-width: 1180px; margin: 0 auto; padding: 10px 24px 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tbb-speaker-filter-label {
  font-size: 12.5px; font-weight: 700; color: var(--tbb-text-dim);
}
.tbb-speaker-filter {
  font: inherit; font-size: 13px; padding: 5px 10px; border-radius: var(--tbb-radius, 4px);
  border: 1px solid var(--tbb-border-strong); background: var(--tbb-surface); color: var(--tbb-text);
}
.tbb-reset-filters {
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 12px;
  border-radius: var(--tbb-radius, 4px); border: 1px solid var(--tbb-border-strong);
  background: transparent; color: var(--tbb-text-dim); cursor: pointer;
  transition: opacity .15s, color .15s, border-color .15s;
}
.tbb-reset-filters:hover:not(:disabled) { color: var(--tbb-text); border-color: var(--tbb-text-dim); }
.tbb-reset-filters:disabled { opacity: 0.4; cursor: default; }

.tbb-stats-row {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px 4px;
  display: flex; gap: 22px; flex-wrap: wrap;
  color: var(--tbb-text-dim); font-size: 13px; font-family: var(--tbb-font-mono);
}
.tbb-stats-row b { color: var(--tbb-text); font-weight: 700; }

/* ============ SCHEDULE GRID ============ */
.tbb-schedule-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 24px 60px; }

.tbb-grid-header {
  display: grid;
  grid-template-columns: var(--tbb-gutter-w) repeat(var(--tbb-room-count, 5), 1fr);
  position: sticky; top: 112px; z-index: 20;
  background: var(--tbb-surface-2);
  border-bottom: 1px solid var(--tbb-border);
}
.tbb-grid-header .tbb-corner { border-right: 1px solid var(--tbb-border); }
.tbb-room-head {
  padding: 10px 12px;
  border-right: 1px solid var(--tbb-border);
}
.tbb-room-head:last-child { border-right: none; }
.tbb-room-head .tbb-room-name { font-weight: 700; font-size: 13.5px; }
.tbb-room-head .tbb-room-cap { color: var(--tbb-text-dim); font-size: 11.5px; margin-top: 2px; }

.tbb-grid-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--tbb-gutter-w) repeat(var(--tbb-room-count, 5), 1fr);
  grid-template-rows: 1fr;
  background: var(--tbb-surface);
  border: 1px solid var(--tbb-border);
  border-top: none;
}

.tbb-time-col { grid-column: 1; grid-row: 1; position: relative; border-right: 1px solid var(--tbb-border); background: var(--tbb-surface-2); }
.tbb-time-label {
  position: absolute; left: 0; right: 8px; text-align: right;
  transform: translateY(-50%);
  font-size: 12px; color: var(--tbb-text-dim); font-family: var(--tbb-font-mono); font-variant-numeric: tabular-nums;
}

.tbb-rules-layer, .tbb-overlay-layer {
  grid-column: 2 / -1; grid-row: 1;
  position: relative;
  pointer-events: none;
}
.tbb-rule-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--tbb-border); }
.tbb-rule-line.hour { border-top-color: var(--tbb-border-strong); }

/* Marks a place where empty time was compressed out while a filter is
   active, so it reads as "time skipped" rather than the day just ending. */
.tbb-time-skip {
  position: absolute; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  height: 22px; margin-top: -11px;
  z-index: 5; pointer-events: none;
}
.tbb-time-skip::before, .tbb-time-skip::after {
  content: ""; flex: 1; border-top: 1px dashed var(--tbb-border-strong);
}
.tbb-time-skip span {
  padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--tbb-text-dim); background: var(--tbb-surface); white-space: nowrap;
}

.tbb-grid-empty {
  grid-column: 1 / -1; padding: 48px 24px; text-align: center;
  color: var(--tbb-text-dim); font-size: 14px;
}

.tbb-overlay-block {
  position: absolute; left: 0; right: 0;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.01em; font-size: 12.5px; font-family: var(--tbb-font-mono);
  text-transform: uppercase;
  pointer-events: auto;
  border: 1px solid transparent;
}
.tbb-overlay-block.welcome, .tbb-overlay-block.closing { background: color-mix(in srgb, var(--tbb-accent) 12%, var(--tbb-surface)); color: var(--tbb-accent); border-color: color-mix(in srgb, var(--tbb-accent) 30%, var(--tbb-border)); }
.tbb-overlay-block.lunch { background: color-mix(in srgb, var(--tbb-brand-pink) 12%, var(--tbb-surface)); color: color-mix(in srgb, var(--tbb-brand-pink) 75%, black); border-color: color-mix(in srgb, var(--tbb-brand-pink) 30%, var(--tbb-border)); }
.tbb-overlay-block.break { background: var(--tbb-surface-2); color: var(--tbb-text-dim); font-size: 11.5px; border-color: var(--tbb-border); }

.tbb-room-col { position: relative; border-right: 1px solid var(--tbb-border); }
.tbb-room-col:nth-child(6) { border-right: none; } /* time-col is child 1, so the 5th room-col is child 6 */

.tbb-session-card {
  position: absolute; left: 4px; right: 4px;
  border-radius: 4px;
  padding: 8px 9px 9px 9px;
  background: var(--tbb-surface);
  border: 1px solid var(--tbb-border);
  border-left: 4px solid var(--tbb-card-color, var(--tbb-accent));
  cursor: pointer;
  overflow: hidden;
  transition: opacity .15s, transform .1s, box-shadow .1s;
}
.tbb-session-card:hover { box-shadow: 0 4px 14px rgba(20,22,50,0.12); transform: translateY(-1px); }
.tbb-session-card.dimmed { opacity: 0.28; }
.tbb-session-card.favorited-hide { display: none; }

.tbb-card-eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  font-family: var(--tbb-font-mono);
  color: var(--tbb-card-color, var(--tbb-accent));
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.tbb-type-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--tbb-text) 8%, transparent); color: var(--tbb-text-dim);
  letter-spacing: 0.02em;
}
.tbb-card-title {
  font-size: 12.5px; font-weight: 700; line-height: 1.28;
  margin: 0 0 6px; color: var(--tbb-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tbb-card-time { font-size: 10px; color: var(--tbb-text-dim); margin-bottom: 4px; font-family: var(--tbb-font-mono); }

.tbb-card-speakers { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.tbb-avatar-stack { display: flex; }
.tbb-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--tbb-surface-2); border: 1.5px solid var(--tbb-surface);
  box-shadow: 0 0 0 1px var(--tbb-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: var(--tbb-text);
  margin-left: -6px;
}
.tbb-avatar:first-child { margin-left: 0; }
.tbb-speaker-names { font-size: 10.5px; color: var(--tbb-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--tbb-font-body); }

.tbb-speaker-link {
  /* Deliberately its own variable, not --tbb-accent - that one is the
     admin's "Primary accent" colour, which on this brand's palette
     defaults to a dark navy that's hard to read against the dark-mode
     surface. --tbb-speaker-link defaults to the actual light "Blue"
     wordmark colour and is separately configurable under Settings ->
     Appearance -> Speaker link colour. */
  color: var(--tbb-speaker-link, #29b4e9);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.tbb-speaker-link:hover, .tbb-speaker-link:focus { border-bottom-style: solid; }

.tbb-fav-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: color-mix(in srgb, var(--tbb-text) 6%, transparent);
  color: color-mix(in srgb, var(--tbb-text) 40%, transparent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; line-height: 1;
  z-index: 2;
}
.tbb-fav-btn.active { color: var(--tbb-brand-pink); background: color-mix(in srgb, var(--tbb-brand-pink) 14%, transparent); }

/* ============ MODAL ============ */
.tbb-modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,12,30,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.tbb-modal-backdrop.open { display: flex; }
.tbb-modal {
  background: var(--tbb-surface); border: 1px solid var(--tbb-border);
  border-top: 4px solid var(--tbb-brand-pink);
  border-radius: 6px; max-width: 480px; width: 100%;
  padding: 26px; position: relative;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(10,12,30,0.25);
}
.tbb-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--tbb-border); background: var(--tbb-surface-2);
  color: var(--tbb-text); cursor: pointer; font-size: 16px;
  padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.tbb-modal .tbb-card-eyebrow { font-size: 12px; margin-bottom: 8px; }
.tbb-modal h2 { margin: 0 0 10px; font-size: 21px; font-family: var(--tbb-font-display); }
.tbb-modal-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--tbb-text-dim); font-size: 13px; font-family: var(--tbb-font-mono); margin-bottom: 14px; }
.tbb-modal-desc { font-size: 14px; line-height: 1.6; color: color-mix(in srgb, var(--tbb-text) 85%, transparent); margin-bottom: 18px; }
.tbb-modal-speakers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.tbb-modal-speaker-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tbb-modal-speaker-row .tbb-avatar { width: 32px; height: 32px; font-size: 12px; margin-left: 0; }
.tbb-modal-fav {
  width: 100%; padding: 11px; border-radius: 4px; border: 1px solid var(--tbb-border);
  background: var(--tbb-surface-2); color: var(--tbb-text); font-weight: 700; cursor: pointer; font-size: 14px;
}
.tbb-modal-fav.active { background: color-mix(in srgb, var(--tbb-brand-pink) 12%, transparent); border-color: var(--tbb-brand-pink); color: var(--tbb-brand-pink); }

/* ============ MOBILE LIST VIEW ============ */
.tbb-mobile-group-toggle { display: none; align-items: center; gap: 6px; max-width: 640px; margin: 0 auto; padding: 10px 16px 0; flex-wrap: wrap; }
.tbb-mobile-group-label { font-size: 11.5px; color: var(--tbb-text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.tbb-mobile-group-toggle button {
  border: 1px solid var(--tbb-border); background: var(--tbb-surface-2); color: var(--tbb-text-dim);
  padding: 5px 12px; border-radius: 5px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.tbb-mobile-group-toggle button.active { background: var(--tbb-accent); border-color: var(--tbb-accent); color: #fff; }
.tbb-mobile-list { display: none; max-width: 640px; margin: 0 auto; padding: 8px 16px 60px; }
.tbb-mobile-time-group { margin-bottom: 22px; }
.tbb-mobile-time-heading {
  font-size: 12.5px; font-weight: 700; color: var(--tbb-text-dim);
  letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--tbb-font-mono);
  padding: 6px 0; border-bottom: 1px solid var(--tbb-border); margin-bottom: 10px;
  position: sticky; top: 96px; background: var(--tbb-surface-2); z-index: 5;
}
.tbb-mobile-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--tbb-surface);
  border: 1px solid var(--tbb-border);
  border-left: 4px solid var(--tbb-card-color, var(--tbb-accent));
  border-radius: 4px; padding: 12px; margin-bottom: 8px;
  position: relative; cursor: pointer;
}
.tbb-mobile-card .tbb-stripe { display: none; } /* border-left on .tbb-mobile-card now carries the track colour */
.tbb-mobile-card-body { flex: 1; min-width: 0; }
.tbb-mobile-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tbb-mobile-card .tbb-card-title { -webkit-line-clamp: 2; margin-bottom: 4px; }
.tbb-mobile-sub { font-size: 12px; color: var(--tbb-text-dim); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tbb-mobile-list .tbb-fav-btn { position: static; background: transparent; color: color-mix(in srgb, var(--tbb-text) 30%, transparent); flex: none; }
.tbb-mobile-list .tbb-fav-btn.active { color: var(--tbb-brand-pink); background: transparent; }
.tbb-mobile-empty { color: var(--tbb-text-dim); font-size: 14px; text-align: center; padding: 40px 0; }

@media (max-width: 900px) {
  .tbb-schedule-wrap { display: none; }
  .tbb-mobile-group-toggle { display: flex; }
  .tbb-mobile-list { display: block; }
  .tbb-grid-header { display: none; }
  .tbb-controls-inner { padding: 12px 16px; }
  .tbb-track-filters { padding: 10px 16px 0; }
  .tbb-filter-row { padding: 8px 16px 0; }
  .tbb-stats-row { padding: 10px 16px 2px; }
}
