/* Summer Freestyle Workshop: monochrome, research-paper layout. */

:root {
  --ink: #000;
  --paper: #fff;
  --rule: #000;
  --faint: #555;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Latin Modern Roman", "Computer Modern Serif", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

p,
dd,
.abstract p,
table.schedule .detail,
ul.materials li,
.lock-note,
.member .description {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 40px 80px;
}

/* --- top navigation, styled like a running head --- */
nav.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 44px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav.masthead .brand { font-weight: 700; }
nav.masthead a { color: var(--ink); text-decoration: none; }
nav.masthead .links a { margin-left: 26px; }
nav.masthead .links a:hover { text-decoration: underline; }
nav.masthead a.active { text-decoration: underline; text-underline-offset: 3px; }
.language-switch {
  margin-left: 26px;
  white-space: nowrap;
}
.language-switch a { margin-left: 0 !important; }
.language-switch .active { font-weight: 700; }

/* --- paper title block --- */
header.titleblock { text-align: center; margin-bottom: 40px; }
header.titleblock p { text-align: center; }
header.titleblock h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.2;
}
header.titleblock .subtitle { font-size: 19px; margin: 0 0 10px; }
header.titleblock .meta {
  font-size: 14px;
  color: var(--ink);
  font-style: italic;
}

/* --- calendar of events --- */
.calendar-block { margin-bottom: 46px; }
/* Explicit grid columns rather than flex wrapping: the rules below have to
   match where the columns actually break, and grid lets the breakpoints say
   exactly that. */
.calendar {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 240px) minmax(0, 1fr);
  gap: 30px;
}
/* months and the events panel sit as siblings in one grid row */
.cal-months { display: contents; }
.cal-events { min-width: 0; }
/* hairline rules centred in the gutters, so the space between the columns
   reads as deliberate instead of as a gap */
.cal-month + .cal-month,
.cal-events {
  border-left: 1px solid #ccc;
  padding-left: 30px;
}
.cal-month .cal-title {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 34px));
  width: 100%;
}
.cal-month { min-width: 0; }
.cal-grid .dow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  text-align: center;
  padding-bottom: 5px;
}
.cal-day {
  position: relative;
  width: auto;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
}
.cal-day span { position: relative; z-index: 1; }
.cal-day.event { cursor: pointer; }
.cal-day.event::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.cal-day.selected::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
}
.cal-day.selected { color: var(--paper); }
.cal-day.today::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
}
.cal-events h3 {
  margin: 0 0 8px;
  font-size: 15px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}
.cal-event-row {
  display: grid;
  grid-template-columns: 52px 82px minmax(0, 1fr);
  column-gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
  font-size: 14.5px;
}
.cal-event-row:last-child { border-bottom: 0; }
.cal-event-row .t { font-weight: 700; white-space: nowrap; }
.cal-event-row .c { font-variant: small-caps; white-space: nowrap; }
.cal-event-row .who { color: var(--faint); }
.cal-empty { font-style: italic; color: var(--faint); font-size: 14.5px; margin: 0 0 8px; }

/* The columns break in two stages, and each rule follows its own column: the
   events panel drops below the months first, the months stack only later. */
@media (max-width: 940px) {
  .calendar { grid-template-columns: minmax(0, 240px) minmax(0, 240px); }
  .cal-events {
    grid-column: 1 / -1;
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid #ccc;
    padding-top: 22px;
  }
}

@media (max-width: 560px) {
  .calendar { grid-template-columns: minmax(0, 1fr); }
  .cal-months {
    display: flex;
    gap: 18px;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 10px;
  }
  .cal-month {
    flex: 0 0 calc(100% - 28px);
    max-width: none;
    scroll-snap-align: start;
  }
  .cal-month + .cal-month {
    border-left: 0;
    padding-left: 0;
    border-top: 0;
    padding-top: 0;
  }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day {
    width: min(100%, 42px);
    justify-self: center;
    max-height: none;
  }
  .cal-events { padding-top: 18px; }
  .cal-event-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 2px 12px;
    padding: 10px 0;
  }
  .cal-event-row .t { grid-column: 1; grid-row: 1; }
  .cal-event-row .c { grid-column: 1; grid-row: 2; }
  .cal-event-row > span:last-child { grid-column: 2; grid-row: 1 / span 2; }
  .cal-event-row .who { display: block; margin-top: 2px; }
}

/* --- sections --- */
section { margin-bottom: 34px; }

h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}

h3 { font-size: 17px; font-weight: 700; margin: 18px 0 6px; }

p { margin: 0 0 10px; }

.abstract {
  margin: 0 0 34px;
  font-size: 15.5px;
}

.abstract .signoff {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-top: 14px;
  text-align: left;
}
.abstract .signoff a { white-space: nowrap; }

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

/* --- track list --- */
dl.tracks dt {
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.02em;
}
dl.tracks dd { margin: 0 0 12px; }

