/* Time Brackets: a concert programme crossed with a school bell timetable. */

* { box-sizing: border-box; border-radius: 0; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 16px 3rem;
}

h1 {
  margin: 0;
  padding-bottom: 0.4rem;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: var(--fw-bold);
  color: var(--c-earth);
  border-bottom: 3px double var(--ink);
}

h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  font-variant: small-caps;
}

p { margin: 0.75rem 0; }

.intro { margin: 1.25rem 0 1.75rem; max-width: 36rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0 2rem; align-items: flex-start; }
.grow { flex: 1 1 12rem; }

label { font-size: 0.875rem; color: var(--ink-soft); letter-spacing: 0.04em; }

.hint { margin: 0; font-size: 0.875rem; color: var(--ink-soft); }

textarea,
input[type="time"] {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.5rem 0.6rem;
}

textarea { width: 100%; min-height: 10rem; resize: vertical; line-height: 1.6; }
input[type="time"] { min-width: 9rem; }

/* the level: a hairline with a square weight */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2.6rem;
  margin: 0;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 22px;
  margin-top: -11px;
  background: var(--ink);
  border: 0;
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 22px; background: var(--ink); border: 0; }

.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

#note { min-height: 1.5rem; }

/* ---------- the programme table ---------- */

.tablewrap { margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.6rem 0.45rem 0.5rem;
  border-bottom: 1px solid var(--ink-soft);
  overflow-wrap: normal;
}
td:nth-child(2) { overflow-wrap: anywhere; }
th {
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
th:first-child, td:first-child { border-left: 4px solid transparent; }
tr.current td:first-child { border-left-color: var(--c-brick); }
tr.end td { border-bottom: 1px solid var(--ink); }
td:nth-child(6), td:nth-child(7), th:nth-child(6), th:nth-child(7) { white-space: nowrap; }

@media (hover: hover) and (prefers-color-scheme: light) {
  tbody tr:hover td { background: var(--c-lavlt); }
}

/* ---------- views ---------- */

[hidden] { display: none !important; }

body:not([data-view="setup"]) #setup,
body:not([data-view="setup"]) #earlier,
body[data-view="setup"] #concert { display: none; }

body:not([data-view="performing"]) .now,
body:not([data-view="performing"]) #pressline,
body:not([data-view="performing"]) #door,
body:not([data-view="programme"]) #dateline,
body:not([data-view="programme"]) #proghead,
body:not([data-view="programme"]) #result,
body:not([data-view="programme"]) #print,
body:not([data-view="programme"]) #again,
body:not([data-view="waiting"]) #waitline,
body:not([data-view="waiting"]) #cancel,
body[data-view="programme"] #paused,
body[data-view="programme"] #continue { display: none; }

.now { margin-top: 2rem; }
#stepof { margin: 0; color: var(--ink-soft); }
#stepname { margin: 0.1rem 0 0; font-size: 1.75rem; line-height: 1.25; font-weight: var(--fw-bold); overflow-wrap: anywhere; }

#dateline { margin-top: 1.25rem; }
#proghead { margin-top: 0.75rem; }
#result { margin-top: 1.5rem; }
#result p { margin: 0.25rem 0; }
#resultline { font-weight: var(--fw-bold); }
#pressline, #waitline { margin-top: 1.5rem; }

#record { margin: 0; padding-left: 0; list-style: none; }
#record li { padding: 0.4rem 0; border-bottom: 1px solid var(--ink-soft); }
#record li:first-child { border-top: 1px solid var(--ink); }
#nokeep { color: var(--ink-soft); }

.colophon { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--ink-soft); font-size: 0.875rem; color: var(--ink-soft); }
.colophon img { display: block; height: 32px; width: auto; }

@media (max-width: 30rem) {
  main { padding-top: 1.5rem; }
  table { font-size: 0.75rem; }
  th, td { padding: 0.4rem 0.2rem; }
  th { font-size: 0.625rem; letter-spacing: 0; }
}

@media (prefers-color-scheme: dark) {
  h1 { color: var(--ink); }
  .colophon img { background: var(--c-cream); padding: 4px 6px; box-sizing: content-box; }
}

/* ---------- print: the programme only, ink on white ---------- */

@page { margin: 18mm; }

@media print {
  :root, html, body { --bg: #fff; --ink: #000; --ink-soft: #444; background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  h1 { color: #000; border-bottom: 5px double #000; }
  #setup, #earlier, .colophon, .now, #waitline, #pressline, #paused, .buttons, #note { display: none !important; }
  tr { break-inside: avoid; }
  tbody tr:hover td { background: none; }
}
