/* Met in Williamsburg — Lincoln Center.
   Light: the plaza by day — travertine, white, charcoal, a little gold.
   Dark: the house with the lights down — red velvet, near-black, gold leaf. */

:root {
  --paper: #f3efe6;          /* travertine */
  --card: #fcfaf5;
  --ink: #1d1b18;
  --muted: #625d55;
  --faint: #8f897f;
  --accent: #8e1b2c;         /* Met crimson */
  --accent-hover: #6c1220;
  --gold: #a8854a;
  --gold-soft: #c9ae7a;
  --rule: #ddd5c5;
  --row-alt: #f7f3eb;
  --row-hover: #efe7d6;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 8px 24px rgba(29, 27, 24, .07);
  --danger: #a3221f;
  --ok: #3d5c45;
  --glow: transparent;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", "Century Gothic", system-ui, sans-serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --radius: 3px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #140b0d;
    --card: #1e1013;
    --ink: #f2e8d8;
    --muted: #c4ae98;
    --faint: #8f7a69;
    --accent: #e0b664;       /* gold leaf */
    --accent-hover: #f4d38e;
    --gold: #c49a4e;
    --gold-soft: #8a6c3a;
    --rule: #3d2228;
    --row-alt: #1a0d10;
    --row-hover: #2b161a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45);
    --danger: #f08a7e;
    --ok: #9cc3a3;
    --glow: rgba(224, 182, 100, .13);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #140b0d;
  --card: #1e1013;
  --ink: #f2e8d8;
  --muted: #c4ae98;
  --faint: #8f7a69;
  --accent: #e0b664;
  --accent-hover: #f4d38e;
  --gold: #c49a4e;
  --gold-soft: #8a6c3a;
  --rule: #3d2228;
  --row-alt: #1a0d10;
  --row-hover: #2b161a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45);
  --danger: #f08a7e;
  --ok: #9cc3a3;
  --glow: rgba(224, 182, 100, .13);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  /* In the dark, a chandelier's glow above the masthead. */
  background-image: radial-gradient(ellipse 70% 340px at 50% -60px, var(--glow), transparent);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; }

.faint { color: var(--faint); }

/* Labels: Lincoln Center signage — spaced capitals in a geometric sans. */
.label, .kicker, .mainnav, .page-nav, .toolbar label, .ledger thead th, .btn, button, legend,
.program h2, .artist h2, .crew h2, .field > span, .admin-list th, .facts dt, .count, .colophon {
  font-family: var(--sans);
}

/* ------------------------------------------------------------------ masthead */
.masthead {
  text-align: center;
  padding: 2rem 16px .3rem;
}
.masthead .house {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.35rem, 4.6vw, 2.3rem);
  letter-spacing: .32em;
  margin-right: -.32em;          /* balance the tracking after the last letter */
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.15;
}
.masthead .house:hover { text-decoration: none; color: var(--accent); }
.masthead .motto {
  margin: .35rem 0 0;
  font-family: var(--display);
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
}
/* The Met's five arches, with the plaza's long rules running out either side. */
.facade {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 1200px;
  margin: .8rem auto 0;
  color: var(--gold);
}
.facade::before, .facade::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--gold);
}
.facade .arches { display: block; width: 66px; height: auto; flex: none; margin-bottom: -1px; }

.mainnav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .3rem 2rem;
  padding: .7rem 16px .2rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .8rem;
  font-weight: 500;
}
.mainnav a { color: var(--muted); }
.mainnav a.active, .mainnav a:hover { color: var(--accent); text-decoration: none; }
.mainnav a.active { box-shadow: 0 1px 0 var(--accent); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.4rem 16px 3rem;
}
.container.wide { max-width: none; }

footer.colophon {
  text-align: center;
  color: var(--faint);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 1rem 16px 2.5rem;
}
.colophon .starburst { display: block; width: 34px; height: 34px; margin: 0 auto .5rem; color: var(--gold); }
.colophon a { color: var(--faint); }
.colophon a:hover { color: var(--accent); text-decoration: none; }

