/* Hazel Street Book Club: a corner of a second-hand bookshop. */
:root {
  color-scheme: light;
  --rst-bg: #f3e9d6;
  --rst-surface: #fbf6ea;
  --rst-surface-2: #efe3c9;
  --rst-text: #2e211a;
  --rst-text-muted: #5a4638;
  --rst-line: #dcc9a6;
  --rst-line-strong: #8a6f50;
  --rst-accent: #7a2530;
  --rst-accent-soft: #f4e1d6;
  --rst-accent-fill: #7a2530;
  --rst-accent-fill-hover: #651d27;
  --rst-accent-fill-edge: #551820;
  --rst-accent-fill-edge-hover: #48131b;
  --rst-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rst-radius: 10px;
  --rst-radius-sm: 6px;
  --rst-depth-ambient: rgba(74, 48, 28, 0.10);
  --rst-depth-contact: rgba(74, 48, 28, 0.16);
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --moss: #3f5a3a;
  --spine-1: #2f4f6a;
  --spine-2: #8a4b1f;
  --spine-3: #3f5a3a;
  --spine-4: #7a2530;
}

html { background: var(--rst-bg); }
body {
  margin: 0;
  color: var(--rst-text);
  background-color: var(--rst-bg);
  /* faint paper grain: soft blotches over fine horizontal fibres */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(168, 116, 60, 0.08), transparent 38%),
    radial-gradient(circle at 88% 70%, rgba(122, 37, 48, 0.06), transparent 42%),
    repeating-linear-gradient(0deg, rgba(90, 70, 56, 0.035) 0 1px, transparent 1px 6px);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, .title, .row-title, .headline, .stamp, .eyebrow {
  font-family: var(--serif);
}

/* ---------- hero band ---------- */
.hero {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(255, 236, 200, 0.55), transparent 60%),
    linear-gradient(180deg, #ead8b6 0%, #e2cba2 100%);
  border-bottom: 1px solid #c9ad80;
  box-shadow: inset 0 -14px 0 #8a5a34, inset 0 -16px 0 #6d4527, 0 6px 14px rgba(74, 48, 28, 0.18);
  padding: 2.25rem 1.25rem 2.75rem;
}
.hero-inner {
  max-width: 60rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1rem;
}
.hero-text { max-width: 36rem; }
.hero-art { width: min(15rem, 70vw); height: auto; flex: none; }
.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--moss);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: 2.6rem;
  line-height: 1.05;
  font-weight: 700;
  color: #3a1f19;
  letter-spacing: -0.01em;
}
.lede { margin: 0; font-size: 1.05rem; line-height: 1.6; color: #4a382c; }

@media (min-width: 760px) {
  .hero { padding: 3.25rem 2rem 3.75rem; }
  .hero-inner { flex-direction: row; justify-content: space-between; gap: 2.5rem; }
  .hero h1 { font-size: 3.75rem; }
  .hero-art { width: 16rem; }
}

/* ---------- page column ---------- */
.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
  box-sizing: border-box;
}
.page h2 {
  font-size: 1.7rem;
  margin: 0 0 0.9rem;
  color: #3a1f19;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page h2::after {
  content: "";
  flex: 1;
  height: 6px;
  background: radial-gradient(circle, #b59a73 1.2px, transparent 1.6px) 0 50% / 9px 6px repeat-x;
}

.ballot, .results {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius);
  padding: 1.4rem 1.1rem;
  box-shadow: 0 1px 0 #fff inset, 0 10px 24px var(--rst-depth-ambient), 0 2px 4px var(--rst-depth-contact);
  margin-bottom: 1.75rem;
}
@media (min-width: 640px) { .ballot, .results { padding: 1.8rem 2rem; } }

.name-field { max-width: 22rem; }
.name-field [rst-field-hint] { color: var(--rst-text-muted); }

/* ---------- book cards: old library cards ---------- */
.shelf { grid-template-columns: 1fr; gap: 0.85rem; }
@media (min-width: 640px) { .shelf { grid-template-columns: 1fr 1fr; } }

