/* ============================================================
   geo-page.css — Geographical HTML Page Component Styles

   The AI-generated page fragment is styled exclusively through the
   `geo-*` class names below (no inline styles). Every class maps 1:1 to
   the component list in PageGeneratorService::MASTER_PROMPT and the
   whitelist in HtmlFragmentSanitizer.

   The fragment is injected inside `.generated-content` (statistik.css),
   which carries generic h2/p/table typography for legacy pages. Those
   generic rules out-rank a bare `.geo-*` class, so every selector here is
   scoped under `.generated-content` to reliably win. The palette is fixed
   (light) so the page renders identically in both site themes.
   ============================================================ */

/* A geo-page provides its own light canvas, so drop the legacy card wrapper
   around it (no double padding/border). Older fallback pages without a
   geo-page keep that wrapper. */
.generated-content:has(> .geo-page) {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ── Page Wrapper (self-contained light canvas) ───────────── */
.generated-content .geo-page {
  color-scheme: light;
  font-family: 'Segoe UI', Arial, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  background: #ffffff;
  color: #222;
  border-radius: 12px;
}
/* Keep the document visibly light against the dark page in dark mode. */
@media (prefers-color-scheme: dark) {
  .generated-content .geo-page {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  }
}

/* ── Hero Header ──────────────────────────────────────────── */
.generated-content .geo-hero {
  background: linear-gradient(135deg, #003f7f 0%, #0066cc 100%);
  color: #fff;
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.13);
}
/* All hero text is white: the layout's generic ".main-content p" rule colours
   any <p> dark, which would override the white inherited from the hero, so
   re-assert it for every text element inside the hero. */
.generated-content .geo-hero p,
.generated-content .geo-hero h1,
.generated-content .geo-hero h2,
.generated-content .geo-hero span,
.generated-content .geo-hero div {
  color: #fff;
}

.generated-content .geo-hero__eyebrow {
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.75;
}

.generated-content .geo-hero__title {
  margin: 0.3rem 0 0.5rem;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  border: none;
  padding: 0;
}

.generated-content .geo-hero__subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
  opacity: 0.88;
}

.generated-content .geo-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.generated-content .geo-hero__chip {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.92rem;
}

/* ── Alert / Hint Box ─────────────────────────────────────── */
.generated-content .geo-alert {
  background: #fff8e1;
  border-left: 5px solid #f5a623;
  border-radius: 8px;
  padding: 1rem 1.4rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: #5a4a16;
}

/* ── Section Wrapper ──────────────────────────────────────── */
.generated-content .geo-section {
  margin-bottom: 2.5rem;
}

/* ── Section Heading (H2) ─────────────────────────────────── */
.generated-content .geo-section__heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: #003f7f;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 0.4rem;
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

/* ── Body Paragraph ───────────────────────────────────────── */
.generated-content .geo-paragraph {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #444;
}

/* ── Stat Card Grid ───────────────────────────────────────── */
.generated-content .geo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.generated-content .geo-card {
  background: #f0f6ff;
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.generated-content .geo-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: #0066cc;
}

.generated-content .geo-card__label {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.3rem;
}

.generated-content .geo-card__badge {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  border-radius: 12px;
  padding: 0.2rem 0.7rem;
  display: inline-block;
  color: #fff;
}

.generated-content .geo-card__badge--state {
  background: #0066cc;
}

.generated-content .geo-card__badge--national {
  background: #27ae60;
}

/* ── Data Table ───────────────────────────────────────────── */
.generated-content .geo-table-wrapper {
  overflow-x: auto;
  margin-top: 1.25rem;
}

.generated-content .geo-table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}

.generated-content .geo-table thead tr {
  background: #003f7f;
}

/* Override the legacy forced-light header (.generated-content thead th is
   !important) so the geo table keeps its dark blue header with white text. */
.generated-content .geo-table thead th {
  background: #003f7f !important;
  color: #fff !important;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: none;
  white-space: nowrap;
}

.generated-content .geo-table th.geo-table__th--num {
  text-align: right;
}

.generated-content .geo-table th.geo-table__th--rank {
  text-align: center;
}

.generated-content .geo-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e0e8f5;
  color: #222;
}

.generated-content .geo-table td.geo-table__td--num {
  text-align: right;
  color: #0066cc;
  font-weight: 600;
}

.generated-content .geo-table td.geo-table__td--rank {
  text-align: center;
}

.generated-content .geo-table tbody tr:nth-child(odd) {
  background: #f9fbff;
}

.generated-content .geo-table tbody tr:nth-child(even) {
  background: #ffffff;
}

.generated-content .geo-table tbody tr:hover td {
  background: #eef4ff;
}

.generated-content .geo-table__rank-pill {
  background: #27ae60;
  color: #fff;
  border-radius: 10px;
  padding: 0.15rem 0.6rem;
  display: inline-block;
}
