/* Outage details page (/outages/). Builds on style.css; colors come from /brand/tokens.css.
   Chart colors: outage and planned interruption in TAURON magenta, checked for color vision
   deficiencies against the light and dark card surfaces. */

:root {
  --out: #b0005f;
  --planned: #e45fa3;
  --none: #dfe4ec;
  --hatch: #b8c0cd;
  --map-bg: #f7f8fa;
  --map-line: #c3cad6;
  --map-district: #9aa3b2;
  --map-water: #cddff1;
  --map-green: #e2eedc;
  --map-rail: #b4bac6;
  --map-label: #5d6575;
}
@media (prefers-color-scheme: dark) {
  :root {
    --out: #ee4ca0;
    --planned: #a33c78;
    --none: #24365a;
    --hatch: #3d5079;
    --map-bg: #0f1a2c;
    --map-line: #2f4166;
    --map-district: #4d5f80;
    --map-water: #1a3152;
    --map-green: #14302b;
    --map-rail: #3b4b68;
    --map-label: #8e99ad;
  }
}

/* ---------- Intro band ---------- */
/* The lead takes the full width, so it wraps only where it has to (never inside the street name) */
.page-hero { padding-bottom: 2rem; }
.page-hero .lead { max-width: none; }
.crumb { margin: 0 0 .75rem; font-size: .9rem; }
.crumb a { color: var(--tk-band-muted); text-decoration: none; }
.crumb a::before { content: "← "; }
.crumb a:hover { color: var(--tk-band-text); }

.sub-intro { margin: -.25rem 0 1rem; color: var(--tk-text-muted); }
.section .subhead { margin: 2.75rem 0 1rem; }

