/* ═══════════════════════════════════════════════
   LSS-KOMMUNINDEX — Celeste Omsorg
   Sorterbar tabell över 290 kommuner
   ═══════════════════════════════════════════════ */

.index-container {
  max-width: 1240px;
  margin: 120px auto 64px;
  padding: 0 32px;
}

.index-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(59, 90, 138, 0.1);
}
.index-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 300;
  color: var(--midnight);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.index-header h1 em {
  font-style: italic;
  color: var(--celestial);
}
.index-header .lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 300;
  max-width: 720px;
}
.index-header .updated {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--celestial);
  margin-bottom: 18px;
}

/* ─── FILTER BAR ──────────────────────────────── */
.index-filters {
  display: flex; flex-wrap: wrap;
  gap: 12px; align-items: center;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: rgba(247, 243, 238, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(59, 90, 138, 0.08);
}
.index-filter-group { display: flex; flex-direction: column; gap: 4px; }
.index-filter-group label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--celestial);
}
.index-filter-group select,
.index-filter-group input {
  padding: 8px 12px; min-width: 160px;
  border-radius: 8px;
  border: 1px solid rgba(59, 90, 138, 0.18);
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--ink);
}
.index-filter-count {
  margin-left: auto;
  font-size: 13px; font-weight: 500;
  color: var(--midnight);
}

/* ─── TABLE ───────────────────────────────────── */
.index-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid rgba(59, 90, 138, 0.08); }
.index-table { width: 100%; border-collapse: collapse; background: #fff; }
.index-table th,
.index-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid rgba(59, 90, 138, 0.05);
}
.index-table th {
  background: rgba(212, 228, 244, 0.3);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--midnight);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.index-table th:hover { background: rgba(212, 228, 244, 0.5); }
.index-table th.sort-asc::after { content: ' ↑'; color: var(--celestial); }
.index-table th.sort-desc::after { content: ' ↓'; color: var(--celestial); }
.index-table td { color: var(--ink); }
.index-table tr:hover td { background: rgba(247, 243, 238, 0.5); }
.index-table a {
  color: var(--midnight);
  text-decoration: none;
  font-weight: 500;
}
.index-table a:hover { color: var(--celestial); text-decoration: underline; }

/* ─── RISK HEATMAP ────────────────────────────── */
.risk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}
.risk-low    { background: rgba(123, 168, 130, 0.18); color: #3a6644; }
.risk-medium { background: rgba(212, 168, 74, 0.22); color: #7a5a10; }
.risk-high   { background: rgba(232, 184, 168, 0.45); color: #9e3a1e; }
.risk-severe { background: rgba(180, 60, 60, 0.85); color: #fff; }

.utbud-pill {
  display: inline-block; padding: 2px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
}
.utbud-underskott { background: rgba(232, 184, 168, 0.4); color: #8c3921; }
.utbud-balans     { background: rgba(212, 228, 244, 0.6); color: var(--midnight); }
.utbud-overskott  { background: rgba(123, 168, 130, 0.2); color: #3a6644; }
.utbud-ej_svar    { background: rgba(200, 200, 200, 0.25); color: #666; }

/* ─── CTA-BLOCK ───────────────────────────────── */
.index-cta {
  margin: 48px 0 24px;
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(212, 228, 244, 0.22) 0%, rgba(247, 243, 238, 0.5) 100%);
  border: 1px solid rgba(59, 90, 138, 0.1);
  border-radius: 16px;
}
.index-cta h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px; font-weight: 400;
  color: var(--midnight);
  margin-bottom: 8px;
}
.index-cta p {
  font-size: 14px; line-height: 1.7;
  color: var(--ink); margin-bottom: 16px;
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 760px) {
  .index-container { margin-top: 80px; padding: 0 18px; }
  .index-table th,
  .index-table td { padding: 10px 8px; font-size: 12px; }
  .index-table th.col-lan,
  .index-table td.col-lan { display: none; }
  .index-filter-group select,
  .index-filter-group input { min-width: 0; width: 100%; }
}
