/* cps2001.com — the page is a section through the abbey church. Masthead =
   banded limestone facade, nav = the dark steel entry, main = the nave lit
   from above, sidebar = the aisle, footer = the crypt. The palette warmed to
   the school's own interiors: the library's Mexican brick and fir beams.
   The egroup structure (menu, group info, breadcrumb) is the plan and does
   not change. DESIGN.md is the reference for all of it. */

@font-face {
  font-family: "Crimson Pro";
  src: url("../fonts/crimson-pro.1b9819b24a0a.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Crimson Pro";
  src: url("../fonts/crimson-pro-italic.8fec9bb136e8.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* limestone and brick — the facade courses, the library walls */
  --nave: #fdfaf1;
  --aisle: #f6efdf;
  --stone: #e9dec1;
  --stone-dark: #d9c9a3;
  --mortar: #ded4bb;
  --brick: #c08a52;

  /* ink — the scapular, the steel entry */
  --ink: #241f17;
  --ink-soft: #70654f;

  /* fir & brick — the chapel roof, the library beams, Ford's walls */
  --fir: #8f4728;
  --fir-dark: #6b3117;

  /* crypt */
  --concrete: #56524b;
  --marble: #eceae4;

  --gap-light: #fffdf4;

  --serif: "Crimson Pro", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--nave);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

a {
  color: var(--fir);
}

a:hover {
  color: var(--fir-dark);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page > .main {
  flex: 1;
}

/* ---- masthead: the facade, in courses ---- */

.masthead {
  /* Courses aligned to the content: the emblem in the top course, the title
     carved on a darker lintel, the rule and tagline on lighter stone below. */
  background:
    linear-gradient(180deg,
      #eadfc0 0, #eadfc0 124px,
      rgba(118, 96, 54, 0.26) 124px, rgba(118, 96, 54, 0.26) 125px,
      #dccca1 125px, #dccca1 206px,
      rgba(118, 96, 54, 0.26) 206px, rgba(118, 96, 54, 0.26) 207px,
      #e7dcbc 207px, #e7dcbc 284px,
      rgba(118, 96, 54, 0.26) 284px, rgba(118, 96, 54, 0.26) 285px,
      #e1d3ab 285px);
  background-color: var(--stone);
  color: var(--ink);
  text-align: center;
  padding: 52px 24px 46px;
}

/* The chapel's west front as a line drawing: gable and staggered slits. */
svg.emblem {
  display: block;
  width: 64px;
  height: auto;
  margin: 0 auto 20px;
  color: var(--ink);
}

.masthead h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.12;
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 520px;
  margin: 0 auto;
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(118, 96, 54, 0.45);
}

.rule span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #6d5c3c;
  white-space: nowrap;
}

.tagline {
  margin: 16px 0 0;
  font-size: 20px;
  font-style: italic;
  color: #5e5138;
}

/* ---- navigation: the steel entry, with the glass-tile gap below ---- */

.mainnav {
  background: var(--ink);
  border-bottom: 2px solid var(--gap-light);
  padding: 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

/* Wide screens: the links are the nav, and the toggle is not there. */
.navlinks {
  display: flex;
  flex-wrap: wrap;
}

.navtoggle,
.navburger {
  display: none;
}

.mainnav a {
  padding: 16px 20px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(246, 239, 223, 0.78);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.mainnav a:hover,
.mainnav a[aria-current="page"] {
  color: var(--gap-light);
  border-bottom-color: var(--brick);
}

/* Signed-in strip, right end of the nav. The sign-out control is a form
   because Django 5 logs out on POST only. */
.mainnav .account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(246, 239, 223, 0.55);
  white-space: nowrap;
}

/* Your name is the door to Settings. */
.mainnav .account .whoami {
  font-weight: 600;
  color: rgba(246, 239, 223, 0.9);
  text-decoration: none;
}

.mainnav .account .whoami:hover {
  color: var(--gap-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mainnav .account form {
  display: inline;
  margin: 0;
}

.mainnav .account button,
.mainnav .account .signin {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 223, 0.75);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.mainnav .account button:hover,
.mainnav .account .signin:hover {
  color: var(--gap-light);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--mortar);
  background: var(--aisle);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

.crumbs a {
  color: var(--ink-soft);
}

/* ---- main column: the nave ---- */

.main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 40px 64px;
  min-width: 0;
}

/* The nave is wide; the text keeps a readable measure. */
.main > * {
  max-width: 72ch;
}

.main > .tablewrap {
  max-width: none;
}

@media (max-width: 720px) {
  .main {
    padding: 28px 20px 40px;
  }

  .mainnav {
    padding: 0 8px;
  }

  .mainnav .account {
    padding: 10px 12px;
  }

  /* Seven links wrapped to three rows on a phone. Collapse them behind a
     labelled checkbox — the site runs no JS, and this needs none. The account
     strip stays out on the bar, so who you are signed in as is never hidden. */
  .mainnav {
    align-items: center;
  }

  .navburger {
    display: block;
    padding: 14px 12px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(246, 239, 223, 0.78);
    cursor: pointer;
  }

  .navburger::before {
    content: "\2630";
    margin-right: 8px;
    font-size: 14px;
    letter-spacing: 0;
  }

  /* Off-screen, not display:none: it still has to take focus from the keyboard. */
  .navtoggle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    opacity: 0;
  }

  .navtoggle:focus-visible + .navburger {
    outline: 2px solid var(--brick);
    outline-offset: -2px;
  }

  .navlinks {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    border-top: 1px solid rgba(246, 239, 223, 0.16);
  }

  .navtoggle:checked ~ .navlinks {
    display: flex;
  }

  .navtoggle:checked + .navburger {
    color: var(--gap-light);
  }

  .navlinks a {
    padding: 12px 12px;
    border-bottom: 0;
    border-left: 2px solid transparent;
  }

  .navlinks a:hover,
  .navlinks a[aria-current="page"] {
    border-bottom-color: transparent;
    border-left-color: var(--brick);
  }

  .mainnav .account {
    margin-left: auto;
  }

  .crumbs {
    padding: 10px 20px;
  }
}

.main h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
}

.main p {
  margin: 0 0 16px;
}

.lead {
  font-size: 21px;
}

/* A light shaft, not a box: one brick rule, nothing else. */
.notice {
  margin: 0 0 28px;
  padding: 12px 18px;
  border-left: 3px solid var(--brick);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.section-head {
  display: block;
  margin: 36px 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--mortar);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Bio page, In memoriam: a title above each piece only where a person has
   more than one, and the byline underneath it. */
.obit-title {
  display: block;
  margin: 30px 0 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--fir-dark);
}

.obit-source {
  margin: -6px 0 26px;
  font-family: var(--sans);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
}

dl.upcoming {
  margin: 0 0 24px;
}

dl.upcoming dt {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fir-dark);
}

dl.upcoming dd {
  margin: 2px 0 16px;
}

dl.upcoming dd:last-child {
  margin-bottom: 0;
}

dl.upcoming .who {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---- file listings ---- */

table.filelist {
  width: 100%;
  margin: 0 0 24px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
}

table.filelist th,
table.filelist td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--mortar);
  vertical-align: baseline;
}

