/* Map-first refresh (2026-11-23): the map is the protagonist of the Japan
   map pages. Loaded last by the site shell; every rule is scoped to the
   Japan map pages so other pages are unaffected. Data, wording and
   aggregation are untouched — this file only changes layout and sizes. */

/* Desktop and large tablets: give the map column the width. The side
   columns keep everything they hold, just narrower, and the prefecture
   list shows more rows at once instead of leaving blank space below. */
@media (min-width: 1100px) {
  /* Home page only: /japan keeps its established column geometry, whose
     heading rows and map overlays are tuned to it. */
  html body[data-home-dashboard][data-design][data-map-page="japan"] #main #panel-regions .explorer-grid {
    grid-template-columns: 340px minmax(0, 1fr) 340px !important;
  }
  /* The narrower home column must not clip the headings that sit in it.
     The reading stylesheet fixes h1/h2 at 32px/24px with !important, so
     these overrides carry !important too. */
  html body[data-home-dashboard][data-design][data-map-page="japan"] #main .explorer-heading h1 {
    font-size: 24px !important;
  }
  html body[data-home-dashboard][data-design][data-map-page="japan"] #main #panel-regions > .section-heading > div {
    min-width: 0;
  }
  html body[data-home-dashboard][data-design][data-map-page="japan"] #main #panel-regions > .section-heading h2 {
    font-size: 20px !important;
    white-space: normal !important;
  }
}

/* Wide screens: the home section heading sits in the left column's band;
   cap its box to that band so the title wraps instead of sliding under
   the map panel. */
@media (min-width: 1500px) {
  html body[data-home-dashboard][data-design][data-map-page="japan"] #main #panel-regions > .section-heading > div {
    flex: 0 1 auto !important;
    max-width: 330px;
  }
  html body[data-design][data-map-page="japan"] #panel-regions .map-stage {
    height: clamp(540px, calc(100vh - 250px), 880px) !important;
    min-height: 540px !important;
    max-height: 880px !important;
  }
  html body[data-design][data-map-page="japan"] .explorer-picker .prefecture-list {
    max-height: 288px;
  }
}

/* Home page, wider screens: the view tabs and map filters sit above the
   map (first screen), the report action stays directly under the map.
   The card is a grid, so this only swaps the rows; nothing is moved in
   the document and all wiring is preserved. Narrow screens keep the
   existing tuned order. */
@media (min-width: 721px) {
  html body[data-home-dashboard] #panel-regions .map-canvas .map-stage {
    grid-area: 2 / 1 / 3 / -1 !important;
  }
  html body[data-home-dashboard] #home-map-controls:not([hidden]) {
    grid-row: 1 !important;
    margin-block: 0 10px;
  }
  html body[data-home-dashboard] #home-map-post {
    grid-row: 3 !important;
  }
}

/* Reading sizes on the map pages: panel body text is 16px, supporting
   notes are 14px, at every width. */
html body[data-design][data-map-page="japan"] .dashboard-side section {
  font-size: 16px;
}
html body[data-design][data-map-page="japan"] .dashboard-side :is(.dashboard-record span, .dashboard-record small) {
  font-size: 14px;
}
html body[data-design][data-map-page="japan"] .explorer-picker {
  font-size: 16px;
}
html body[data-design][data-map-page="japan"] .explorer-picker .prefecture-row {
  font-size: 16px;
}
html body[data-design][data-map-page="japan"] .explorer-picker .search-field input {
  font-size: 16px;
}
html body[data-design][data-map-page="japan"] .explorer-picker :is(.region-search-hint, .prefecture-list-hint) {
  font-size: 14px;
}
