/* ============================================
   Judicial Retention Page
   Iowa Voter Guide — Cool Prairie palette
   Reuses combobox styles from state-legislature.css patterns.
   ============================================ */

/* ---- County Lookup (matches State Legislature) ---- */

.county-lookup {
  max-width: 480px;
  margin: 0 auto 1.5rem auto;
}

.lookup-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.lookup-help {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.combobox-wrapper { position: relative; }

.combobox-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: 4px;
  background-color: #ffffff;
  color: var(--text-primary);
  box-sizing: border-box;
}

.combobox-input:focus {
  outline: none;
  border-color: var(--accent-pine);
  box-shadow: 0 0 0 3px rgba(58, 84, 64, 0.15);
}

.combobox-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.combobox-option {
  padding: 0.6rem 1rem;
  cursor: pointer;
  color: var(--text-primary);
  border-bottom: 1px solid #f0ede0;
}
.combobox-option:last-child { border-bottom: none; }
.combobox-option.active,
.combobox-option:hover {
  background-color: #f5f3ea;
  color: var(--accent-pine);
}

.combobox-empty {
  padding: 0.75rem 1rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---- Selection summary ---- */

.jr-summary {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-pine);
  border-radius: 4px;
  padding: 1rem 1.25rem;
}
.jr-summary { scroll-margin-top: 90px; }
.jr-summary[hidden] { display: none; }
.jr-summary-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--accent-pine);
  margin: 0 0 0.35rem;
}
.jr-summary p { font-size: 0.95rem; margin: 0 0 0.6rem; color: var(--text-secondary); }
.jr-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  font-size: 0.92rem;
}
.jr-link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--accent-pine);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.jr-link-button:hover { color: var(--accent-pine-dark); }

/* ---- District index ---- */

.jr-district-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}
.jr-district-index[hidden] { display: none; }
.jr-district-index a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  text-decoration: none;
}
.jr-district-index a:hover { border-color: var(--accent-pine); }

/* ---- Court / district blocks ---- */

.jr-court { padding: 2rem 0 0.5rem; }
.jr-court[hidden] { display: none; }
.jr-court + .jr-court { border-top: 1px solid var(--border-soft); }

.jr-court-header { margin-bottom: 1.25rem; }
.jr-court-title { margin-bottom: 0.25rem; }
.jr-court-meta {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0;
}
.jr-court-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-wheat);
  margin-bottom: 0.3rem;
}

.jr-judges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

/* ---- Judge card ---- */

.judge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
  padding: 1.1rem 1.25rem 0.9rem;
  display: flex;
  flex-direction: column;
}

.judge-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}
.judge-court {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-pine);
  margin: 0.2rem 0 0.6rem;
}
.judge-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 0.75rem;
}
.judge-bio a { font-size: 0.85rem; white-space: nowrap; }

.judge-survey {
  border-top: 1px solid var(--border-soft);
  padding-top: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.judge-survey-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.1rem;
}
.judge-survey strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.judge-ratings { margin-top: 0.6rem; }
.judge-ratings summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent-pine);
}
.judge-ratings summary:hover { color: var(--accent-pine-dark); }
.judge-ratings table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.82rem;
}
.judge-ratings caption {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0.5rem 0 0.25rem;
}
.judge-ratings td {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.4;
}
.judge-ratings td.score {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
  padding-left: 0.75rem;
  white-space: nowrap;
}

/* ---- FAQ ---- */

.jr-faq details {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.75rem 0;
  max-width: 760px;
}
.jr-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.jr-faq details p { margin: 0.6rem 0 0; color: var(--text-secondary); font-size: 0.95rem; }

.jr-intro { max-width: 760px; }
.jr-intro p { color: var(--text-secondary); }

@media (max-width: 640px) {
  .jr-judges { grid-template-columns: 1fr; }
}

@media print {
  .top-nav, .share-section, footer, .county-lookup, .jr-summary-actions, .jr-district-index { display: none !important; }
  .judge-ratings[open] summary { display: none; }
  .judge-card { break-inside: avoid; box-shadow: none; }
}