/* --- schedule table --- */
table.schedule {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
}
table.schedule th {
  text-align: left;
  border-top: 0;
  border-bottom: 1px solid var(--rule);
  padding: 6px 10px 6px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.schedule td {
  vertical-align: top;
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid #ccc;
}
table.schedule tbody tr:last-child td { border-bottom: 0; }
table.schedule tr.day td {
  border-bottom: 1px solid var(--rule);
  font-weight: 700;
  padding-top: 16px;
}
table.schedule th:nth-child(1),
table.schedule td.time { width: 70px; }
table.schedule th:nth-child(2),
table.schedule td.code { width: 92px; }
table.schedule td.time { white-space: nowrap; }
table.schedule td.code { white-space: nowrap; font-variant: small-caps; }
table.schedule .instructor { font-weight: 400; }
table.schedule .topic { font-weight: 700; }
table.schedule .detail { color: var(--faint); font-size: 14px; }

/* --- materials --- */
ul.materials { list-style: none; padding: 0; margin: 0; }
ul.materials li {
  border-bottom: 1px solid #ccc;
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
ul.materials li .code { font-variant: small-caps; font-weight: 700; white-space: nowrap; }
ul.materials li .tba { color: var(--faint); font-style: italic; white-space: nowrap; }

/* --- team --- */
.lock-note {
  font-size: 13.5px;
  font-style: italic;
  color: var(--faint);
  margin-bottom: 24px;
}

.member {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid #ccc;
}
.member:last-child { border-bottom: none; }

.member .photo-wrap { position: relative; }
.member img.photo,
.member .photo-placeholder {
  width: 180px;
  height: 224px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--rule);
  display: block;
  background: #f2f2f2;
}
.member img.photo { image-rendering: auto; }
.member .photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 8px;
}

.member h3.name {
  margin: 0 0 2px;
  font-size: 19px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.member .caption {
  font-style: italic;
  font-size: 15px;
  margin-bottom: 8px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.member .description { font-size: 15.5px; }
.member .description p { margin: 0 0 9px; }
/* keep the pencil on the same line as the end of the last paragraph */
.member .description p:last-of-type { display: inline; }

/* --- pencil edit buttons --- */
button.pencil {
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--faint);
  font-family: inherit;
}
button.pencil::before { content: "["; }
button.pencil::after { content: "]"; }
button.pencil:hover { color: var(--ink); }
button.pencil:focus-visible {
  outline: 1px solid var(--rule);
  outline-offset: 2px;
}

.photo-wrap button.pencil {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
button.pencil[disabled] {
  cursor: wait;
  opacity: 0.55;
}

.save-status {
  color: var(--faint);
  font-size: 13px;
  font-style: italic;
  margin-left: 2px;
}

.editing input,
.editing textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 4px 6px;
}
.editing textarea { min-height: 170px; resize: vertical; }
.edit-hint {
  display: block;
  font-size: 12.5px;
  font-style: italic;
  color: var(--faint);
  margin-top: 3px;
}
.edit-actions { margin-top: 6px; display: flex; gap: 8px; }
.edit-actions button {
  font-family: inherit;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 3px 12px;
  cursor: pointer;
}
.edit-actions button:hover { background: var(--ink); color: var(--paper); }

/* --- footer --- */
footer {
  margin-top: 70px;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  font-size: 13px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .page { padding: 18px 16px 56px; }
  nav.masthead {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 32px;
    font-size: 11.5px;
  }
  nav.masthead .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 14px;
  }
  nav.masthead .links a { margin-left: 0; }
  .language-switch { margin-left: 0; }
  header.titleblock { margin-bottom: 32px; }
  header.titleblock h1 { font-size: 28px; }
  h2 { font-size: 18px; }
  p, dd, .abstract p, table.schedule .detail, .member .description {
    text-align: left;
    hyphens: none;
  }
  table.schedule,
  table.schedule tbody { display: block; width: 100%; }
  table.schedule thead { display: none; }
  table.schedule tr:not(.day) {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #ccc;
  }
  table.schedule tr.day { display: block; }
  table.schedule tr.day td {
    display: block;
    width: 100%;
    padding: 20px 0 7px;
  }
  table.schedule tr:not(.day) td {
    display: block;
    width: auto;
    padding: 0;
    border-bottom: 0;
  }
  table.schedule td.time { grid-column: 1; grid-row: 1; font-weight: 700; }
  table.schedule td.code { grid-column: 1; grid-row: 2; margin-top: 3px; }
  table.schedule tr:not(.day) td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
  table.schedule .instructor { margin-bottom: 2px; }
  table.schedule .detail { margin-top: 3px; line-height: 1.4; }
  ul.materials li { align-items: flex-start; flex-wrap: wrap; }
  .member { grid-template-columns: 1fr; }
  .member img.photo,
  .member .photo-placeholder { width: min(180px, 100%); }
  .abstract { margin-left: 0; margin-right: 0; }
  footer { gap: 12px; flex-wrap: wrap; }
}
