/* Clickable country link */
.country-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--line);
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.country-link:hover,
.country-link:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Jurisdiction Deep-Dive View */
.jurisdiction-view {
  padding: 1.5rem 0 3rem;
}

.jd-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 2rem;
}

.jd-back-btn {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(197, 166, 118, 0.25);
  background: var(--gold-dim);
  transition: background 0.15s ease;
}

.jd-back-btn:hover {
  background: rgba(197, 166, 118, 0.25);
}

.jd-breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
}

.jd-breadcrumb span {
  color: var(--text);
  font-weight: 500;
}

.jd-pager {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.jd-nav-arrow {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.jd-nav-arrow:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.jd-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
}

.jd-header-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.jd-rank-tag {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(197, 166, 118, 0.3);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-weight: 600;
}

.jd-region-tag {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

.jd-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.jd-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Stats summary cards */
.jd-stats-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.jd-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.5rem;
}

.jd-stat-card.primary {
  border-color: rgba(197, 166, 118, 0.3);
  background: linear-gradient(180deg, rgba(197, 166, 118, 0.04) 0%, var(--surface) 100%);
}

.jd-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.jd-score-large {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
}

.jd-score-denom {
  font-size: 1.1rem;
  color: var(--muted);
}

.jd-stat-val {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.5rem 0;
}

.jd-tier-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.jd-stat-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Pillar cards */
.jd-section {
  margin-bottom: 2.5rem;
}

.jd-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.jd-section-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.jd-section-head span {
  font-size: 0.75rem;
  color: var(--muted);
}

.jd-pillar-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.jd-pillar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.jd-pcard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.jd-pcard-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.jd-pcard-weight {
  font-size: 0.75rem;
  color: var(--gold);
}

.jd-pcard-meter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.jd-pcard-meter-row meter {
  flex: 1;
  height: 8px;
}

.jd-pcard-val {
  font-size: 0.85rem;
  color: var(--text);
}

.jd-pcard-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.jd-pcard-foot {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 0.5rem;
}

/* Provenance box */
.jd-provenance-box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.5rem;
}

.jd-provenance-box p {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.jd-action-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.jd-more-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
}

.jd-more-link:hover {
  text-decoration: underline;
}

.methodology-sources {
  list-style: none;
  margin: 1rem 0 1.5rem;
}

.methodology-sources li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.methodology-sources li strong {
  color: var(--gold);
}

@media (max-width: 800px) {
  .jd-stats-grid {
    grid-template-columns: 1fr;
  }
}