.shelf label.card {
  position: relative;
  background-color: #fffaf0;
  background-image:
    linear-gradient(180deg, transparent 0 2.6rem, rgba(122, 37, 48, 0.28) 2.6rem calc(2.6rem + 1px), transparent calc(2.6rem + 1px)),
    repeating-linear-gradient(180deg, transparent 0 1.55rem, rgba(47, 79, 106, 0.12) 1.55rem calc(1.55rem + 1px));
  border-color: var(--rst-line);
  border-radius: var(--rst-radius-sm);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 2px 0 #e7d7b8, 0 4px 10px var(--rst-depth-ambient);
  transition: transform 120ms ease, box-shadow 120ms ease;
  min-height: 44px;
}
.shelf label.card:hover { transform: translateY(-2px) rotate(-0.4deg); }
.shelf label.card:has(input:checked) {
  background-color: #fbeee6;
  border-color: var(--rst-accent);
  box-shadow: 0 0 0 2px var(--rst-accent), 0 6px 14px var(--rst-depth-contact);
}
.shelf input[type=radio] { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; }
.card-body { display: block; min-width: 0; }
.call {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.7rem;
}
.spine-1 .call { background: var(--spine-1); }
.spine-2 .call { background: var(--spine-2); }
.spine-3 .call { background: var(--spine-3); }
.spine-4 .call { background: var(--spine-4); }
.shelf .title { font-size: 1.2rem; font-weight: 700; line-height: 1.25; color: #2e211a; }
.author { display: block; font-style: italic; color: var(--rst-text-muted); margin: 0.15rem 0 0.35rem; }
.shelf .blurb { font-size: 0.95rem; color: #4a382c; }

.cast { margin-top: 0.5rem; min-height: 2.9rem; padding-inline: 1.6rem; font-size: 1.05rem; width: 100%; }
@media (min-width: 640px) { .cast { width: auto; } }

.oops {
  background: #f7dcd6;
  color: #5c1720;
  padding: 0.75rem 1rem;
  border-radius: var(--rst-radius-sm);
  margin: 0 0 1rem;
}

/* ---------- thank-you with a library stamp ---------- */
.thanks {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #e8efdf;
  color: #26361f;
  border-radius: var(--rst-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--rst-depth-ambient);
}
.thanks p { margin: 0; line-height: 1.5; }
.stamp {
  flex: none;
  transform: rotate(-9deg);
  border: 3px double #7a2530;
  color: #7a2530;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.7);
}

/* ---------- results ---------- */
.headline { font-size: 1.25rem; margin: 0 0 1.1rem; line-height: 1.4; }
.tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.6rem; margin-bottom: 0.35rem; }
.row-title { font-weight: 700; font-size: 1.05rem; flex: 1 1 12rem; min-width: 0; }
.count { color: var(--rst-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  display: inline-block;
  transform: rotate(-3deg);
  background: var(--moss);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.track {
  height: 0.85rem;
  background: var(--rst-surface-2);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(74, 48, 28, 0.15);
}
.bar { display: block; height: 100%; border-radius: 999px; min-width: 0; }
.bar.spine-1 { background: var(--spine-1); }
.bar.spine-2 { background: var(--spine-2); }
.bar.spine-3 { background: var(--spine-3); }
.bar.spine-4 { background: var(--spine-4); }
.voters { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--rst-text-muted); overflow-wrap: anywhere; }

.foot { display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: var(--rst-text-muted); font-style: italic; font-family: var(--serif); }
.foot p { margin: 0; }
.foot-leaf { width: 2rem; height: 1rem; }

input:is([type=date], [type=time], [type=datetime-local]) { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; display: block; min-height: 2.75rem; }
[rst-input] { min-height: 2.75rem; max-width: 100%; box-sizing: border-box; }

/* bar widths in 5% steps (inline styles are blocked by the page's security policy) */
.bar-0 { width: 0%; }
.bar-1 { width: 5%; }
.bar-2 { width: 10%; }
.bar-3 { width: 15%; }
.bar-4 { width: 20%; }
.bar-5 { width: 25%; }
.bar-6 { width: 30%; }
.bar-7 { width: 35%; }
.bar-8 { width: 40%; }
.bar-9 { width: 45%; }
.bar-10 { width: 50%; }
.bar-11 { width: 55%; }
.bar-12 { width: 60%; }
.bar-13 { width: 65%; }
.bar-14 { width: 70%; }
.bar-15 { width: 75%; }
.bar-16 { width: 80%; }
.bar-17 { width: 85%; }
.bar-18 { width: 90%; }
.bar-19 { width: 95%; }
.bar-20 { width: 100%; }

/* Example mode: one-line note at the top of the showcase copy. */
.example-note { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 0.5rem 1rem; text-align: center; font-family: var(--rst-font, system-ui, sans-serif); font-size: 0.875rem; line-height: 1.4; font-weight: 400; letter-spacing: normal; text-transform: none; background: var(--rst-accent-soft); color: var(--rst-text); }
.example-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
