@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #14161C;
  --paper: #EDE7DA;
  --paper-dim: #9AA0AD;
  --gold: #D9A441;
  --gold-dim: #8a723a;
  --rule: #2A2D36;
  --danger: #B4432F;
  --ok: #6E8F5C;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
header.site .wrap {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
header.site .brand {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  color: var(--paper);
}
header.site nav a {
  color: var(--paper-dim);
  margin-left: 1.2rem;
  font-size: 0.92rem;
}
header.site nav a:hover { color: var(--gold); }

.listing {
  border-top: 1px solid var(--rule);
}
.listing-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.listing-row .year {
  font-variant-numeric: tabular-nums;
  color: var(--gold-dim);
  width: 3.4em;
  flex-shrink: 0;
}
.listing-row .title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  flex-grow: 1;
}
.listing-row .director {
  color: var(--paper-dim);
  font-size: 0.9rem;
}
.empty {
  color: var(--paper-dim);
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.stub {
  display: inline-block;
  padding: 0.15em 0.6em;
  border: 1px dashed var(--gold-dim);
  border-radius: 2px;
  font-size: 0.78rem;
  color: var(--paper);
}
.stub.status-draft    { border-color: var(--paper-dim); color: var(--paper-dim); }
.stub.status-pending  { border-color: var(--gold); color: var(--gold); }
.stub.status-approved { border-color: var(--ok); color: var(--ok); }
.stub.status-rejected { border-color: var(--danger); color: var(--danger); }

form { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.5rem; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--paper-dim); }
input, textarea, select {
  background: #1B1E27;
  border: 1px solid var(--rule);
  color: var(--paper);
  padding: 0.6rem 0.7rem;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1rem;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-row { display: flex; gap: 0.8rem; margin-top: 0.4rem; flex-wrap: wrap; }
button {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 3px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}
button.primary { background: var(--gold); color: var(--ink); }
button.quiet { border-color: var(--rule); color: var(--paper-dim); }
button:hover { opacity: 0.85; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.note {
  color: var(--paper-dim);
  font-size: 0.88rem;
  margin-top: -0.6rem;
}
.error {
  color: var(--danger);
  font-size: 0.9rem;
}
.admin-note {
  border-left: 2px solid var(--gold-dim);
  padding-left: 0.8rem;
  color: var(--paper-dim);
  font-size: 0.9rem;
  margin: 0.6rem 0;
}

.field-diff {
  font-size: 0.85rem;
  color: var(--paper-dim);
  margin-top: 0.3rem;
}
.field-diff b { color: var(--paper); }

/* ---- taxonomy browsing ------------------------------------------------- */

.wrap.wide { max-width: 1040px; }

.counts {
  display: flex;
  gap: 1.6rem;
  color: var(--paper-dim);
  font-size: 0.9rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.8rem 0;
  margin-bottom: 2rem;
}
.counts b { color: var(--gold); font-variant-numeric: tabular-nums; }

.facets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.6rem;
}
.facet h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
ul.tree, ul.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0.9rem;
  font-size: 0.92rem;
}
ul.tree { padding-left: 0; }
ul.tree li { margin: 0.22rem 0; }
ul.tree ul { border-left: 1px solid var(--rule); margin-left: 0.2rem; }
ul.tree.inline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; padding-left: 0; }
ul.tree.inline ul { display: none; }

.crumb { color: var(--paper-dim); font-size: 0.88rem; margin-bottom: 0.6rem; }
.crumb .sep { color: var(--rule); margin: 0 0.15rem; }
.lede { color: var(--paper-dim); margin-top: -0.2rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}
.card {
  display: block;
  color: inherit;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: #1B1E27;
}
.card:hover { border-color: var(--gold-dim); text-decoration: none; }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-noimg { width: 100%; aspect-ratio: 16 / 9; background: var(--rule); }
.card-body {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
}
.card-title { font-family: 'Fraunces', serif; font-size: 0.98rem; }
.card-year { color: var(--gold-dim); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

img.still {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin-bottom: 1.2rem;
}

table.facet-table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
table.facet-table th, table.facet-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  font-size: 0.92rem;
  vertical-align: top;
}
table.facet-table th { color: var(--paper-dim); width: 9.5rem; }

.hint { color: var(--gold-dim); font-size: 0.82rem; }
select[multiple] { height: auto; }

.prompt {
  color: var(--gold-dim);
  font-size: 0.82rem;
  line-height: 1.45;
  font-style: italic;
}
p.description { white-space: pre-wrap; margin: 1rem 0 1.4rem; }

.tc { color: var(--gold-dim); font-variant-numeric: tabular-nums; }

/* ---- autocomplete ------------------------------------------------------ */

.search-box { margin-bottom: 0.4rem; }

.ac-panel {
  display: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #1B1E27;
  margin: -0.6rem 0 1rem;
  max-height: 20rem;
  overflow-y: auto;
  position: relative;
  z-index: 5;
}
.ac-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
  cursor: pointer;
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover { background: #232735; opacity: 1; }
.ac-label { font-family: 'Fraunces', serif; flex-grow: 1; }
.ac-meta { color: var(--paper-dim); font-size: 0.85rem; white-space: nowrap; }
.ac-tag {
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  padding: 0 0.35em;
  font-size: 0.72rem;
  white-space: nowrap;
}

.chosen {
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.chosen button { padding: 0.2rem 0.6rem; font-size: 0.8rem; }

.kind {
  color: var(--gold-dim);
  font-size: 0.88rem;
  margin: -0.5rem 0 0.6rem;
}
label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
label.check input { width: auto; }
.two-up { display: flex; gap: 0.8rem; }
.two-up label { flex: 1; }
#episode-results { max-height: 24rem; }
