/* The Classes section of the person page (ClassesPanelComponent in app/components; docs/data_model/13-operational-domains.md section 16.12, docs/phase0_core/06-app-layer.md section 7b), built
   from the table, the badge, the callout and the empty state, so what is here is only how they sit together: a heading, how old the data is, a warning when it is older than it should be, and for each
   term the week at a glance (a table), the classes by weekday (a table under each day's heading) and every class (a table).

   Linked after the device rules (40-native.css), like 46-sources.css and 47-housing-panel.css, which is why it is numbered 50 and not among the components' 35 to 39: nothing here needs to come before
   them, because every rule is more specific than the one it adjusts. Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so all of it reads
   on the light shell and on the console, in light and in dark, and mirrors in a right-to-left language. It decides no mode and no surface. Nothing is pinned to an edge and nothing sets a height in vh.

   Everything that holds words may shrink (`min-inline-size: 0`) and breaks a word that has no room (`overflow-wrap`), so a long course, a long title or a language 40% longer never widens the page
   (WCAG 1.4.10). A status is its words, in a badge whose tone is a second signal and never the only one; a class in the week is its words in a chip with a border, never a color alone (WCAG 1.4.1). Each
   table scrolls inside its own named region, which is focusable, and is the one place on the page that may be wider than a phone. */

.classes-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--density-gap);
  max-inline-size: 72rem;
  min-inline-size: 0;
}
.classes-term,
.classes-part,
.classes-day {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}
.classes-term {
  padding-block-start: var(--density-gap);
  border-block-start: 1px solid var(--rule);
}
.classes-term-heading,
.classes-subheading,
.classes-day-heading {
  margin: 0;
  overflow-wrap: anywhere;
}
.classes-term-heading {
  font-size: var(--text-lg);
}
.classes-day-heading {
  font-size: var(--text-md);
}

/* How old it is, and what a cell or a line is: the muted small text the facts' provenance is in. */
.classes-freshness,
.classes-note {
  min-inline-size: 0;
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.classes-stale {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.classes-provenance,
.classes-unknown,
.classes-chip-status {
  display: block;
  min-inline-size: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* A cell that says two things says them on two lines, so a column of times and a column of courses read down. */
.classes-line,
.classes-title {
  display: block;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.classes-code {
  white-space: nowrap;
}
.classes-title {
  color: var(--fg2);
}

/* A class in the week: its code and section in a box with an edge, one under another when two meet at once. A border, never a fill alone. */
.classes-chip {
  display: block;
  min-inline-size: 0;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--fg1);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.classes-chip .identifier {
  white-space: nowrap;
}
.classes-chip + .classes-chip {
  margin-block-start: 0.25rem;
}
.classes-grid td:not(:first-child) {
  min-inline-size: 7rem;
}
/* Under a weekday the course cell holds a title and where the line came from, and the status cell the code and what is true of it: each keeps a width its words can wrap in, so a wide status never squeezes
   the course to a piece of a word at a time. The table scrolls inside its own region where there is not room, which is the one place that may be wider than a phone. */
.classes-day td:nth-child(2) {
  min-inline-size: 10rem;
}
.classes-day td:last-child {
  min-inline-size: 8rem;
}

.classes-panel .pill {
  max-inline-size: 100%;
}
/* A badge in a table cell does not wrap, because its word is its whole cell (37-table-and-empty-state.css). The badges here are sentences ("PeopleSoft Campus Solutions no longer returns this section"), so
   they wrap at spaces like any other line of the cell, and a long one does not make its column, and the table, wider than the screen. */
.classes-panel table.data.data-table td .pill {
  white-space: normal;
  overflow-wrap: break-word;
}
.classes-panel .pill + .classes-line,
.classes-panel .classes-line + .pill {
  margin-block-start: 0.15rem;
}
