/* Apărăm Realitatea: the Apărăm look (matte black, white text, CERCO red) with one colour per kind of event.
   Schibsted Grotesk, self-hosted. Touch targets of 44px and more. */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #101010; --card: #181818; --card-2: #202020; --line: #2e2e2e; --line-2: #464646; --fg: #ffffff; --muted: #b4b4b4; --faint: #858585;
  --red: #cf1f32; --red-2: #a91828; --ok: #3fbf6a;
  /* one colour per kind, readable on black */
  --power: #f5c542; --heat: #ff8a4c; --transport: #5aa9ff; --weather: #b48cff; --quake: #ff5c7a;
  --sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

/* header */
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand-t { display: grid; line-height: 1; }
.brand-a { font-weight: 850; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.brand-r { font-weight: 900; font-size: 21px; letter-spacing: -.01em; margin-top: 3px; }
.tabs { margin-left: auto; display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 750; font-size: 15px; cursor: pointer; min-height: 40px; color: var(--muted); }
.tab[aria-pressed="true"] { background: var(--fg); color: #111; }
@media (max-width: 560px) {
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; padding: 8px 6px; }
}

/* layout: map on top on phones, side by side on wide screens */
.main { flex: 1; display: grid; grid-template-rows: 42dvh auto; }
.mapwrap { position: relative; border-bottom: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: #0b0b0b; }
.panel { padding: 16px max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); min-width: 0; }
@media (min-width: 960px) {
  .main { grid-template-columns: minmax(380px, 460px) 1fr; grid-template-rows: none; height: calc(100dvh - 63px); }
  .mapwrap { order: 2; border-bottom: 0; border-left: 1px solid var(--line); }
  .panel { order: 1; overflow-y: auto; }
}
.maphint { position: absolute; z-index: 500; left: 12px; right: 12px; top: 12px; margin: 0 auto; max-width: 420px; background: rgba(16,16,16,.92); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; font-weight: 650; font-size: 15px; text-align: center; pointer-events: none; }

/* text */
h1 { font-size: clamp(28px, 6vw, 34px); line-height: 1.06; letter-spacing: -.02em; font-weight: 880; margin: 6px 0 10px; text-wrap: balance; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin: 24px 0 10px; }
h3 { font-size: 18px; margin: 0 0 6px; text-wrap: balance; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--muted); }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--faint); }
b, strong { font-weight: 800; }

/* buttons and chips */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 12px; border: 2px solid var(--red); background: var(--red); color: #fff; font-weight: 800; font-size: 17px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.small { min-height: 44px; font-size: 15px; width: auto; }
.btn:disabled { opacity: .45; cursor: default; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: #111; border-color: var(--fg); }
.chip .ic { width: 17px; height: 17px; }
.chip.k-power[aria-pressed="true"] { background: var(--power); border-color: var(--power); }
.chip.k-heat[aria-pressed="true"] { background: var(--heat); border-color: var(--heat); }
.chip.k-transport[aria-pressed="true"] { background: var(--transport); border-color: var(--transport); }
.chip.k-weather[aria-pressed="true"] { background: var(--weather); border-color: var(--weather); }
.chip.k-quake[aria-pressed="true"] { background: var(--quake); border-color: var(--quake); }
.place { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--fg); border-radius: 999px; padding: 2px 4px 2px 12px; font-weight: 750; font-size: 14.5px; min-height: 40px; }
.place button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.place button:hover { color: var(--fg); background: var(--card-2); }
.place .ic { width: 17px; height: 17px; }
.iconbtn { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }

/* cards */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); }
.card.note { display: flex; gap: 12px; align-items: flex-start; }
.card.note .ic { margin-top: 2px; color: var(--muted); }
.feed { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: 40px 1fr; gap: 12px; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px; cursor: pointer; }
.ev:hover { border-color: var(--line-2); }
.ev.ended { opacity: .62; }
.ev .k { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #111; }
.ev .k .ic { width: 21px; height: 21px; }
.k.power { background: var(--power); } .k.heat { background: var(--heat); } .k.transport { background: var(--transport); } .k.weather { background: var(--weather); } .k.quake { background: var(--quake); }
.ev .meta { display: flex; gap: 6px 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ev .t { font-weight: 780; font-size: 16.5px; line-height: 1.3; margin: 3px 0 4px; overflow-wrap: anywhere; }
.ev .why { font-size: 14px; color: var(--fg); font-weight: 600; }
.ev .when { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); }
.tag.live { border-color: var(--red); color: #ff8592; }
.tag.done { border-color: var(--ok); color: var(--ok); }
.more { margin-top: 14px; }
.more summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--muted); padding: 10px 2px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.more[open] summary::after { content: "–"; }
.empty { border: 1px dashed var(--line-2); border-radius: 14px; padding: 18px; color: var(--muted); text-align: center; }

/* the sources page */
.src { display: grid; grid-template-columns: 12px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--faint); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--red); } .dot.wait { background: var(--power); }
.src b { display: block; }
.src .fine { margin-top: 2px; }
ul.plain { margin: 0; padding-left: 18px; color: var(--muted); }
ul.plain li { margin: 5px 0; }

/* bottom sheet with an event's details */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 2000; }
.sheet { position: fixed; z-index: 2001; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow-y: auto; background: var(--card); border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0;
  padding: 10px max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: 600px; border-radius: 18px; border: 1px solid var(--line-2); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 8px; }
.sheet .head { display: flex; gap: 12px; align-items: flex-start; }
.sheet .head .k { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #111; flex: none; }
.sheet h3 { font-size: 21px; margin: 2px 0 6px; }
.sheet .body { white-space: pre-line; color: #e6e6e6; margin: 14px 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 12px 16px; font-size: 15px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.timeline li.ended::before { background: var(--ok); }
.timeline time { display: block; color: var(--muted); font-size: 13.5px; font-weight: 650; }

/* map bits */
.maplibregl-map { font: 14px/1.4 var(--sans); }
.maplibregl-ctrl-group { background: var(--card) !important; border: 1px solid var(--line-2); box-shadow: none !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line-2) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(16,16,16,.8) !important; color: var(--faint); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.tip .maplibregl-popup-content { background: var(--card); color: var(--fg); border: 1px solid var(--line-2); border-radius: 8px; font-weight: 650; padding: 6px 10px; box-shadow: none; max-width: 260px; }
.tip .maplibregl-popup-tip { display: none; }
.pin { width: 30px; height: 30px; cursor: grab; }
.pin::before { content: ""; display: block; width: 24px; height: 24px; margin: 0 auto; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--fg); border: 4px solid var(--red); }
