/* Agenda tables of the User Days pages: color rows by talk category. */

:root {
  --agenda-keynote: #f0a202;
  --agenda-team: #0cba52;
  --agenda-talk: #3f51b5;
  --agenda-lightning: #ef6c00;
  --agenda-break: var(--md-default-fg-color--lighter);
  --agenda-tint: 10%;
  /* Foreground color of the letter inside a filled marker. */
  --agenda-on-keynote: #2b1d00;
  --agenda-on-team: #ffffff;
  --agenda-on-talk: #ffffff;
  --agenda-on-lightning: #ffffff;
  --agenda-marker-size: 1.1rem;
}

[data-md-color-scheme="slate"] {
  --agenda-keynote: #ffc043;
  --agenda-team: #3ddc84;
  --agenda-talk: #8c9eff;
  --agenda-lightning: #ffa040;
  --agenda-tint: 18%;
  --agenda-on-keynote: #1a1200;
  --agenda-on-team: #00331a;
  --agenda-on-talk: #0d1240;
  --agenda-on-lightning: #2b1200;
}

/* Category marker: small circle with a letter (or an icon for breaks) before the title. */
.md-typeset em[class^="agenda-"]:not(.agenda-speaker):not(.agenda-break) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--agenda-marker-size);
  height: var(--agenda-marker-size);
  margin-right: 0.4rem;
  border-radius: 50%;
  font-style: normal;
  font-weight: 700;
  font-size: 0.6rem;
  line-height: 1;
  /* Centered on the text line; negative block margins keep the circle, taller than
     the line, from growing the line box and pushing it below the time. */
  vertical-align: middle;
  margin-block: -0.25rem;
  flex-shrink: 0;
}

.md-typeset .agenda-keynote   { background: var(--agenda-keynote);   color: var(--agenda-on-keynote); }
.md-typeset .agenda-team      { background: var(--agenda-team);      color: var(--agenda-on-team); }
.md-typeset .agenda-talk      { background: var(--agenda-talk);      color: var(--agenda-on-talk); }
.md-typeset .agenda-lightning { background: var(--agenda-lightning); color: var(--agenda-on-lightning); }
/* Break marker: bare icon, same footprint as a letter marker so labels align. */
.md-typeset .agenda-break {
  display: inline-block;
  width: var(--agenda-marker-size);
  margin-right: 0.4rem;
  text-align: center;
  font-style: normal;
}

/* Row tint + left border, keyed on the marker inside the row. */
.md-typeset table tr:has(.agenda-keynote)   { background: color-mix(in srgb, var(--agenda-keynote) var(--agenda-tint), transparent); }
.md-typeset table tr:has(.agenda-team)      { background: color-mix(in srgb, var(--agenda-team) var(--agenda-tint), transparent); }
.md-typeset table tr:has(.agenda-talk)      { background: color-mix(in srgb, var(--agenda-talk) var(--agenda-tint), transparent); }
.md-typeset table tr:has(.agenda-lightning) { background: color-mix(in srgb, var(--agenda-lightning) var(--agenda-tint), transparent); }
.md-typeset table tr:has(.agenda-break)     { background: transparent; }

.md-typeset table tr:has(.agenda-keynote)   > td:first-child { border-left: 3px solid var(--agenda-keynote); }
.md-typeset table tr:has(.agenda-team)      > td:first-child { border-left: 3px solid var(--agenda-team); }
.md-typeset table tr:has(.agenda-talk)      > td:first-child { border-left: 3px solid var(--agenda-talk); }
.md-typeset table tr:has(.agenda-lightning) > td:first-child { border-left: 3px solid var(--agenda-lightning); }
.md-typeset table tr:has(.agenda-break)     > td:first-child { border-left: 3px solid var(--agenda-break); }

/* Short cells: left-aligned, not justified (style.css justifies .md-content). */
.md-typeset table tr:has([class^="agenda-"]) td { text-align: left; }
.md-typeset table tr:has([class^="agenda-"]) td:first-child { white-space: nowrap; width: 1%; }

/* Full-width agenda table: Material renders tables (and its JS scroll wrapper)
   as inline-block sized to content. */
.md-typeset table:not([class]):has([class^="agenda-"]) {
  display: table;
  width: 100%;
}
.md-typeset .md-typeset__table:has([class^="agenda-"]) {
  display: block;
}

/* Break rows are dividers: compact and muted. */
.md-typeset table tr:has(.agenda-break) > td {
  padding-top: 0.4em;
  padding-bottom: 0.4em;
  color: var(--md-default-fg-color--light);
}

/* Placeholders (_TBA_) recede behind announced content. */
.md-typeset table tr:has([class^="agenda-"]) > td:last-child > em:not([class]) {
  color: var(--md-default-fg-color--light);
}

/* Speaker line under a talk title, aligned with the title rather than the marker. */
.md-typeset .agenda-speaker {
  display: block;
  margin-top: 0.15em;
  margin-left: calc(var(--agenda-marker-size) + 0.4rem + 0.25ch);
  font-style: normal;
  color: var(--md-default-fg-color--light);
}

/* Legend shown once above the agenda tabs: marker + label pairs. */
.md-typeset .agenda-legend { text-align: left; font-size: 0.7rem; }
.md-typeset .agenda-legend em[class^="agenda-"] { margin-right: 0.25rem; }
.md-typeset .agenda-legend span {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  white-space: nowrap;
}
.md-typeset .agenda-legend span em[class^="agenda-"] { vertical-align: 0; }
