/* LUNAX Fire Calendar styles. Owner issue: JA-5. SCOPE: R1, O2. */
:root { --bg: #ffffff; --fg: #1b1f23; --muted: #57606a; --line: #d0d7de; --accent: #0b5cad; --warn-bg: #fff4d6; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181c; --fg: #e6e8ea; --muted: #9aa4ad; --line: #343b43; --accent: #6cb2ff; --warn-bg: #3a3118; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
header, main, footer { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 24px; }
h1 { margin: 0 0 4px; font-size: 1.8rem; }
h2 { margin: 28px 0 8px; font-size: 1.2rem; }
a { color: var(--accent); }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.notice { background: var(--warn-bg); border-left: 4px solid #c28a00; padding: 8px 12px; margin: 8px 0; }
.notice:empty { display: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0; }
label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 2px; }
input, select, button { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
input[type=number] { width: 7.5em; }
button { cursor: pointer; background: var(--accent); color: #fff; border-color: var(--accent); }
button[type=button]#bbox-reset, button.secondary { background: transparent; color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #f5a623; outline-offset: 2px; }
#map { height: min(75vh, 720px); min-height: 360px; border: 1px solid var(--line); border-radius: 6px; } /* DE-22 */
#map:fullscreen { height: 100%; border-radius: 0; }
.map-fullscreen { padding: 4px 8px; font-size: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.chart { width: 100%; min-height: 360px; }
#compare.chart { min-height: 320px; }
footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; padding-bottom: 32px; font-size: .85rem; color: var(--muted); }
@media (max-width: 600px) { h1 { font-size: 1.4rem; } #map { height: 60vh; } input[type=number] { width: 6em; } }
.map-legend { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: .78rem; line-height: 1.35; max-width: 220px; }
.map-legend-bar { height: 10px; border-radius: 3px; margin: 4px 0 2px; }
.map-legend-scale { display: flex; justify-content: space-between; }
.map-legend-swatch { display: inline-block; width: 10px; height: 10px; vertical-align: middle; border: 1px solid #888; }
/* DE-21 points: sensor colors as SENSOR_COLORS in docs/js/map.js */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dot.modis, .cluster.modis { background: #0072B2; } .dot.viirs, .cluster.viirs { background: #D55E00; }
.cluster { display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 2px solid #fff; border-radius: 10px; color: #fff; font: 600 11px/1 system-ui, sans-serif; box-shadow: 0 0 2px rgba(0,0,0,.5); }
/* DE-27: day and satellite of the GIBS image */
.map-imagery { max-width: 280px; }
.map-imagery input { font: inherit; margin-top: 4px; }
@media (max-width: 600px) { .map-legend { max-width: 160px; font-size: .7rem; } .map-imagery { max-width: 150px; } .map-imagery input { width: 100%; box-sizing: border-box; } }
.recurrence-overlay { image-rendering: pixelated; } /* DE-26: keep 1 km cells sharp when zoomed in */
/* Map view panel inside the map (DE-22, DE-26, DE-29) */
.map-panel { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.35); width: 280px; max-height: 70vh; overflow: auto; font-size: .82rem; }
.map-panel summary { cursor: pointer; font-weight: 600; padding: 8px 10px; }
.map-panel .place-pick { padding: 8px 10px 0; color: var(--fg); font-weight: 600; font-size: .82rem; }
.map-panel .place-pick select { flex: 1; min-width: 0; }
.map-panel fieldset { border: 0; margin: 0; padding: 0 4px 4px; }
.map-panel .panel-group { margin: 8px 6px 2px; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.map-panel label.view { flex-direction: row; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--fg); font-size: .82rem; line-height: 1.25; }
.map-panel label.view:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.map-panel label.view:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.map-panel label.view input { margin: 0; flex: none; }
.map-panel small { display: block; color: var(--muted); font-size: .72rem; }
.map-panel .sw { flex: none; width: 34px; height: 14px; border-radius: 3px; border: 1px solid #888; }
.sw-hotspots { background: linear-gradient(to right, #fde725, #5ec962, #21918c, #3b528b, #440154); }
.sw-usual { background: linear-gradient(to right, #5e3c99, #b2abd2, #f7f7f7, #fdb863, #e66101); }
.sw-recurrence { background: linear-gradient(to right, #ffffb2, #fecc5c, #fd8d3c, #f03b20, #bd0026); }
.sw-outlook001 { background: linear-gradient(to right, #d7b5d8, #df65b0, #dd1c77, #980043); }
.sw-outlook005 { background: linear-gradient(to right, #d7b5d8 50%, #980043 50%); }
.map-panel .panel-link { display: block; padding: 8px 10px; border-top: 1px solid var(--line); }
[hidden] { display: none !important; } /* labels are flex boxes, which would otherwise show hidden ones */
.leaflet-brazil-pane path:focus:not(:focus-visible) { outline: none; } /* RA-11: no focus box around a state clicked with the mouse */ /* RA-11: the Brazil pilot entries appear only with local pilot data */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) { .map-panel { width: 220px; } }
/* DE-30: summary cards, two columns, segmented switch */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 4px; }
.card { display: block; text-decoration: none; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.card:hover { border-color: var(--accent); }
.card-title { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card-big { display: block; font-size: 1.55rem; font-weight: 700; line-height: 1.25; margin: 2px 0; }
.card-sub { display: block; font-size: .84rem; color: var(--muted); }
.badge { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: .78rem; color: #1b1f23; border: 1px solid #888; margin-right: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.two-col > section { min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex-direction: row; align-items: center; padding: 5px 12px; cursor: pointer; color: var(--fg); font-size: .85rem; }
.seg label + label { border-left: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid #f5a623; outline-offset: -3px; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--fg); }
@media (max-width: 760px) { .cards, .two-col { grid-template-columns: 1fr; } }
/* DE-24: municipal ranking */
h3 { margin: 20px 0 4px; font-size: 1rem; }
.table-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
#ranking, #events { border-collapse: collapse; width: 100%; font-size: .88rem; }
#ranking th, #events th { position: sticky; top: 0; background: var(--bg); text-align: left; }
#ranking th, #ranking td, #events th, #events td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
#ranking td.num, #events td.num { text-align: right; font-variant-numeric: tabular-nums; }
#ranking tr.selected td { font-weight: 700; }
button.linkish { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; text-align: left; }
/* DE-25: "Print a briefing" prints the page with the controls hidden; map attribution and legend stay. */
.print-only { display: none; }
body.printing #map { width: 680px; height: 520px; } /* page width; set by the "Print a briefing" button before printing */
@media print {
  :root { --bg: #fff; --fg: #000; --muted: #333; }
  .no-print, #controls, #downloads-section, #how-section, .leaflet-top, #png-calendar, #png-compare, .row { display: none !important; }
  .print-only { display: block !important; font-weight: 600; }
  .main-svg text { fill: #000 !important; }
  #map, .chart { break-inside: avoid; }
}
/* RA-11: sticky toolbar (place, period, series, downloads) */
.toolbar { position: sticky; top: 0; z-index: 1100; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 8px 10px; margin: 12px 0 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.tb-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
label.inline select { padding: 4px 8px; }
.crumbs { font-size: .95rem; }
.crumbs strong { color: var(--fg); }
#place-search { width: 15em; padding: 5px 10px; border-radius: 16px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chips button { background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; font-size: .82rem; }
.chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 5px 12px; border-radius: 6px; background: var(--accent); color: #fff; font-size: .9rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " \25BE"; }
.menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1200; display: flex; flex-direction: column; min-width: 240px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.menu-items button, .menu-items a { background: none; border: none; color: var(--fg); text-align: left; padding: 6px 8px; border-radius: 6px; font-size: .88rem; text-decoration: none; }
.menu-items button:hover:not(:disabled), .menu-items a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.menu-items button:disabled { color: var(--muted); cursor: default; }
details.advanced { margin: 6px 0; font-size: .9rem; }
details.advanced summary { cursor: pointer; color: var(--accent); }
@media (max-width: 600px) { .toolbar { position: static; } #place-search { width: 100%; } .menu-items { left: 0; right: auto; } }
