/* Brownout -- map.html only (lane v1.41.0, the brownout map; v1.44.0 the satellite view). Tokens come from main.css. */
.bm-hero{padding:56px 0 44px}
.bm-hero .lead-quiet{color:var(--ink-2);max-width:60ch;margin:6px 0 0;font-size:.98rem}

/* search: a combobox over barangay + town names; every target is at least 44 px tall */
.bm-search{margin-top:26px;max-width:640px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:18px 18px 16px;box-shadow:var(--shadow)}
.bm-search label{display:block;font-weight:600;color:var(--head);margin-bottom:8px}
.bm-search .small{margin:8px 0 0}
.bm-combo{position:relative}
.leaflet-popup-content{min-width:220px}
.bm-combo input{min-height:48px;font-size:1.05rem}
.bm-options{position:static;margin:4px 0 0;padding:4px;list-style:none;
  background:var(--inset);border:1px solid var(--line-strong);border-radius:var(--radius-sm);box-shadow:var(--lift);
  max-height:min(60vh,360px);overflow-y:auto}
.bm-options li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:2px 12px;
  min-height:44px;padding:8px 12px;border-radius:6px;cursor:pointer;color:var(--ink)}
.bm-options li[aria-selected="true"],.bm-options li:hover{background:var(--sun-tint);color:var(--head);outline:1px solid var(--sun)}
.bm-options .bm-o-city{font-size:.85rem;color:var(--muted)}
.bm-options li.bm-none{cursor:default;color:var(--muted);outline:none;background:none}
.bm-answer{margin-top:14px;padding:14px 16px;border-radius:var(--radius-sm);background:var(--inset);
  border:1px solid var(--line);border-left:3px solid var(--sun)}
.bm-answer p{margin:0 0 6px}
.bm-answer p:last-child{margin-bottom:0}
.bm-answer .bm-answer-main{color:var(--head);font-size:1.05rem}

