/* session.css: the session page (session.js), a day's or a session's page, as the accepted look draws it
   (look-accepted/day-7.html and week-6-day-3.html). It starts from PL-08's cut-down copy of the preview's session.css
   (foundation/PL-08/redrawn/css/session.css). The band above the layout, "Expand this page" (.house-layout.is-expanded),
   a region drawn as a card (.house-region), the labelled rows (.house-labelled), the activity cards
   (.house-card.is-activity in .house-cards.is-2), the day's periods (.house-rows.is-periods), the pager (.house-pager)
   and the strip's key (.house-strip-seg.is-key) are in house.css. Every colour, type family, radius and shadow is a
   custom property of ../styles.css or house.css. */

/* Below 901 px the rail is a closed box above the page, so there is nothing to expand. */
@media (max-width: 900px) { .session-expand { display: none; } }

/* ---- A day that is not open yet: the band and one sentence ---------------------------------------------------------- */

.session-state { margin-top: 0; }
/* With nothing to list, the page's one sentence stands at the frame's left edge under the band, not beside an empty
   rail. */
.house-layout.is-state { grid-template-columns: minmax(0, 1fr); }
.house-layout.is-state > .house-rail { display: none; }
.house-layout.is-state > .house-main { grid-column: 1; }

/* ---- The day at a glance: the card, its strip, then the labelled rows -------------------------------------------- */

.session-glance { margin: 22px 0 0; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.session-glance > .house-card-kicker { margin: 0 0 18px; }
.session-glance > .house-strip { margin: 0 0 24px; }
.session-glance .session-text > :first-child { margin-top: 0; }
.session-glance .session-text > :last-child { margin-bottom: 0; }
/* How you take part: each way of taking part with the periods it covers, then its sentence. */
.session-mode { font-weight: 650; color: var(--ink); }
/* Required and optional: the activities by name, each with its state in words. */
.session-list { margin: 0; padding: 0; list-style: none; }
.session-list > li { margin: 0 0 6px; }
.session-list > li:last-child { margin-bottom: 0; }
.session-list-state { margin-left: 8px; font-size: 14.5px; color: var(--ink-3); }
.session-list-state::before { content: "·"; content: "·" / ""; margin-right: 8px; }
/* Staff only: which answers the course has not written yet. */
.session-missing dd { color: var(--ink-3); font-size: 14.5px; }

/* ---- Week 6's two halves inside that card, or Day 1's one --------------------------------------------------------- */

.session-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 22px;
  border-top: 1px solid var(--line); }
