/* Website pages: the rules from the <style> blocks of the mockups in mockups/site/, for the parts that
   styles.css and app.css do not cover. Rules that two mockups set differently are scoped to a page
   wrapper (.page-home, .page-courses, .page-course, .page-schedule). Loaded after styles.css and app.css. */

/* ------------------------------------------------------------ headings on tablets and phones */

/* The site-wide heading sizes under 960 px are in app.css; the panel of the page after sending keeps its own. */
@media (max-width: 960px) {
  .site .ref-panel h2 { font-size: 22px; }
}

/* ------------------------------------------------------------ figures and drawings */

/* .figure svg sizing is in app.css. */
.drawing svg, .drawing-blue svg { width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.figure-narrow { max-width: 560px; }

/* ------------------------------------------------------------ session tables (home, course, schedule) */

.table.sessions thead th { white-space: nowrap; }
.sessions .date, .sessions .when { display: block; }
.sessions .when { margin-top: 2px; font-size: 14px; color: var(--muted); }
.sessions .where { display: flex; align-items: flex-start; }
.sessions .where .icon { margin-top: 5px; }
.sessions .places-label { display: block; }
/* "Confirmed: this session will run" sits on its own line under the places label. If the column is
   narrow it breaks after "Confirmed:", and the square marker stays on the first line. */
.session-state { display: flex; align-items: baseline; white-space: normal; margin-top: 2px; }
.sessions-middle td { vertical-align: middle; }
.sessions .col-date { width: 156px; }
.sessions .col-places { width: 170px; }
.page-home .table.sessions { min-width: 960px; }

/* Schedule: month tables with the same column widths. */
.schedule-table { table-layout: fixed; min-width: 1080px; }
.schedule-table .col-15 { width: 15%; }
.schedule-table .col-19 { width: 19%; }
.schedule-table .col-27 { width: 27%; }
.schedule-table .col-23 { width: 23%; }
.schedule-table .col-16 { width: 16%; }

/* Phones: each session becomes a short block of lines instead of a squeezed row. */
@media (max-width: 640px) {
  .page-home .table.sessions, .schedule-table { min-width: 0; }
  .sessions-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sessions-stack, .sessions-stack tbody, .sessions-stack tr, .sessions-stack td { display: block; width: 100%; }
  .sessions-stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .sessions-stack tr:last-child { border-bottom: 0; }
  .sessions-stack td { border: 0; padding: 2px 0; text-align: left; }
  .sessions-stack td.request { padding-top: 8px; }
  .sessions-stack td.right { padding-top: 12px; }
  .sessions-stack .btn { width: 100%; }
}

/* ------------------------------------------------------------ home */

.run-grid { gap: 40px 64px; }
.run-item { border-top: 1px solid var(--ink); padding-top: 18px; }
.run-item h3 { font-size: 21px; margin-bottom: 8px; }
.run-item p { margin: 0; max-width: 34em; }
.planned-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.planned-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 28px; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.planned-name { flex: 1 1 300px; font-weight: 500; color: var(--ink); }
.planned-when { flex: 0 0 auto; font-size: 15px; color: var(--muted); }
.course-side .btn + .btn { margin-top: 10px; }
/* Wide screens: the course facts sit in two columns, so none is left alone on a second line. */
@media (min-width: 961px) {
  .page-home .course-item .course-meta { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 6px 32px; }
}

/* ------------------------------------------------------------ courses */

/* Category filter: the segmented control, allowed to wrap on narrow screens. */
.segmented.segmented-wrap { display: flex; flex-wrap: wrap; border: 0; border-radius: 0; background: transparent; overflow: visible; padding: 0 1px 1px 0; }
.segmented.segmented-wrap a { border: 1px solid var(--line-3); margin: 0 -1px -1px 0; }
.segmented.segmented-wrap > :last-child { border-right: 1px solid var(--line-3); }
.segmented.segmented-wrap [aria-current="page"] { border-color: var(--ink); position: relative; }
.help-block { max-width: 760px; }
.help-block p { font-size: 18px; }
/* Below 1180 px the middle column is too narrow for two columns, and the facts wrap as usual. */
@media (min-width: 1180px) {
  .page-courses .course-item .course-meta { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 6px 32px; }
}

/* ------------------------------------------------------------ course page */

/* Header with a plan drawing on the right; the drawing is left out on small screens. */
.course-head { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: center; }
.course-head h1 { margin-bottom: 10px; }
.course-head .course-meta { margin: 20px 0 28px; font-size: 16px; color: var(--text); }
.course-head .course-meta .icon { color: var(--ink); }
.course-head-solo { grid-template-columns: minmax(0, 1fr); }
.course-main > section + section { margin-top: 64px; }
.course-main .programme-intro { margin-bottom: 20px; }
.aside-box .aside-list { border-top: 1px solid var(--line); margin-bottom: 14px; }
.pdf-link .icon { margin-right: 6px; }
.alert-form { background: var(--bg-alt); }
.alert-form h3 { font-size: 20px; margin-bottom: 16px; }
.alert-form .input-group, .alert-form .hint { max-width: 520px; }
.faq details > div { margin: 12px 0 0; max-width: 46em; }
.faq details > div p:last-child { margin-bottom: 0; }
@media (min-width: 641px) {
  /* Puts each module time on the baseline of its module title. */
  .programme > li:not(.break) .time { padding-top: 3px; }
}
@media (min-width: 961px) {
  .page-course .layout-aside > .aside-box { position: sticky; top: 24px; }
}
@media (max-width: 960px) {
  .course-head { grid-template-columns: minmax(0, 1fr); }
  .course-head .drawing { display: none; }
  .course-main > section + section { margin-top: 48px; }
}
@media (max-width: 640px) {
  /* In the stacked programme the break label gets the same inset as the break time. */
  .programme > li.break > div:last-child { padding-left: 12px; }
}

/* ------------------------------------------------------------ schedule */

.filter-row { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-end; }
.filter-row .field { flex: 1 1 200px; margin-bottom: 0; }
.month { margin-top: 48px; }
.site .month h2 { font-size: 26px; margin-bottom: 14px; }
.planned-grid { gap: 48px; align-items: start; }
.planned-grid .panel h3 { font-size: 20px; margin-bottom: 16px; }
@media (max-width: 640px) {
  .filter-row .btn { width: 100%; }
  /* Planned courses: one block per course, like the session rows above. */
  .planned-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .planned-table, .planned-table tbody, .planned-table tr, .planned-table td { display: block; width: 100%; }
  .planned-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .planned-table tr:last-child { border-bottom: 0; }
  .planned-table td { border: 0; padding: 2px 0; }
  .planned-table td:first-child { font-weight: 500; color: var(--ink); }
}

/* ------------------------------------------------------------ forms (request, in-company, contact) */

/* Long forms in parts: each part opens with a serif legend, and a thin rule separates the parts.
   The rules stop at the parts, so a radio group's own legend inside a part keeps legend.field-label. */
.form-parts > fieldset { margin: 0 0 8px; }
.form-parts > fieldset > legend { width: 100%; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.3; margin-bottom: 18px; }
.form-parts > fieldset ~ fieldset > legend { border-top: 1px solid var(--line); padding-top: 28px; }
.form-parts .choice-list { margin-bottom: 20px; }
.form-parts .form-consent { border-top: 1px solid var(--line); padding-top: 28px; margin-bottom: 8px; }
.form-parts .cluster { gap: 8px 32px; }
.form-parts fieldset .check:last-child { margin-bottom: 0; }
.form-privacy { max-width: 36em; }
.choice input[type="radio"] { margin-top: 4px; }
.choice { cursor: pointer; }
input.input-places { max-width: 140px; }
/* The city sits under the "At our office" choice, in line with its label. */
.where-city { margin: 0 0 14px 28px; max-width: 340px; }
.problem-list { margin: 0; padding-left: 1.2em; }
.problem-list li { margin: 2px 0; }
/* Hidden field for the spam check: out of sight and out of reach of the keyboard and screen readers. */
.form-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* Parts of the request form that do not apply to the type of request chosen are hidden with the hidden
   attribute (js/request-form.js); the rule that makes it win is in app.css. */

/* In-company price lines, set like the key facts lists in the other boxes. */
.price-lines { width: 100%; font-size: 15px; margin: 0 0 16px; }
.price-lines th, .price-lines td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-lines th { text-align: left; font-weight: 400; color: var(--muted); padding-right: 12px; }
.price-lines td { text-align: right; white-space: nowrap; }
.split-top { align-items: start; }
.aside-text { font-size: 16px; }
.aside-note { font-size: 15px; }

/* ------------------------------------------------------------ about and contact */

.facts-wrap { max-width: 880px; }
.trainers { display: grid; gap: 32px 56px; }
.trainer { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; padding-top: 24px; border-top: 1px solid var(--line-2); }
.trainer-photo { flex: 0 0 168px; width: 168px; height: 168px; object-fit: cover; border: 1px solid var(--line); }
.trainer .photo-placeholder { flex: 0 0 168px; width: 168px; }
.trainer-text { flex: 1 1 220px; min-width: 0; }
.trainer-text h3 { margin-bottom: 6px; }
.company-cols { gap: 40px 72px; }
.contact-cols { gap: 48px 56px; align-items: start; }
.map-link .icon { margin-left: 6px; }

/* ------------------------------------------------------------ request sent */

.steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ref-panel .panel-section { padding: 24px; }
.ref-panel .ref-head { background: var(--paper-blue); }
.ref-label { font-size: 15px; }
.ref-number { font-size: 34px; font-weight: 500; line-height: 1.2; color: var(--ink); margin: 4px 0 8px; }
.ref-panel h2 { font-size: 22px; margin-bottom: 14px; }
.break-anywhere { overflow-wrap: anywhere; }
.notice-info .icon { color: var(--blue); }
@media (max-width: 640px) {
  .steps-3 { grid-template-columns: minmax(0, 1fr); }
  .ref-panel .panel-section { padding: 20px; }
  .ref-panel .facts th { width: 36%; }
}

/* ------------------------------------------------------------ legal pages */

.legal { max-width: 46em; }
.legal h2 { margin-top: 48px; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin-top: 28px; font-size: 20px; }
.legal .facts { margin-bottom: 1em; }
.legal-meta { font-size: 15px; color: var(--muted); }
.room-hint { margin: -12px 0 20px; }

/* The course overview, with the headings, lists and links of the course editor (apps.catalogue.text). */
.overview-text h3 { margin: 24px 0 8px; }
.overview-text > :last-child { margin-bottom: 0; }