.starburst { width: 40px; height: 40px; }

.page-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: .3rem 0 .2rem;
}
.lede { text-align: center; color: var(--muted); font-style: italic; margin: 0 0 1.4rem; }

.empty { color: var(--muted); font-style: italic; text-align: center; padding: 3rem 1rem; }
.empty-note { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ forms (shared) */
input[type=text], input[type=search], input[type=password], input[type=number], input[type=url],
input[type=date], select, textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .4rem .55rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, th:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
textarea { width: 100%; resize: vertical; line-height: 1.45; }

.btn, button {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: inline-block;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover, button:hover { border-color: var(--gold); text-decoration: none; color: var(--ink); }
.btn.primary, button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--card);
}
.btn.primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--card); }
.btn.danger, button.danger { color: var(--danger); }
.btn.small, button.small { padding: .2rem .55rem; font-size: .72rem; letter-spacing: .08em; }

/* ------------------------------------------------------------------ tables: the Repertory and the Company */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar input[type=search] { flex: 1 1 240px; min-width: 0; }
.toolbar label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toolbar label select { font-family: var(--body); text-transform: none; letter-spacing: 0; }
.toolbar label input[type=checkbox] { margin: 0; }
.toolbar .count {
  margin-left: auto;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ledger-wrap {
  overflow: auto;
  max-height: calc(100vh - 230px);
  min-height: 300px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  box-shadow: var(--shadow);
}
.ledger-wrap.short { max-height: 70vh; }
table.ledger {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: .95rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.ledger th, .ledger td {
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}
.ledger thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  border-bottom: 1px solid var(--gold);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  padding-top: .7rem;
  padding-bottom: .75rem;
}
.ledger thead th:hover { color: var(--accent); }
.ledger thead th[aria-sort] { color: var(--ink); }
/* The sort arrow sits under the heading text, so it takes no column width. */
.ledger thead th .arrow {
  position: absolute;
  left: .65rem;
  bottom: .12rem;
  color: var(--accent);
  font-size: .7em;
  line-height: 1;
}
.ledger thead th.num .arrow { left: 0; right: 0; text-align: center; }
.ledger thead th[aria-sort="ascending"] .arrow::after { content: "▲"; }
.ledger thead th[aria-sort="descending"] .arrow::after { content: "▼"; }
.ledger tbody tr:nth-child(even) { background: var(--row-alt); }
.ledger tbody tr:hover { background: var(--row-hover); }
.ledger .num { text-align: center; white-space: nowrap; }
.ledger .date { white-space: nowrap; color: var(--muted); }
.ledger .title { min-width: 11em; font-family: var(--display); font-size: 1.08rem; font-weight: 500; line-height: 1.3; }
.ledger .title a { color: var(--ink); }
.ledger .title a:hover { color: var(--accent); }
.ledger .person { min-width: 8.5em; }
.ledger .leads { min-width: 14em; }
.ledger .leads a { color: var(--ink); }
.ledger .leads a:hover { color: var(--accent); }
.ledger .lang, .ledger .voice-col { white-space: nowrap; }
.ledger .prose { min-width: 14em; max-width: 24em; color: var(--muted); }
.ledger .prose div {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ledger tr:hover .prose div { -webkit-line-clamp: unset; }
.ledger .fate { font-style: italic; color: var(--ink); }

/* ------------------------------------------------------------------ the Program */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-nav a { color: var(--muted); }
.page-nav a:hover { color: var(--accent); text-decoration: none; }
.page-nav .disabled { visibility: hidden; }

.program, .artist {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 2.6rem 2.6rem 2rem;
  position: relative;
}
/* A thin inner frame, like a printed program's border. */
.program::before, .artist::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.program-cover { text-align: center; margin-bottom: 2rem; position: relative; }
.kicker {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.program-cover h1 {
  font-size: clamp(2.3rem, 7vw, 4.2rem);
  font-weight: 500;
  margin: .6rem 0 .5rem;
  letter-spacing: -.005em;
}
.program-cover .composer {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
}
.program-cover .composer a { color: var(--ink); }
.program-cover .composer a:hover { color: var(--accent); text-decoration: none; }
.program-cover .when { margin: .7rem 0 0; font-style: italic; color: var(--muted); font-size: 1.08rem; }
.program-cover .links { margin: 1rem 0 0; display: flex; gap: .5rem; justify-content: center; }
.ornament { display: flex; align-items: center; gap: 1rem; max-width: 22rem; margin: 1.2rem auto 0; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; flex: 1; border-top: 1px solid var(--gold-soft); }
.ornament .starburst { width: 34px; height: 34px; flex: none; }

.program-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.8rem;
}
.program h2, .artist h2, .crew h2, .check h2.label {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .7rem;
}
.program section, .artist section { margin-bottom: 2rem; }
.program section:last-child { margin-bottom: 0; }

.in-brief .synopsis {
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 0 0 1.4rem;
}
.in-brief .fate { font-style: italic; font-size: 1.15rem; margin: 0; }

/* The cast, printed with dot leaders. */
.cast-list { list-style: none; margin: 0; padding: 0; }
.cast-list li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .32rem 0;
}
.cast-list .role { font-style: italic; }
.cast-list .voice {
  font-family: var(--sans);
  font-style: normal;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-left: .55rem;
}
.cast-list .leader {
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--faint);
  transform: translateY(-.3em);
}
.cast-list .singer { text-align: right; max-width: 60%; }
.cast-list .singer a { color: var(--ink); font-weight: 600; }
.cast-list .singer a:hover { color: var(--accent); }
.cast-list .unknown { color: var(--faint); font-style: italic; }
.cast-note { display: block; color: var(--faint); font-size: .84rem; font-style: italic; line-height: 1.35; }
.mark { color: var(--accent); font-family: var(--sans); font-size: .7em; margin-left: .12em; cursor: help; }
.footnotes { margin: .9rem 0 0; color: var(--faint); font-size: .84rem; font-style: italic; }
.footnotes span { display: block; }