.session-halves.is-one { grid-template-columns: minmax(0, 1fr); }
.session-half { min-width: 0; padding: 18px 28px 0 0; }
.session-half + .session-half { padding: 18px 0 0 28px; border-left: 1px solid var(--line); }
.session-half > h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.session-half-time { margin: 8px 0 0; font-family: var(--serif); font-size: 23px; line-height: 1.17;
  letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.session-half > p { margin: 10px 0 0; }
.session-half > p.session-half-how { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
@container house (max-width: 600px) {
  .session-halves { grid-template-columns: minmax(0, 1fr); }
  .session-half, .session-half + .session-half { padding: 18px 0 0; border-left: 0; }
  .session-half + .session-half { margin-top: 20px; border-top: 1px solid var(--line); }
}

/* ---- The page's sections ------------------------------------------------------------------------------------------ */

.session-layout .house-section { scroll-margin-top: calc(var(--topbar-h) + 4px); }
/* Each card keeps its own height, so a short card beside a tall one leaves no hole inside it (M52, K6); house.css
   gives a card its grid area's height, so the card takes its own (PS-10, K5). */
.session-acts { margin: 22px 0 0; align-items: start; }
.session-acts > .house-card { height: auto; }
.session-layout .house-section > .session-text { max-width: 44rem; }
.session-layout .house-section > .session-text > :first-child { margin-top: 0; }
/* Under a half's heading in Week 6: its hours, keyed to its colour in the strip. */
.house-section > p.session-span { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; font-size: 14.5px;
  line-height: 1.5; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* The capstone's milestones on the day, under the afternoon's periods. */
.session-milestones { margin: 16px 0 0; padding: 0; list-style: none; font-size: 15.5px; line-height: 1.5; }
.session-milestones > li { margin: 0 0 6px; font-variant-numeric: tabular-nums; }

/* ---- The reader (reading.js), a reading page in the session page's form ---------------------------------------------- */

.reading-layout .course-reader { margin: 0; }
.reading-state { margin-top: 0; }
.reading-downloads { margin: 32px 0 0; }
.reading-downloads > h2 { margin: 0 0 12px; }
/* A deck takes the frame's whole width, under the tab row, with no column for a list (M52, K8). */
.house-layout.reading-layout.is-deck { grid-template-columns: minmax(0, 1fr); }
.house-layout.reading-layout.is-deck > .house-rail { display: none; }
.house-layout.reading-layout.is-deck > .house-main { grid-column: 1; }

/* A period's way of taking part under its times: a long one ("Consultancy session", "Independent work") wraps in the
   time column rather than running under the subject. */
.house-rows.is-periods .house-row-when > .house-label { white-space: normal; overflow-wrap: anywhere; }

/* On a phone, a tab's state moves under its name rather than breaking it ("Day 7 quiz" stays whole beside "Opens at
   14:30 on Tuesday 24 November"), and a long name (today a practice conversation's, whose label is its title) wraps
   inside the frame rather than widening the page. */
@media (max-width: 640px) {
  .house-tabs .house-tabs-group > li { min-width: 0; max-width: 100%; }
  .house-tabs :is(a, .house-tabs-off) { flex-wrap: wrap; row-gap: 0; white-space: normal; }
  .house-tabs .house-tabs-state { white-space: nowrap; }
}

/* "Optional reading" and "After the session" in the Optional row: places on this page, as links in a sentence. */
.session-jump { margin: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; }

/* ---- The course's code blocks in the page's sections (M49), drawn as the course's own pages draw them --------------
   A code block is a figure with a caption (its language and a Copy button) and a pre that scrolls inside its own box,
   so that no line of code widens the page. The colours are the course's code tokens. */

.session-layout { --code-bg: #0f1c2e; --code-ink: #ece8df; --code-dim: #a39d91; --code-kw: #ff9a7a; --code-str: #ffd98a;
  --code-com: #8f8a80; --code-num: #9fd3c0; --code-fn: #a9c7ff; }
.session-text { min-width: 0; overflow-wrap: break-word; }
.session-text :is(p, li) code { font-family: var(--mono); font-size: .88em; padding: .1em .38em; border-radius: 6px;
  background: var(--surface-2); overflow-wrap: anywhere; }
.session-text figure.code { max-width: 60rem; margin: 20px 0 24px; overflow: hidden; border-radius: 14px;
  background: var(--code-bg); color: var(--code-ink); }
.session-text figure.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0; padding: 8px 10px 8px 18px; border-bottom: 1px solid rgb(255 255 255 / 9%); font-family: var(--mono);
  font-size: 12px; color: var(--code-dim); }
.session-text figure.code figcaption span { min-width: 0; overflow-wrap: break-word; }
.session-text figure.code button.copy { flex: none; height: 26px; margin: 0; padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 16%); border-radius: 7px; background: none; color: var(--code-ink);
  font: 600 12px var(--sans); cursor: pointer; }
.session-text figure.code button.copy:hover { background: rgb(255 255 255 / 10%); }
.session-text figure.code button.copy:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.session-text figure.code pre { max-width: 100%; margin: 0; padding: 16px 18px 18px; overflow-x: auto; }
.session-text figure.code code { padding: 0; background: none; font-family: var(--mono); font-size: 13.5px;
  line-height: 1.6; color: inherit; white-space: pre; overflow-wrap: normal; font-variant-ligatures: none; }
.session-text figure.code.is-plain { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.session-text :is(.t-k, .t-kn, .t-kc, .t-ow, .t-nt) { color: var(--code-kw); }
.session-text :is(.t-s, .t-s1, .t-s2, .t-sa, .t-sd, .t-sb) { color: var(--code-str); }
.session-text :is(.t-c, .t-c1, .t-cm) { color: var(--code-com); font-style: italic; }
.session-text :is(.t-mi, .t-mf) { color: var(--code-num); }
.session-text :is(.t-nf, .t-nb, .t-nv) { color: var(--code-fn); }
/* A wide table scrolls inside its own box too. */
.session-text table { display: block; max-width: 100%; overflow-x: auto; }
.session-layout .house-section > h3 { margin: 28px 0 10px; }
@media print { .session-text figure.code button.copy { display: none; } }

/* The course's text in a section of the page (Today's exercise, Exam tasks, Optional reading, If you missed this day):
   the house's measure and spacing, as a section's own paragraphs have them. */
.session-layout .house-section > .session-text > :is(p, ul, ol) { max-width: 44rem; margin: 0 0 16px; }
.session-layout .house-section > .session-text > :is(ul, ol) { padding-left: 1.3em; }
.session-layout .house-section > .session-text li { margin: 0 0 6px; }
.session-layout .house-section > .session-text > h3 { margin: 28px 0 10px; font-size: 21px; line-height: 1.25;
  letter-spacing: -.012em; }
.session-layout .house-section > .session-text > h4 { margin: 22px 0 8px; font-size: 17px; line-height: 1.3; }