table.filelist thead th {
  border-bottom: 2px solid var(--stone-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

table.filelist tbody th {
  font-weight: 600;
  white-space: nowrap;
}

table.filelist tbody tr:hover {
  background: var(--aisle);
}

table.filelist .num {
  text-align: right;
  white-space: nowrap;
  color: var(--ink-soft);
}

table.filelist .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}

table.filelist .note {
  display: block;
  font-weight: 400;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Teaching history: one tbody per school year, the year heading spanning its
   rows. The rule falls between years rather than between a year's own roles. */
table.taught tbody th,
table.taught tbody td {
  border-bottom: none;
}

table.taught tbody tr:last-child th,
table.taught tbody tr:last-child td {
  border-bottom: 1px solid var(--mortar);
}

table.taught tbody th[rowspan] {
  vertical-align: baseline;
}

/* Members list: the whole class, non-members greyed until they sign in. */
table.memberlist tr.nonmember th a {
  color: var(--ink-soft);
  font-weight: 400;
}

table.memberlist tr.nonmember th a:hover {
  color: var(--fir);
}

table.memberlist tr.nonmember td {
  color: #b3a88e;
}

table.memberlist .act {
  text-align: right;
}

a.button.dm {
  padding: 3px 12px;
  font-size: 10px;
}

ul.formroster {
  margin: 0 0 20px;
  padding: 0 0 0 18px;
  columns: 3 180px;
  font-family: var(--sans);
  font-size: 14px;
}

ul.formroster li {
  break-inside: avoid;
}

table.filelist .conf {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

table.filelist .conf-low {
  color: #9a3b28;
}

table.filelist .conf-medium {
  color: #8a6412;
}

table.filelist .conf-high {
  color: #5c6e3d;
}

/* Drop the filename column on narrow screens; the issue name is the link. */
@media (max-width: 640px) {
  table.filelist th:nth-child(2),
  table.filelist td:nth-child(2) {
    display: none;
  }

  /* ...but never the Call column of the dubious-matches table, nor what a
     teacher taught. */
  table.matchlist th:nth-child(2),
  table.matchlist td:nth-child(2),
  table.teacherlist th:nth-child(2),
  table.teacherlist td:nth-child(2) {
    display: table-cell;
  }

  table.matchlist th:nth-child(3),
  table.matchlist td:nth-child(3) {
    display: none;
  }
}

/* ---- message board ---- */

.post {
  margin: 0 0 20px;
  border: 1px solid var(--mortar);
  background: #fffdf6;
}

.post .byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 16px;
  background: var(--aisle);
  border-bottom: 1px solid var(--mortar);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
}

.post .byline .when {
  font-size: 12px;
  color: var(--ink-soft);
}

.post .body {
  padding: 6px 16px 8px;
}

.post .body p {
  margin: 12px 0;
}

/* ---- forms ---- */

.compose p {
  margin: 0 0 16px;
}

.compose label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.compose input[type="text"],
.compose input[type="password"],
.compose input[type="date"],
.compose input[type="time"],
.compose textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--stone-dark);
  background: #fff;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}

.compose input[type="text"]:focus,
.compose input[type="password"]:focus,
.compose input[type="date"]:focus,
.compose input[type="time"]:focus,
.compose textarea:focus {
  outline: 2px solid var(--fir);
  outline-offset: -1px;
}

.compose textarea {
  resize: vertical;
}

.compose .helptext,
.compose .errorlist {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

.compose .errorlist {
  margin: 0 0 4px;
  padding: 0 0 0 16px;
  color: #9a3b28;
}

button[type="submit"],
a.button {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--stone);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

button[type="submit"]:hover,
a.button:hover {
  border-color: var(--fir-dark);
  background: var(--fir-dark);
  color: var(--gap-light);
}

/* ---- class history ---- */

.tablewrap {
  overflow-x: auto;
  margin: 0 0 12px;
}

table.classyears {
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
}

table.classyears th,
table.classyears td {
  border: 1px solid var(--mortar);
  padding: 4px 9px;
}

table.classyears thead th {
  border-bottom: 2px solid var(--stone-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

table.classyears tbody th,
table.classyears tfoot th {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

table.classyears .yr {
  text-align: center;
  min-width: 32px;
}

table.classyears tbody tr:hover th {
  background: var(--aisle);
}

table.classyears td.in {
  background: #6f8c4d;
}

table.classyears td.out {
  background: #ece4cf;
}

table.classyears td.nodata {
  background: repeating-linear-gradient(45deg, #f2ecdb 0, #f2ecdb 4px, #e6dec9 4px, #e6dec9 8px);
}

table.classyears tfoot td {
  font-size: 12px;
  color: var(--ink-soft);
}

.legend {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}

.legend .swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin: 0 5px 0 0;
  border: 1px solid var(--mortar);
  vertical-align: -2px;
}

.legend .swatch.in {
  background: #6f8c4d;
}

.legend .swatch.out {
  background: #ece4cf;
}

.legend .swatch.nodata {
  background: repeating-linear-gradient(45deg, #f2ecdb 0, #f2ecdb 4px, #e6dec9 4px, #e6dec9 8px);
}

/* ---- footer: the crypt ---- */

.footer {
  background: var(--concrete);
  color: var(--marble);
  padding: 24px 32px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer p {
  margin: 5px 0;
}

.footer a {
  color: #fff;
}