/* map + legend */
.bm-map-section h2{margin-bottom:16px}
#bm-map{background:#DDE3E6}
.bm-legend{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin:12px 0 4px}
.bm-legend-list{display:flex;flex-wrap:wrap;gap:8px 16px;margin:0;padding:0;list-style:none;font-size:.88rem;color:var(--ink-2)}
.bm-legend-list li{display:flex;align-items:center;gap:7px}
.bm-legend-list i{display:inline-block;width:22px;height:14px;border-radius:3px;border:1px solid rgba(255,255,255,.25)}
.bm-legend-hatch i{background:repeating-linear-gradient(135deg,#7D868C 0 2px,#C9CED2 2px 6px)}
/* closes the hairline seams between OSM tiles at quarter zoom steps (measured: none left at 1440 px) */
#bm-map .leaflet-tile{outline:1px solid transparent}
#bm-map .leaflet-control-zoom a{width:44px;height:44px;line-height:44px;font-size:22px}
.leaflet-popup-content p{margin:0 0 6px}
.leaflet-popup-content .bm-answer-main{font-weight:600}

/* night-by-night strip */
.bm-strip-h{margin-top:34px}
.bm-strip{position:relative;margin:12px 0 4px;padding:10px 10px 0;background:var(--inset);border:1px solid var(--line);
  border-radius:var(--radius)}
.bm-strip-svg{display:block;width:100%;height:120px}
.bm-strip-svg .bar{fill:var(--sun);opacity:.7}
.bm-strip-svg .bar.peak{opacity:1}
/* v1.42.0: hazy nights (the whole island looked dim and was evened out) are paler */
.bm-strip-svg .bar.haze{opacity:.38}
.bm-strip-svg .bar.haze.peak{opacity:.8}
.bm-strip-svg .gap{fill:var(--line-strong);opacity:.6}
.bm-strip-months{position:relative;height:22px;font-family:var(--font-mono);font-size:.66rem;color:var(--muted)}
.bm-strip-months span{position:absolute;top:4px;transform:translateX(-2px);white-space:nowrap}
.bm-strip-cap{margin:0;padding:6px 0 10px}
/* v1.44.0: a tap on a night's column picks it for the satellite view; the marker shows which night is picked */
.bm-strip-svg,.bm-strip-months{cursor:pointer}
.bm-strip-sel{position:absolute;top:10px;height:120px;pointer-events:none;background:rgba(245,249,251,.14);
  box-shadow:0 0 0 1px var(--head);border-radius:1px}
.bm-strip-tap{margin:6px 0 0}

/* v1.44.0 the satellite view: NASA's picture of one night, with that night's dark barangays outlined in amber */
.bm-sat{margin:34px 0 34px}
.bm-sat-pick{margin:14px 0 12px}
.bm-sat-date{margin:0 0 8px;font-weight:600;color:var(--head);font-size:1.05rem}
.bm-sat-btns{display:flex;flex-wrap:wrap;gap:8px}
.bm-sat-btns .btn{min-height:44px;padding:10px 16px;font-size:.95rem}
.bm-sat-btns .btn[aria-disabled="true"]{opacity:.5;cursor:not-allowed}
#bm-sat{background:#05080B}
#bm-sat .leaflet-tile{outline:1px solid transparent}
#bm-sat .leaflet-control-zoom a{width:44px;height:44px;line-height:44px;font-size:22px}
.bm-sat-cloud{display:inline-flex;align-items:center;gap:10px;min-height:44px;margin:10px 0 0;cursor:pointer;color:var(--ink)}
.bm-sat-cloud input{width:22px;height:22px;margin:0;flex:0 0 auto}
/* round 3: the cloud key (shown while the cloud layer is on); swatches = the colormap's ends at 0.5 opacity over the picture */
.bm-sat-cloudkey{display:flex;align-items:center;gap:6px;margin:2px 0 0;font-size:.88rem;color:var(--ink-2)}
.bm-sat-cloudkey[hidden]{display:none}
.bm-sat-cloudkey i{display:inline-block;flex:0 0 auto;width:16px;height:14px;border:1px solid var(--line-strong);border-radius:3px}
.bm-sat-cloudkey .sw-clear{background:rgb(66,4,6)}
.bm-sat-cloudkey .sw-cloud{background:rgb(130,128,124);margin-right:4px}
.bm-sat-legend{display:flex;align-items:center;gap:8px;margin:4px 0 0;font-size:.88rem;color:var(--ink-2)}
.bm-sat-legend i{position:relative;display:inline-block;flex:0 0 auto;width:22px;height:14px;border:2.5px solid #FFB020;border-radius:3px;background:#05080B}
/* round 2: the dot each dark barangay also gets at its centre */
.bm-sat-legend i::after{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:50%;background:#FFB020;box-shadow:0 0 0 1.5px #05080B}
.bm-sat-line{margin:10px 0 0;color:var(--head)}
#bm-sat-status{margin:6px 0 0}

/* the ten barangays with the most dark nights */
.bm-top{margin:12px 0 0;padding:0;list-style:none;display:grid;gap:8px;max-width:640px}
.bm-top-btn{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;
  padding:9px 14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);
  font:inherit;text-align:left;cursor:pointer}
.bm-top-btn::before{content:attr(data-rank);font-family:var(--font-mono);color:var(--muted);min-width:1.6em}
.bm-top-flag{display:block;font-size:.8rem;color:var(--muted);margin-top:2px}
.bm-top-note{margin:10px 0 0;max-width:640px}
.bm-top-btn span:first-of-type{flex:1}
.bm-top-btn:hover,.bm-top-btn:focus-visible{border-color:var(--sun);color:var(--head)}
.bm-top-btn:focus-visible{outline:2px solid var(--sun);outline-offset:1px}
.bm-top-n{font-family:var(--font-mono);font-size:.88rem;color:var(--sun-soft);white-space:nowrap}

.bm-steps{padding-left:1.3em;max-width:66ch}
.bm-steps li{margin:0 0 8px}

@media(max-width:640px){
  .bm-hero{padding:36px 0 30px}
  .bm-search{padding:14px}
  .bm-strip-svg{height:96px}
  .bm-strip-sel{height:96px}
  .bm-sat-btns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .bm-sat-btns .btn{padding:10px 12px}
}
