/* calendar.css: a cohort's calendar page (calendar.js, at #/admin/cohort/<id>/calendar; task PS-03). There is no
   accepted page for the calendar, so it is drawn in the administration's form of the accepted admin-releases.html:
   the cohort's tab row above the tool band, then a part's box with its rows in three columns. It starts from PL-08's
   cut-down copy of that page's stylesheet (foundation/PL-08/redrawn/css/releases.css) under the page's own names
   (.cal-* for .rel-*), so that no file has two owners. The staff's states (.house-state), a row's small controls
   (.house-controls), the "Today" chip (.house-tile-chip.is-today), the tool band and the layout without a rail are
   house.css's; the fields of a form (.adm-form, .adm-field, .adm-choices, .adm-check, .adm-form-actions) are PS-04's
   admin.css's, as people.js's panels use them; the buttons and inputs are styles.css's. Every colour, type family,
   radius and shadow is a custom property of ../styles.css or house.css.

   For PL-07, what is here and not in house.css: the row list in three columns (.cal-key, .cal-part, .cal-row: the
   same part as releases.css's .rel-*, which two pages now draw), the notice above the list (.cal-notice), the lines
   under a row's name (.cal-lines, .cal-kind), and the panel that opens under a row (.cal-panel, .cal-form-head,
   .cal-preview, .cal-proposal). */

.cal-who { max-width: 44rem; margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-3); }

/* ---- The calendar's state, and the page's own action ---------------------------------------------------------- */
.cal-notice { max-width: 46rem; margin: 22px 0 0; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--ink); font-size: 15px; line-height: 1.5; }
.cal-notice > p { margin: 0; }
.cal-notice > .house-controls { margin-top: 12px; }
.cal-tools { margin: 22px 0 0; }

/* ---- The list: a part's box, a week's row, a session's row, a stop's row, an extra date's row ------------------ */
.cal-key { display: grid; grid-template-columns: minmax(0, 1fr) 14.5rem 21rem; column-gap: 20px; margin: 30px 0 0;
  padding: 0 17px 8px; font-size: 12px; font-weight: 750; letter-spacing: .13em; line-height: 1.4;
  text-transform: uppercase; color: var(--ink-3); }
.cal-key > :last-child { text-align: right; }
.cal-part { margin: 0 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); }
.cal-part.is-off { margin-top: 32px; border-style: dashed; background: none; }
.cal-part-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px;
  padding: 13px 16px; background: var(--surface-2); }
.cal-part.is-off .cal-part-head { background: none; }
.cal-part-head h2 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: -.008em;
  color: var(--ink); }
.cal-part-state { margin: 0 0 0 auto; font-size: 14px; color: var(--ink-2); }
.cal-part-head > .house-controls:empty { display: none; }
.cal-part-note { flex: 0 0 100%; margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cal-part-note > span { display: block; max-width: 46rem; }
.cal-list { margin: 0; padding: 0; list-style: none; }
.cal-list > li { margin: 0; }
.cal-row { display: grid; grid-template-columns: minmax(0, 1fr) 14.5rem 21rem; column-gap: 20px; row-gap: 6px;
  align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45;
  color: var(--ink-2); }
.cal-what, .cal-when { min-width: 0; }
.cal-name { display: block; font-weight: 650; color: var(--ink); }
.cal-kind { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-3); }
.cal-lines { display: grid; gap: 2px; margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--ink-3);
  font-variant-numeric: tabular-nums; }
.cal-date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; }
.cal-by { display: grid; gap: 1px; margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.cal-kind[hidden], .cal-lines[hidden], .cal-by[hidden] { display: none; }
.cal-row .house-controls { min-width: 0; }
.cal-row.is-week { background: var(--bg); }
.cal-row.is-week .cal-date { color: var(--ink-3); font-size: 13px; }
.cal-list.is-inside > li > .cal-row { padding-left: 38px; }
.cal-row.is-extra .cal-name { font-weight: 560; }
.cal-row.is-stop .cal-name { font-weight: 650; }

/* ---- The panel that opens under a row, or under the page's own action -------------------------------------------- */
.cal-panel { margin: 0; padding: 18px 22px 20px 38px; border-top: 1px solid var(--line); background: var(--bg); }
.cal-list.is-inside .cal-panel { padding-left: 60px; }
.cal-panel.is-alone { max-width: 46rem; margin: 16px 0 0; padding: 18px 22px 20px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); }
.cal-part-head + div > .cal-panel.is-alone { max-width: none; margin: 0; border-width: 1px 0 0; border-radius: 0; }
.cal-panel:focus { outline: none; }
.cal-panel h3 { margin: 0; font-size: 17px; line-height: 1.4; color: var(--ink); }
.cal-panel > p { max-width: 44rem; margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cal-form { margin-top: 14px; }
.cal-form + .cal-form { padding-top: 16px; border-top: 1px solid var(--line); }
.cal-form > p:not([class]) { grid-column: 1 / -1; max-width: 44rem; margin: 0; font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2); }
.cal-form-head { grid-column: 1 / -1; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.cal-preview { grid-column: 1 / -1; max-width: 44rem; margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.cal-preview:empty { display: none; }
.cal-form > .adm-check { grid-column: 1 / -1; }
.cal-form > .adm-check[hidden] { display: none; }
.cal-panel-foot { margin: 14px 0 0; }
.cal-proposal { margin: 16px 0 0; }
.cal-proposal[hidden] { display: none; }
.cal-proposal-list { columns: 2 16rem; column-gap: 28px; margin: 0; padding: 0 0 0 1.3em; font-size: 14.5px;
  line-height: 1.6; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-proposal > p { max-width: 44rem; margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cal-proposal > .adm-form-actions { margin-top: 14px; }

@media (max-width: 1100px) {
  .cal-key, .cal-row { grid-template-columns: minmax(0, 1fr) 13rem 12rem; column-gap: 16px; }
  .cal-key { letter-spacing: .08em; }
}
@media (max-width: 820px) {
  .cal-key { display: none; }
  .cal-part:first-of-type { margin-top: 26px; }
  /* One column: the name, then the date and hours, then the lines about the date, then the controls. */
  .cal-row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .cal-what { display: contents; }
  .cal-name { order: 1; }
  .cal-kind { order: 2; }
  .cal-when { order: 3; margin-top: 2px; }
  .cal-lines { order: 4; margin-top: 0; }
  .cal-row .house-controls { order: 5; justify-content: flex-start; margin-top: 6px; }
  .cal-row .house-controls:empty { display: none; }
  .cal-list.is-inside > li > .cal-row { padding-left: 28px; }
  .cal-panel, .cal-list.is-inside .cal-panel { padding-left: 16px; padding-right: 16px; }
  .cal-part-state { margin-left: 0; }
}
@media print {
  .cal-row .house-controls, .cal-tools, .cal-notice .house-controls, .cal-part-head .house-controls, .cal-panel { display: none; }
}
