/* ==========================================================================
   Report page layout — hero + interactive Mapbox choropleth + writeup.
   Loaded on top of base.css by each report's index.html.
   ========================================================================== */

/* Hero (soft brand-wash band, full-bleed) --------------------------------- */
.report-hero { padding: 3rem 0 2.5rem; background-image: var(--brand-wash); }
.report-hero h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); max-width: 20ch; margin-top: 1rem; }
.report-hero .lede { font-size: 1.125rem; color: #33414f; max-width: 62ch; margin-top: 1rem; }

/* Stat band (grid gap-px on neutral-200, white cells) --------------------- */
.report-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--color-neutral-200);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius); overflow: hidden;
  margin-top: 2rem; max-width: 36rem;
}
.report-meta .stat { background: #fff; padding: 1rem 1.25rem; }
.report-meta .stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--color-ink); line-height: 1.1; }
.report-meta .stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-neutral-500); margin-top: .15rem; }

/* Quick-jump city buttons ------------------------------------------------- */
.city-jump { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.cj-btn {
  border: 1px solid var(--color-neutral-200); background: #fff; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--color-ink);
  padding: .4rem .85rem; border-radius: 999px; transition: background .15s ease, border-color .15s ease;
}
.cj-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Map + panel ------------------------------------------------------------- */
.map-section { padding: 1rem 0 2.5rem; }
.map-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 900px) {
  .map-shell { grid-template-columns: 1fr 20rem; }
}

.map-canvas {
  position: relative;
  min-height: 62vh;
  height: 62vh;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #eef1f4;
}
#map { position: absolute; inset: 0; }

/* Controls / legend / detail panel ---------------------------------------- */
.map-panel {
  display: flex; flex-direction: column; gap: 1rem;
}
.panel-card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
}
.panel-card h3 { font-size: .95rem; margin-bottom: .6rem; }

/* Statistical-area level switcher (LGA / Suburb / SA2 ...) */
.level-switch { display: inline-flex; background: var(--color-neutral-100); border-radius: 999px; padding: .2rem; gap: .2rem; }
.level-switch button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--color-neutral-500);
  padding: .35rem .8rem; border-radius: 999px;
}
.level-switch button[aria-pressed="true"] { background: #fff; color: var(--color-ink); box-shadow: var(--shadow-sm); }

/* Metric selector + search input */
.metric-select { width: 100%; font: inherit; padding: .5rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--color-neutral-200); background: #fff; }
#area-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(27,133,96,.15); }

/* Inline autocomplete dropdown */
.autocomplete { position: relative; }
.ac-list {
  list-style: none; margin: .4rem 0 0; padding: .25rem;
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 17rem; overflow-y: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.ac-item:hover, .ac-item.active { background: var(--color-neutral-100); }
.ac-group {
  padding: .5rem .6rem .25rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--color-neutral-500);
  pointer-events: none;
}
.ac-group:not(:first-child) { border-top: 1px solid var(--color-neutral-100); margin-top: .25rem; }
.ac-name { color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-val { color: var(--color-primary-hover); font-weight: 600; font-size: .82rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* Legend (choropleth ramp) */
.legend-scale { display: flex; height: .6rem; border-radius: 999px; overflow: hidden; margin: .5rem 0 .35rem; }
.legend-scale span { flex: 1; }
.legend-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--color-neutral-500); }

/* Selected-area readout */
.area-readout .name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.area-readout .rows { margin-top: .6rem; display: grid; gap: .4rem; }
.area-readout .row { display: flex; justify-content: space-between; font-size: .88rem; }
.area-readout .row .k { color: var(--color-neutral-500); }
.area-readout .row .v { font-weight: 600; }
.area-readout .empty { color: var(--color-neutral-500); font-size: .88rem; }

/* Map hover tooltip */
.map-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--color-ink); color: #fff;
  font-size: .78rem; padding: .35rem .55rem; border-radius: 6px;
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
  opacity: 0; transition: opacity .1s ease;
}

/* Writeup ----------------------------------------------------------------- */
.report-body { padding: 1rem 0 4rem; }
.report-body .prose { max-width: 65ch; }
.report-body .prose h2 { font-size: 1.6rem; margin-top: 2.5rem; }
.report-body .prose h3 { font-size: 1.2rem; margin-top: 1.75rem; }
.report-body .prose p { margin: 1rem 0; color: #33414f; }
.report-body .prose ul { padding-left: 1.2rem; color: #33414f; }
