/* The meetings of a case and the sheet that finds a time for one (MeetingsPanelComponent, FindATimeComponent, CalendarConnectionComponent; packs/scheduling). The panel is a list: each meeting its
   kind and any state in words, its day and time, who hosts it, where, the calendar's note, and a disclosure that holds the form that cancels it; the button that finds a time under the list. The sheet
   lays the free times out by day, each a choice in a group; the page that connects a calendar is a few lines and two buttons.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell and the console, in light and in dark, and
   mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and everything that holds words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10). */

.meetings-panel {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.meetings-panel__empty,
.meetings-panel__kind,
.meetings-panel__when,
.meetings-panel__who,
.meetings-panel__where,
.meetings-panel__calendar {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.meetings-panel__empty,
.meetings-panel__who,
.meetings-panel__where,
.meetings-panel__calendar {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.meetings-panel__list {
  display: grid;
  gap: var(--density-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.meetings-panel__item {
  display: grid;
  gap: var(--space-1);
  padding-block-end: var(--density-gap);
  border-block-end: 1px solid var(--rule);
  min-inline-size: 0;
}

.meetings-panel__item:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.meetings-panel__item[data-state="canceled"] .meetings-panel__when {
  text-decoration: line-through;
}

.meetings-panel__kind {
  font-weight: 650;
}

.meetings-panel__cancel > summary {
  color: var(--accent-text);
  cursor: pointer;
  font-size: var(--text-sm);
  min-block-size: 1.5rem;
}

.meetings-panel__cancel-form {
  display: grid;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
  justify-items: start;
}

.meetings-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The sheet that finds a time: one form, as board 8 draws it (who comes, the free times as buttons, how long it is, the button that books). Conduct's invitation sheet draws its times with the
   plain `.find-a-time__slot` rules; the buttons of this sheet are `.find-a-time__slot--button`. */
.find-a-time {
  display: grid;
  gap: var(--density-block);
  min-inline-size: 0;
}

.find-a-time__days {
  display: grid;
  gap: var(--density-gap);
}

.find-a-time__day {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.find-a-time__day > legend {
  margin-block-end: var(--space-2);
  padding: 0;
  font-weight: 650;
}

.find-a-time__slots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.find-a-time__slot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--target-min);
  padding-inline: var(--space-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
}

.find-a-time__slot:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.find-a-time__slot:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The people always asked (the host, or the person it is about): a ticked box that cannot change, one under another. */
.find-a-time__fixed {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.find-a-time__fixed .field-option {
  cursor: default;
}

.find-a-time__fixed .field-option:hover {
  border-color: var(--accent);
}

/* The person a meeting is about, not invited unless ticked: drawn apart, inside a dashed edge, so it is not read as one of those asked. (`.field` sets its own padding and edge after this sheet.) */
.find-a-time__about.field {
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-md);
}

/* "Add someone else": the people offered at a tap, the Directory search and the members of staff it found, under who comes. */
.find-a-time__add {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.find-a-time__add > legend {
  padding: 0;
  margin-block-end: var(--space-2);
}

/* "Find times for these people", under who comes: after a box is ticked, the times are found again. */
.find-a-time__again {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* "Offer times to (name)" beside the times, and the note that says nothing is booked while they are offered: a button with the sentence that explains it. */
.find-a-time__offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

/* The first six free times, each a button: a radio the label wraps, drawn as a button, whole-label target, the radio itself kept for the keyboard and the screen reader. A time chosen is told by its
   fill and a thicker edge, not by color alone. */
.find-a-time__times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-2);
  min-inline-size: 0;
}

.find-a-time__slot--button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0;
  padding-block: var(--space-2);
  text-align: center;
  min-inline-size: 0;
}

.find-a-time__slot--button > input {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.find-a-time__slot--button:has(input:checked) {
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 650;
}

.find-a-time__slot-day {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.find-a-time__slot--button:has(input:checked) .find-a-time__slot-day {
  color: var(--fg1);
}

/* "More times": the rest, by day, and the day to look from. */
.find-a-time__more {
  display: grid;
  min-inline-size: 0;
}

.find-a-time__more > summary {
  display: list-item;
  list-style-position: inside;
  padding-block: var(--space-3);
  color: var(--accent-text);
  cursor: pointer;
}

.find-a-time__more > summary > .find-a-time__note {
  margin-inline-start: var(--space-2);
}

.find-a-time__more > .find-a-time__day {
  margin-block-end: var(--space-3);
}

.find-a-time__look {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
}

/* How long it is, with how it is held beside it where the person says. */
.find-a-time__length {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-inline-size: 0;
}

.find-a-time__none,
.find-a-time__note {
  margin-block: 0;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

/* The Calendar section of a member of staff's own settings page: their Google Calendar connection. */
.calendar-connection {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.calendar-connection p {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.calendar-connection__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