.notes p { margin: 0 0 .7rem; }

.program-side { border-left: 1px solid var(--rule); padding-left: 2.2rem; }
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1.1rem;
  margin: 0 0 1rem;
}
.facts dt {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .28em;
}
.facts dd { margin: 0; }
.program-side .clamp p { margin: 0 0 .7rem; color: var(--muted); font-size: .95rem; }
.source { color: var(--faint); font-size: .85rem; font-style: italic; margin: .3rem 0 0; }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp.open { display: block; }
.more-toggle {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: .7rem;
}
.more-toggle:hover { text-decoration: underline; color: var(--accent-hover); }

.also { margin: 0; padding-left: 1.1rem; }
.also li { margin: .15rem 0; }

.swipe-hint { display: none; text-align: center; color: var(--faint); font-size: .9rem; font-style: italic; margin-top: .8rem; }

/* ------------------------------------------------------------------ the Company and an artist */
.crew {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  margin-top: 2.6rem;
}
.crew-list { list-style: none; margin: 0; padding: 0; }
.crew-list li { padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.crew-list .who { display: block; font-weight: 600; }
.crew-list .nights { font-size: .92rem; color: var(--muted); }

.artist .program-cover h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
table.plain { width: 100%; border-collapse: collapse; font-size: .97rem; }
.plain th {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: .3rem .6rem .5rem 0;
  border-bottom: 1px solid var(--gold);
}
.plain td { padding: .45rem .6rem .45rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.plain .date { white-space: nowrap; }
.plain .opera { font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.plain .opera:hover { color: var(--accent); }
.partners { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.partners li { padding: .15rem 0; break-inside: avoid; }

/* ------------------------------------------------------------------ login */
.login-box {
  max-width: 380px;
  margin: 1.5rem auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}
.login-box .ornament { margin: 0 auto .8rem; }
.login-box h1 { margin: 0 0 .2rem; font-size: 2rem; }
.login-box label {
  display: block;
  text-align: left;
  margin-bottom: .9rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.login-box input { display: block; width: 100%; margin-top: .3rem; font-family: var(--body); }
.login-box button { width: 100%; margin-top: .5rem; }

.notice {
  padding: .55rem .8rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid;
}
.notice.error { color: var(--danger); border-color: var(--danger); }
.notice.ok { color: var(--ok); border-color: var(--ok); }

/* ------------------------------------------------------------------ Stage Door */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-head h1 { margin: 0 auto 0 0; font-size: 2.1rem; }

.table-scroll { overflow-x: auto; }
table.admin-list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); font-size: .95rem; }
.admin-list th, .admin-list td { padding: .4rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.admin-list th { font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.admin-list .num { text-align: center; }
.admin-list .date { white-space: nowrap; }
.admin-list tr:hover td { background: var(--row-hover); }
.flag {
  display: inline-block;
  font-size: .76rem;
  padding: 0 .45rem;
  margin: 0 .15rem .1rem 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--faint);
  white-space: nowrap;
}

.check { margin: 1.6rem 0; }
.check h2 { font-size: 1.4rem; margin: 0 0 .1rem; }
.check h2 .faint { font-family: var(--body); font-size: 1rem; font-style: italic; }
.check-links { margin: 0 0 .5rem; font-size: .95rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
fieldset {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 1rem 1.2rem 1.2rem;
  margin: 0 0 1.2rem;
  min-width: 0;
}
legend {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 .5rem;
}
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field > span { color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; }
.inline { display: flex; gap: .8rem; }
.inline > * { flex: 1; min-width: 0; }
.hint { color: var(--faint); font-size: .88rem; font-style: italic; }

.lookup-results { display: grid; gap: .5rem; margin-top: .8rem; }
.candidate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .5rem .7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.candidate .t { font-weight: 600; }
.candidate .m { color: var(--muted); font-size: .9rem; }
.lookup-status { color: var(--muted); font-style: italic; margin-top: .5rem; }
.lookup-status:empty, .lookup-results:empty { display: none; }

table.cast-edit { width: 100%; border-collapse: collapse; min-width: 760px; }
.cast-edit th { font-family: var(--sans); font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 .3rem .3rem; }
.cast-edit td { padding: .15rem .2rem; }
.cast-edit input { width: 100%; padding: .3rem .45rem; font-size: .95rem; }
.cast-edit td:nth-child(1) { width: 18%; }
.cast-edit td:nth-child(2) { width: 22%; }
.cast-edit td:nth-child(3) { width: 13%; }
.cast-edit td:nth-child(4) { width: 20%; }
.cast-edit .row-tools { white-space: nowrap; width: 1%; }
.cast-edit .row-tools button { margin-left: .2rem; }

.form-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.delete-form { margin-top: 1.5rem; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 860px) {
  .program-body { grid-template-columns: 1fr; gap: 1.6rem; }
  .program-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.6rem; }
  .crew { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .program, .artist { padding: 1.8rem 1.2rem 1.4rem; }
  .program::before, .artist::before { inset: 5px; }
  .swipe-hint { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .mainnav { gap: .3rem 1.2rem; letter-spacing: .14em; }
  .cast-list li { display: block; padding: .4rem 0; border-bottom: 1px dotted var(--rule); }
  .cast-list .leader { display: none; }
  .cast-list .singer { display: block; max-width: none; text-align: left; padding-left: 1rem; }
  .partners { columns: 1; }
  .ledger-wrap { max-height: none; }
}
