/* ============================================================
   SF Book Club — shared design system
   Dark, literary, warm-gold accent. Used by index/poll/winner.
   ============================================================ */

:root {
  --bg: #0e0f12;
  --card: #14161b;
  --ink: #e8ebf1;
  --muted: #a9b0c3;
  --accent: #c5a572;
  --accent-ink: #0b0c0f;
  --danger: #ef8f8f;
  --success: #9ed7ae;
  --line: rgba(255, 255, 255, 0.08);
  --soft: rgba(197, 165, 114, 0.1);
  --ring: 2px solid rgba(197, 165, 114, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(197, 165, 114, 0.09), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(197, 165, 114, 0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

h1, h2, h3 {
  margin: 0;
}

h2 {
  font: 700 24px/1.15 Literata, Georgia, serif;
  margin-bottom: 12px;
}

h3 {
  font: 700 15px/1.2 Inter, system-ui;
  margin-bottom: 6px;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- shared header / nav ---------- */

.site-header {
  max-width: 980px;
  margin: 32px auto 16px;
  padding: 0 20px;
}

.site-header .title {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(197, 165, 114, 0.25), rgba(197, 165, 114, 0.05)),
    radial-gradient(70% 80% at 50% 10%, rgba(197, 165, 114, 0.55), rgba(197, 165, 114, 0.15) 60%, transparent 61%),
    var(--card);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
}

.logo span {
  font-family: Literata, Georgia, serif;
  font-size: 24px;
}

.site-title-text h1 {
  font: 700 26px/1.1 Literata, Georgia, serif;
}

.site-title-text .sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* ---------- cards ---------- */

.card {
  max-width: 980px;
  margin: 16px auto;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.group {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.group h3 {
  margin: 0 0 8px;
  font: 600 14px/1 Inter, system-ui;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

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

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

/* ---------- badges / eyebrows ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 1px solid rgba(197, 165, 114, 0.28);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.badge.open {
  border-color: rgba(158, 215, 174, 0.35);
  background: rgba(158, 215, 174, 0.1);
  color: var(--success);
}

.badge.closed {
  border-color: rgba(197, 165, 114, 0.35);
  background: var(--soft);
  color: var(--accent);
}

/* ---------- buttons / links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(197, 165, 114, 0.35);
  background: rgba(197, 165, 114, 0.1);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn.primary {
  background: linear-gradient(180deg, #e9cf9e, #c5a572);
  color: var(--accent-ink);
  border: 0;
  box-shadow: 0 10px 22px rgba(197, 165, 114, 0.25), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.btn:hover {
  outline: var(--ring);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- poll voting form ---------- */

.selection-count {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.vote-reminder {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.options {
  display: grid;
  gap: 10px;
}

label.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: 0.18s ease;
}

label.option:hover {
  outline: var(--ring);
}

label.option.selected {
  border-color: rgba(197, 165, 114, 0.72);
  background: rgba(197, 165, 114, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}

label.option input[type="checkbox"] {
  margin-top: 5px;
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.book-cover-thumb {
  width: 56px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.03);
}

.book-title {
  font-weight: 700;
  font-size: 16px;
}

.book-author {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.genre-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.genre-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(197, 165, 114, 0.12);
  border: 1px solid rgba(197, 165, 114, 0.28);
  color: #e4cfaa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.description-block {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.goodreads-line {
  margin-top: 10px;
  font-size: 13px;
}

/* ---------- form fields ---------- */

input[type="text"],
input[type="date"],
input[type="month"],
input[type="datetime-local"],
input[type="number"],
input[type="url"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
  outline: var(--ring);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.name-area {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- messages / toast ---------- */

.message {
  min-height: 22px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 18px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  inset: auto 16px 16px auto;
  background: #101215;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s;
  pointer-events: none;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- results / bars ---------- */

.results-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.result-row {
  margin: 13px 0;
}

.label-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
}

.label-line span:first-child {
  max-width: 72%;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #e9cf9e, #c5a572);
  transition: width 0.4s ease;
}

/* ---------- winner page ---------- */

.hero {
  max-width: 980px;
  margin: 16px auto;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)), var(--card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, transparent 0%, transparent 58%, rgba(197, 165, 114, 0.06) 58%, rgba(197, 165, 114, 0.02) 100%);
}

.hero h1 {
  font: 800 clamp(36px, 6.5vw, 68px)/0.98 Literata, Georgia, serif;
  letter-spacing: -0.03em;
  max-width: 640px;
}

.winner-line {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
}

.meetup-date {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid rgba(197, 165, 114, 0.35);
  background: rgba(197, 165, 114, 0.08);
  color: var(--ink);
  font-weight: 700;
}

.meetup-date span.icon {
  color: var(--accent);
  font-size: 18px;
}

.book-cover-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: radial-gradient(circle at 50% 0%, rgba(197, 165, 114, 0.17), transparent 56%), rgba(0, 0, 0, 0.18);
  display: grid;
  align-content: center;
  min-height: 300px;
  text-align: center;
}

.book-cover-image {
  display: block;
  width: min(230px, 78%);
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.45);
}

.fact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--line);
  color: var(--muted);
}

.fact-list strong {
  color: var(--ink);
}

.rating {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.stars {
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--accent);
  white-space: nowrap;
}

.big-rating {
  font: 800 42px/1 Literata, Georgia, serif;
  color: var(--ink);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

blockquote {
  margin: 0;
  padding: 14px;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 14px;
}

blockquote cite {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.store {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.neighborhood {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.store-name {
  font-weight: 800;
}

.address {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.video-list {
  display: grid;
  gap: 10px;
}

.video {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  color: var(--ink);
  text-decoration: none;
}

.video small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.source-list {
  columns: 2;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.source-list li {
  break-inside: avoid;
  margin-bottom: 6px;
}

/* ---------- image placeholders ---------- */

.img-placeholder {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 28px;
  aspect-ratio: 2 / 3;
}

/* ---------- home page state cards ---------- */

.home-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.home-hero .book-cover-thumb-lg {
  width: 110px;
  height: 165px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  flex: 0 0 auto;
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 980px;
  margin: 24px auto 44px;
  padding: 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--accent);
}

.site-footer .admin-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.7;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .hero,
  .review-grid,
  .store-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .card {
    margin-left: 12px;
    margin-right: 12px;
    padding: 18px;
  }

  .site-header,
  .site-footer {
    margin-top: 24px;
  }

  .source-list {
    columns: 1;
  }

  .video {
    display: block;
  }

  .meetup-date {
    width: 100%;
  }

  label.option {
    flex-wrap: wrap;
  }
}