/* ---------- Current state of the network ---------- */
.netstate {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .25rem 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--tk-radius-l);
  background: linear-gradient(135deg, #e2007a 0%, #c4006f 55%, #aa036c 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgb(90 0 50 / .2), 0 1rem 2.5rem rgb(120 0 70 / .22);
}
@media (min-width: 46rem) { .netstate { grid-template-columns: auto 1fr auto; padding: 1.4rem 1.75rem; } }
.now-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: #fff;
  color: #c4006a;
}
.now-icon svg { width: 1.8rem; height: 1.8rem; fill: currentColor; }
.netstate.is-outage .now-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: tk-pulse 2s ease-out infinite;
}
.now-kicker { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.now-title { margin: .1rem 0 .1rem; font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.now-text { margin: 0; }
.now-days { grid-column: 1 / -1; margin: .6rem 0 0; font-size: .95rem; font-weight: 700; }
@media (min-width: 46rem) {
  .now-days { grid-column: auto; margin: 0; text-align: right; }
}
.now-days b { display: block; font-size: 2.2rem; line-height: 1; font-weight: 800; }
.netstate.is-planned {
  background: var(--tk-surface);
  color: var(--tk-text);
  border: 1px solid var(--tk-border);
  border-left: 6px solid #e2007a;
  box-shadow: var(--tk-shadow);
}
.netstate.is-planned .now-icon { background: #fbe3ef; color: #aa036c; }
.netstate.is-planned .now-kicker { color: #aa036c; }
.netstate.is-unknown { background: linear-gradient(135deg, #333 0%, #262626 60%, #1d1d1d 100%); box-shadow: none; }
.netstate.is-unknown .now-icon { background: rgb(255 255 255 / .12); color: #fff; }
@media (prefers-color-scheme: dark) {
  .netstate.is-planned .now-icon { background: rgb(226 0 122 / .2); color: #ff7ab8; }
  .netstate.is-planned .now-kicker { color: #ff7ab8; }
}

/* ---------- Totals ---------- */
.stats-label { margin: 1.75rem 0 .6rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 0; }
@media (min-width: 40rem) { .stats { gap: 1rem; } }
@media (min-width: 60rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: .9rem 1rem; }
@media (min-width: 40rem) { .stat { padding: 1.1rem 1.25rem; } }
@supports (grid-template-rows: subgrid) {
  .stats > .stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: .25rem; }
}
.stat dt { color: var(--tk-text-muted); font-size: .85rem; font-weight: 650; }
.stat dd { margin: 0; }
.stat .value { font-size: clamp(1.2rem, 4.5vw, 1.6rem); font-weight: 800; line-height: 1.2; }
.stat .note { color: var(--tk-text-muted); font-size: .9rem; }

/* ---------- Calendar: one row per month, one cell per day, filled by the hours without heat ---------- */
.heat-cal { padding: 1rem .75rem; }
@media (min-width: 40rem) { .heat-cal { padding: 1.1rem 1.25rem 1rem; } }
.cal-grid {
  display: grid;
  grid-template-columns: 8.5rem repeat(31, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}
@media (max-width: 29.99rem) { .cal-grid { grid-template-columns: 2.2rem repeat(31, minmax(0, 1fr)); gap: 2px; } }
.cal-month { font-size: .85rem; font-weight: 650; white-space: nowrap; }
.cal-month .long { display: none; }
@media (min-width: 30rem) { .cal-month .long { display: inline; } .cal-month .short { display: none; } }
.cal-head { color: var(--tk-text-muted); font-size: .7rem; text-align: center; font-variant-numeric: tabular-nums; }
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1.35;
  border-radius: 3px;
  background: var(--none);
  overflow: hidden;
}
.cal-day i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--out); }
.cal-day.is-planned i { background: var(--planned); }
.cal-day.is-future { background: transparent; box-shadow: inset 0 0 0 1px var(--tk-border); }
.cal-day.is-before { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 4px); box-shadow: inset 0 0 0 1px var(--tk-border); }
.cal-day.is-today { outline: 2px solid var(--tk-text); outline-offset: 1px; }
.cal-day.is-blank { visibility: hidden; }
.cal-day:focus-visible { outline: 3px solid var(--tk-focus); outline-offset: 1px; }

.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--tk-text-muted); }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.swatch { width: .9rem; height: .9rem; border-radius: 3px; background: var(--none); flex: none; }
.swatch.out { background: var(--out); }
.swatch.planned { background: var(--planned); }
.swatch.half { background: linear-gradient(to top, var(--out) 50%, var(--none) 50%); }
.swatch.before { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 4px); box-shadow: inset 0 0 0 1px var(--tk-border); }
.swatch.line { height: 4px; border-radius: 2px; width: 1.2rem; background: var(--out); }
.swatch.line.planned { background: repeating-linear-gradient(90deg, var(--planned) 0 6px, transparent 6px 9px); }
.swatch.home { width: .9rem; height: .9rem; border-radius: 50%; background: var(--tk-orange); box-shadow: 0 0 0 2px var(--tk-surface), 0 0 0 3px var(--tk-text); }

/* ---------- List of interruptions (also the table view of the calendar) ---------- */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.event { display: grid; gap: .35rem 1.5rem; padding: 1.1rem 1.25rem; }
@media (min-width: 46rem) { .event { grid-template-columns: 13rem 1fr auto; align-items: start; } }
.event-date { margin: 0; font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.event-date small { display: block; color: var(--tk-text-muted); font-size: .9rem; font-weight: 650; }
.event-body p { margin: 0; }
.event-when { font-weight: 650; }
.event-source { color: var(--tk-text-muted); font-size: .95rem; }
.event-note { margin-top: .35rem !important; font-size: .95rem; }
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: #fbe3ef;
  color: #8c004c;
}
.badge.is-planned { background: transparent; color: var(--tk-text-muted); box-shadow: inset 0 0 0 1px var(--tk-border); }
.badge.is-now { background: #e2007a; color: #fff; }
@media (prefers-color-scheme: dark) { .badge { background: rgb(238 76 160 / .18); color: #ff9ccc; } }
.event-tags { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: flex-start; }
@media (min-width: 46rem) { .event-tags { justify-content: flex-end; } }
.event details { margin-top: .5rem; font-size: .95rem; }
.event summary { cursor: pointer; color: var(--tk-text-muted); font-weight: 650; }
.event summary:hover { color: var(--tk-text); }
.notices { margin: .5rem 0 0; padding: 0 0 0 1rem; border-left: 2px solid var(--tk-border); list-style: none; display: grid; gap: .5rem; }
.notices p { margin: 0; }
.notices .muted { font-size: .9rem; }

/* ---------- City: days, map and the streets of the chosen day ---------- */
.city-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .75rem; }
.toggle {
  padding: .4rem .95rem;
  border: 1px solid var(--tk-border);
  border-radius: 999px;
  background: var(--tk-surface);
  color: var(--tk-text);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--tk-navy); border-color: var(--tk-navy); color: #fff; }
@media (prefers-color-scheme: dark) { .toggle[aria-pressed="true"] { background: var(--tk-orange); border-color: var(--tk-orange); color: var(--tk-navy); } }
.city-picked { font-weight: 750; }

.days { padding: 1rem 1.25rem .75rem; }
.day-scroll { overflow-x: auto; padding-bottom: .25rem; }
.day-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(1.1rem, 1fr); gap: 2px; min-width: max-content; }
@media (min-width: 46rem) { .day-bars { min-width: 0; } }
.city-day {
  display: grid;
  grid-template-rows: 6rem auto;
  padding: 0 0 .1rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.city-day:hover .day-plot { background: var(--tk-surface-alt); }
.city-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--tk-text); }
.city-day[aria-pressed="true"] .day-label { color: var(--tk-text); font-weight: 800; }
.day-plot { display: flex; flex-direction: column-reverse; gap: 2px; padding: 0 2px; border-radius: 4px 4px 0 0; border-bottom: 1px solid var(--tk-border); }
.day-plot i { display: block; border-radius: 3px 3px 0 0; background: var(--out); }
.day-plot i.planned { background: var(--planned); }
.day-plot i + i { border-radius: 3px 3px 0 0; }
.city-day.is-unchecked .day-plot { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 4px); }
.city-day.is-future .day-label { font-style: italic; }
.day-label { padding-top: .2rem; color: var(--tk-text-muted); font-size: .68rem; line-height: 1.2; text-align: center; font-variant-numeric: tabular-nums; }
.day-label b { display: block; font-weight: 650; }
.city-day.is-today .day-label b { color: var(--tk-text); font-weight: 800; }

.city-grid { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 60rem) { .city-grid { grid-template-columns: minmax(0, 1fr) 21rem; } }

.map { position: relative; margin: 0; padding: 0; overflow: hidden; background: var(--map-bg); }
.map svg { display: block; width: 100%; height: clamp(22rem, 70vh, 38rem); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map svg.is-dragging { cursor: grabbing; }
.map .boundary { fill: none; stroke: var(--map-district); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map .district { fill: none; stroke: var(--map-district); stroke-width: .75; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; opacity: .7; }
.map .water { fill: var(--map-water); }
.map .green { fill: var(--map-green); }
.map .river { fill: none; stroke: var(--map-water); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.map .rail { fill: none; stroke: var(--map-rail); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map .streets { fill: none; stroke: var(--map-line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.map .street-areas { fill: var(--map-line); opacity: .45; }
.map .hit { fill: none; stroke: transparent; stroke-width: 16; vector-effect: non-scaling-stroke; cursor: pointer; pointer-events: stroke; }
.map .hit-area { fill: transparent; cursor: pointer; }
.map .hl { fill: none; stroke: var(--out); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.map .hl.planned { stroke: var(--planned); stroke-dasharray: 7 4; }
.map .hl.n2 { stroke-width: 5.5; }
.map .hl.n3 { stroke-width: 7; }
.map .hl-area { fill: var(--out); opacity: .55; pointer-events: none; }
.map .hl-area.planned { fill: var(--planned); }
.map .hl.is-focus { stroke-width: 9; }
.map .has-focus .hl:not(.is-focus), .map .has-focus .hl-area:not(.is-focus) { opacity: .3; }
.map .district-label { fill: var(--map-label); font-size: calc(11px * var(--k, 1)); font-weight: 700; letter-spacing: .04em; text-anchor: middle; text-transform: uppercase; pointer-events: none; paint-order: stroke; stroke: var(--map-bg); stroke-width: calc(3px * var(--k, 1)); }
.map .home circle { fill: var(--tk-orange); stroke: var(--tk-navy); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map .home .halo { fill: var(--map-bg); stroke: none; }
.map .home text { fill: var(--tk-text); font-size: 12px; font-weight: 800; paint-order: stroke; stroke: var(--map-bg); stroke-width: 3px; }
@media (prefers-color-scheme: dark) { .map .home circle { stroke: #fff; } }

.map-tools { position: absolute; top: .6rem; right: .6rem; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; z-index: 1; }
.map-tools button {
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .7rem;
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius-s);
  background: var(--tk-surface);
  color: var(--tk-text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--tk-shadow);
}
.map-tools .map-text { font-size: .85rem; }
.map-legend { position: absolute; left: .6rem; bottom: .6rem; z-index: 1; }
.map-legend .legend { margin: 0; padding: .45rem .7rem; border-radius: var(--tk-radius-s); background: color-mix(in srgb, var(--tk-surface) 92%, transparent); color: var(--tk-text); box-shadow: var(--tk-shadow); font-size: .8rem; gap: .25rem .9rem; }

.streets { padding: 1.1rem 1.25rem; }
@media (min-width: 60rem) { .streets { max-height: clamp(22rem, 70vh, 38rem); overflow-y: auto; } }
.streets h3 { margin: 0 0 .75rem; font-size: 1.05rem; }
.street-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.street-list button {
  display: grid;
  grid-template-columns: .9rem 1fr;
  gap: .1rem .6rem;
  width: 100%;
  padding: .55rem .5rem;
  border: 0;
  border-radius: var(--tk-radius-s);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.street-list button:hover, .street-list button[aria-pressed="true"] { background: var(--tk-surface-alt); }
.street-list .swatch.line { width: .9rem; margin-top: .65rem; }
.street-name { font-weight: 750; }
.street-name .ours { margin-left: .4rem; }
.street-meta { grid-column: 2; color: var(--tk-text-muted); font-size: .88rem; line-height: 1.4; }
.street-empty { color: var(--tk-text-muted); }

/* How TAURON reports interruptions, and the sources of the map, at the end of the section */
.city-note { margin: .75rem 0 0; color: var(--tk-text-muted); font-size: .85rem; }
.city-note + .city-note { margin-top: .25rem; }

/* ---------- Tooltip shared by the calendar, the days and the map ---------- */
.tip {
  position: fixed;
  z-index: 40;
  max-width: 17rem;
  padding: .5rem .7rem;
  border-radius: var(--tk-radius-s);
  background: var(--tk-navy);
  color: #fff;
  font-size: .85rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / .25);
}
.tip b { display: block; }
@media (prefers-color-scheme: dark) { .tip { background: #e9edf2; color: var(--tk-navy); } }

@media (prefers-reduced-motion: reduce) { .netstate.is-outage .now-icon::after { animation: none; } }
@media print {
  .map-tools, .city-filter, .tip { display: none; }
  .netstate { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
}
