/* sun.bg, the day dashboard (docs/technical/22-sun-bg-redesign.md). One 24-hour ribbon coloured by
   the light, tiles in the colours of the parts of the day, one hour axis, one palette. The only
   stylesheet of the site: templates/sun/layout.html.twig and sites/sun/public/404.html load it. */
@font-face { font-family: "Sofia Sans"; src: url("/fonts/sofia-sans.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Sofia Sans Condensed"; src: url("/fonts/sofia-sans-condensed.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
/* What stands in until the files arrive, squeezed to their width and height so the lines do not move */
@font-face { font-family: "Sofia Sans Fallback"; src: local("Arial"), local("Roboto"), local("Noto Sans"); size-adjust: 93%; ascent-override: 97%; descent-override: 32%; line-gap-override: 0%; }
@font-face { font-family: "Sofia Sans Condensed Fallback"; src: local("Arial"), local("Roboto"), local("Noto Sans"); size-adjust: 72%; ascent-override: 125%; descent-override: 42%; line-gap-override: 0%; }
:root {
    color-scheme: light dark;
    --night: #0f1a40;
    --night-2: #1b2a63;
    --twilight: #6b5bd6;
    --golden: #ff8b3d;
    --sun: #ffc619;
    --cloud: #b9c5de;
    --paper: #ffffff;
    --ink: #0f1a40;
    --ink-2: #56618a;
    --rule: #dfe5f2;
    --mix: #ffffff;
    --panel: #101b44;
    --soft: 22%;
    /* the light, as the ribbon paints it */
    --c-night: #0f1a40;
    --c-tw1: #2e3182;
    --c-tw2: #7c5ccb;
    --c-rise: #ff6f5e;
    --c-gold: #ff9d3c;
    --c-day: #ffc619;
    --c-noon: #ffdd66;
    /* the UV index: the WHO scale, the label always beside it */
    --uv-low: #3da35d;
    --uv-moderate: #f2c200;
    --uv-high: #f58a1f;
    --uv-very-high: #e5383b;
    --uv-extreme: #8e44ad;
    --text: "Sofia Sans", "Sofia Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --cond: "Sofia Sans Condensed", "Sofia Sans Condensed Fallback", "Sofia Sans", system-ui, sans-serif;
    --focus: #1d5fe0;
}
:root {
    --sun-soft: color-mix(in srgb, var(--sun) var(--soft), var(--mix));
    --cloud-soft: color-mix(in srgb, var(--cloud) var(--soft), var(--mix));
    --lilac-soft: color-mix(in srgb, var(--twilight) calc(var(--soft) * .6), var(--mix));
    --golden-soft: color-mix(in srgb, var(--golden) var(--soft), var(--mix));
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0a1130;
        --ink: #eef1fb;
        --ink-2: #a6b0d2;
        --rule: #27325e;
        --mix: #0a1130;
        --soft: 26%;
        --c-night: #25357c;
        --c-tw1: #3f43a3;
        --night-2: #1b2a63;
        --cloud: #6a779f;
        --focus: #8fb8ff;
        --panel: #1b2a63;
        /* the soft tints are chosen, not mixed: yellow mixed into navy turns olive */
        --sun-soft: #4a3610;
        --golden-soft: #522c17;
        --cloud-soft: #1a2552;
        --lilac-soft: #26215f;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 var(--text); font-variant-numeric: tabular-nums lining-nums; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p, figure { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nb { white-space: nowrap; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 960px) { .wrap { padding: 0 32px; } }
small.u, .u { font-size: .52em; font-weight: 600; letter-spacing: 0; margin: 0 .12em 0 .08em; opacity: .72; }

/* masthead: the brand, three links, the town search, on every page */
.masthead { display: flex; align-items: center; gap: 18px; padding-top: 14px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 1.45rem/1 var(--cond); text-decoration: none; letter-spacing: -.005em; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 10px; border-radius: 999px; font-weight: 600; font-size: .98rem; text-decoration: none; }
.nav a:hover { background: var(--cloud-soft); }
.nav a[aria-current] { background: var(--ink); color: var(--paper); }
.find { position: relative; }
.find input { width: 220px; font: inherit; font-size: .98rem; padding: 9px 14px 9px 38px; border: 0; border-radius: 999px; background: var(--cloud-soft); color: var(--ink); }
.find input::placeholder { color: var(--ink-2); }
.find svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.find label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 719px) {
    .masthead { gap: 6px; }
    .nav a { padding: 8px 8px; }
    .find input { width: 40px; padding: 9px 0 9px 40px; cursor: pointer; }
    .find input::placeholder { color: transparent; }
    .find svg { color: var(--ink); }
}

/* the day: name, date, the next event, the three figures, the ribbon */
.day { padding: 18px 0 8px; }
.crumbs { font-size: .92rem; color: var(--ink-2); }
.crumbs span { margin: 0 .4em; }
.day-head { display: grid; gap: 6px; margin-top: 4px; }
.day h1 { font: 800 clamp(3.2rem, 14vw, 6rem)/.92 var(--cond); letter-spacing: -.012em; }
.date { color: var(--ink-2); }
.status { justify-self: start; display: inline-flex; align-items: center; gap: 9px; margin-top: 6px; padding: 8px 15px 8px 12px; border-radius: 999px; background: var(--sun-soft); font-weight: 700; }
.status::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 35%, transparent); }
.status.is-down { background: var(--night); color: #fff; }
.status.is-down::before { background: #b9b0f5; box-shadow: 0 0 0 3px rgba(185, 176, 245, .3); }
@media (min-width: 960px) {
    .day-head { grid-template-columns: 1fr auto; align-items: end; }
    .day-head .date { grid-row: 2; }
    .status { grid-column: 2; grid-row: 1 / span 2; align-self: end; justify-self: end; margin: 0 0 4px; font-size: 1.1rem; padding: 10px 18px 10px 14px; }
}
.figures { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: clamp(18px, 4vw, 30px); }
.fig { display: flex; flex-direction: column; }
.fig b { font: 800 clamp(2.9rem, 13vw, 5.4rem)/.9 var(--cond); letter-spacing: -.015em; }
.fig span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .95rem; margin-top: 6px; }
.fig span svg { flex: none; color: var(--golden); }
.fig span i { font-style: normal; }
@media (max-width: 599px) { .fig span i { display: none; } }
.fig-len { align-items: center; text-align: center; }
.fig-len b { font-size: clamp(1.55rem, 6.6vw, 3rem); font-weight: 700; line-height: 1; }
.fig-set { align-items: flex-end; text-align: right; }

.ribbon {
    position: relative; display: block; border-radius: 10px;
    background: linear-gradient(90deg,
        var(--c-night) calc(var(--dawn) - .5%),
        var(--c-tw1) var(--dawn),
        var(--c-tw2) calc((var(--dawn) + var(--rise)) / 2),
        var(--c-rise) var(--rise),
        var(--c-gold) calc((var(--rise) + var(--g1)) / 2),
        var(--c-day) var(--g1),
        var(--c-noon) var(--noon),
        var(--c-day) var(--g2),
        var(--c-gold) calc((var(--g2) + var(--set)) / 2),
        var(--c-rise) var(--set),
        var(--c-tw2) calc((var(--set) + var(--dusk)) / 2),
        var(--c-tw1) var(--dusk),
        var(--c-night) calc(var(--dusk) + .5%));
}
.ribbon-hero { height: 58px; border-radius: 16px; margin-top: 14px; }
@media (min-width: 720px) { .ribbon-hero { height: 76px; border-radius: 20px; } }
/* the hours as a ruler inside the ribbon: a line an hour, a longer one every six */
.ribbon-hero::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background:
        repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(255, 255, 255, .55) calc(25% - 1px), rgba(255, 255, 255, .55) 25%) 0 100% / calc(100% - 3px) 34% no-repeat,
        repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 24 - 1px), rgba(255, 255, 255, .34) calc(100% / 24 - 1px), rgba(255, 255, 255, .34) calc(100% / 24)) 0 100% / calc(100% - 3px) 16% no-repeat;
}
.needle { position: absolute; top: -7px; bottom: -7px; left: var(--now); width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.needle b { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); padding: 3px 9px; border-radius: 999px; background: var(--paper); color: var(--ink); font: 700 .86rem/1.3 var(--text); white-space: nowrap; box-shadow: 0 1px 0 rgba(15, 26, 64, .18); }
.needle.flip b { left: auto; right: 12px; }
.axis { display: flex; justify-content: space-between; margin: 7px 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--ink-2); }
@keyframes draw { from { clip-path: inset(0 100% 0 0 round 16px); } to { clip-path: inset(0 0 0 0 round 16px); } }
@media (prefers-reduced-motion: no-preference) { .ribbon-hero { animation: draw .9s cubic-bezier(.2, .7, .2, 1) both; } }

/* the board: one tile per question, in the colour of the part of the day it is about */
.board { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 26px; }
.tile { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 16px 16px 15px; border-radius: 22px; color: var(--ink); text-decoration: none; overflow: hidden; }
.tile .title { font: 600 .98rem/1.2 var(--text); }
.tile .big { font: 800 clamp(2.1rem, 9vw, 2.9rem)/1 var(--cond); letter-spacing: -.012em; margin-top: 8px; }
.tile .sub { font-size: .93rem; line-height: 1.3; margin-top: 6px; }
.tile .foot { margin-top: auto; padding-top: 12px; }
.tile-wide { grid-column: span 2; min-height: 0; }
.t-golden { background: linear-gradient(150deg, #ff7446 0%, #ffa33a 62%, #ffc619 100%); color: #0f1a40; }
.t-light { background: linear-gradient(150deg, #6753d4 0%, #3a3a98 58%, #101b44 100%); color: #fff; }
.t-noon { background: var(--sun); color: #0f1a40; }
.t-next { background: var(--cloud-soft); }
.t-uv { background: var(--lilac-soft); }
.t-sun { background: var(--sun-soft); }
.t-roof { background-color: var(--panel); color: #fff; background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 100% 34px, 56px 100%; }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tile-head .big { margin-top: 6px; }
.range { position: relative; height: 6px; border-radius: 3px; background: rgba(15, 26, 64, .2); }
.range i { position: absolute; top: 50%; left: var(--at); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #0f1a40; box-shadow: 0 0 0 3px var(--sun); }
.range-ends { display: flex; justify-content: space-between; font-size: .8rem; margin-top: 6px; opacity: .78; }
@media (min-width: 600px) {
    .board { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .t-roof { grid-column: span 4; }
}
@media (min-width: 960px) {
    .board { grid-template-columns: repeat(12, 1fr); gap: 16px; }
    .tile { grid-column: span 3; padding: 20px 20px 18px; min-height: 172px; }
    .tile-wide, .t-roof { grid-column: span 4; }
}

/* the UV figure and chip */
.uv-low { --uv: var(--uv-low); } .uv-moderate { --uv: var(--uv-moderate); } .uv-high { --uv: var(--uv-high); } .uv-very-high { --uv: var(--uv-very-high); } .uv-extreme { --uv: var(--uv-extreme); }
.uv-disc { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--uv); color: #0f1a40; font: 800 2rem/1 var(--cond); }
.uv-disc.uv-extreme, .uv-chip.uv-extreme, .uv-disc.uv-very-high, .uv-chip.uv-very-high { color: #fff; }
.uv-chip { display: inline-grid; place-items: center; min-width: 1.9em; padding: 1px 7px; border-radius: 999px; background: var(--uv); color: #0f1a40; font-weight: 700; font-size: .92rem; }

/* columns: one per hour, the value written on it; the clear-sky value as a dashed outline */
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; align-items: end; height: var(--h, 124px); }
.col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.col .bar { width: 100%; height: var(--v); min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--uv, var(--sun)); }
.col .ghost { position: absolute; left: 0; right: 0; bottom: 0; height: var(--g); border: 1.5px dashed color-mix(in srgb, var(--ink-2) 70%, transparent); border-bottom: 0; border-radius: 5px 5px 0 0; }
.col .val { font-size: .8rem; font-weight: 700; line-height: 1.5; }
.col.is-now .bar { box-shadow: 0 0 0 2.5px var(--ink); }
.hours { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin-top: 5px; font-size: .78rem; color: var(--ink-2); text-align: center; }
.t-roof .hours { color: rgba(255, 255, 255, .72); }
.t-roof .ribbon-axis, .panel .ribbon-axis { --c-night: #44539c; --c-tw1: #5a55b4; }
.ribbon-axis { height: 6px; border-radius: 3px; margin-top: 6px; }
.tile .cols { --h: 62px; }
.tile .col .val { font-size: .74rem; }

/* cells: one per hour, from cloud grey to sun yellow by the minutes of sunshine */
.cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.cell { height: var(--ch, 24px); border-radius: 4px; background: color-mix(in srgb, var(--sun) var(--s, 0%), var(--cloud)); }
.cell.dark { background: color-mix(in srgb, var(--c-night) 16%, var(--mix)); }
.tile .cells { --ch: 30px; }

/* the open sections under the board */
.lead { max-width: 62ch; font-size: 1.12rem; line-height: 1.55; margin-top: 30px; }
.lead strong { font-weight: 700; }
section.open { padding-top: clamp(44px, 7vw, 68px); }
section.open > h2 { font: 800 clamp(1.9rem, 6vw, 2.6rem)/1 var(--cond); letter-spacing: -.01em; }
section.open > .say { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.note { color: var(--ink-2); font-size: .88rem; margin-top: 12px; max-width: 70ch; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--ink-2); margin-top: 12px; }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: var(--uv, var(--c)); }
.legend i.dash { background: none; border: 1.5px dashed var(--ink-2); }

.uv-now { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.uv-now p { max-width: 54ch; }
.uv-now .advice { display: block; color: var(--ink-2); font-size: .95rem; }
.uv-now .uv-disc { width: 76px; height: 76px; font-size: 2.6rem; }
.uv-charts { display: grid; gap: 26px; margin-top: 24px; }
.uv-charts figcaption { font: 700 1.05rem/1.2 var(--text); margin-bottom: 4px; }
.uv-charts figcaption span { font-weight: 400; color: var(--ink-2); margin-left: .35em; }
@media (min-width: 860px) { .uv-charts { grid-template-columns: 1fr 1fr; gap: 40px; } }
.skin { margin-top: 30px; max-width: 720px; }
.skin h3 { font: 700 1.05rem/1.25 var(--text); margin-bottom: 10px; }
.skin ul { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.skin-row { display: grid; grid-template-columns: 2.2em minmax(0, 19em) 1fr 5.6em; align-items: center; gap: 10px; font-size: .95rem; }
.skin-row b { font: 800 1.1rem/1 var(--cond); }
.skin-row .track { height: 12px; border-radius: 6px; background: var(--cloud-soft); overflow: hidden; }
.skin-row .track i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: var(--golden); }
.skin-row em { font-style: normal; font-weight: 700; text-align: right; white-space: nowrap; }
@media (max-width: 599px) { .skin-row { grid-template-columns: 1.8em 1fr 5.4em; } .skin-row .track { grid-column: 2 / 4; grid-row: 2; } .skin-row em { grid-column: 3; grid-row: 1; } }

/* the week: per day a strip of hours, then the totals */
.week { list-style: none; margin: 20px 0 0; padding: 0; }
.week-row { display: grid; grid-template-columns: 5.2em 1fr 4.6em 3.3em; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.week-row:last-child { border-bottom: 1px solid var(--rule); }
.week-row.head { border: 0; padding: 0 0 4px; font-size: .8rem; color: var(--ink-2); }
.week-row.head .hours { margin: 0; gap: 2px; }
.week-row .d { font-weight: 600; white-space: nowrap; }
.week-row.today .d { font-weight: 800; }
.week-row .n { text-align: right; white-space: nowrap; font-weight: 700; }
.week-row .n small { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.week-row .k { text-align: right; }
.week .cells { --ch: 26px; }
@media (min-width: 720px) { .week-row { grid-template-columns: 7em 1fr 6em 6em 4em; gap: 18px; } .week-row .c { text-align: right; color: var(--ink-2); white-space: nowrap; } }
@media (max-width: 719px) {
    .week-row { grid-template-columns: 1fr auto auto; gap: 6px 14px; padding: 11px 0 12px; }
    .week-row .c { display: none; }
    .week-row .cells, .week-row.head .hours { grid-column: 1 / -1; grid-row: 2; }
    .week-row.head { grid-template-columns: 1fr; }
    .week-row.head > :not(.hours) { display: none; }
    .week-row.head .hours { grid-row: 1; }
    .week-row .n { display: flex; align-items: baseline; gap: 6px; }
    .week-row .n small { display: inline; }
    .week .cells { --ch: 22px; }
}

/* the roof */
.roof-figs { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 40px; margin-top: 18px; }
.roof-figs p { display: flex; flex-direction: column; }
.roof-figs b { font: 800 clamp(1.9rem, 7vw, 2.8rem)/1 var(--cond); white-space: nowrap; }
@media (max-width: 599px) { .roof-figs { grid-template-columns: 1fr 1fr; gap: 14px 20px; } .roof-figs p:first-child { grid-column: 1 / -1; } .roof-figs p:first-child b { font-size: 2.6rem; } }
.roof-figs .cap { color: var(--ink-2); font-size: .93rem; margin-top: 4px; }
.roof-charts { display: grid; gap: 26px; margin-top: 26px; }
.roof-charts figcaption { font: 700 1.05rem/1.2 var(--text); margin-bottom: 8px; }
.roof-charts .panel { padding: 18px 16px 14px; border-radius: 22px; background-color: var(--panel); color: #fff; background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 100% 40px, 64px 100%; }
.roof-charts .panel .hours { color: rgba(255, 255, 255, .72); }
.roof-charts .panel .col .bar { background: var(--sun); }
.months .col .bar { background: color-mix(in srgb, var(--sun) 46%, var(--mix)); }
.months .col.is-now .bar { background: var(--sun); box-shadow: none; }
.months .col .val { font-weight: 600; color: var(--ink-2); font-size: .74rem; }
.months .col.is-now .val { font-weight: 800; color: var(--ink); }
@media (min-width: 860px) { .roof-charts { grid-template-columns: 1fr 1fr; gap: 40px; } }

/* the year: the ribbon of every day, stacked */
.year-grid { display: grid; gap: 40px; margin-top: 20px; }
@media (min-width: 960px) { .year-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; align-items: start; } }
.year { margin-top: 18px; padding: 36px 16px 14px 50px; border-radius: 22px; background: var(--panel); color: #fff; }
.year-plot { position: relative; aspect-ratio: 656 / 450; }
.year-plot svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.y-twilight { fill: #6f5cd0; }
.y-golden { fill: #ff9d3c; }
.y-day { fill: #ffc619; }
.y-grid { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.y-today { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.y-hour, .y-month, .y-now, .y-note { position: absolute; font-size: .78rem; line-height: 1; white-space: nowrap; pointer-events: none; }
.y-hour { top: -22px; transform: translateX(-50%); color: rgba(255, 255, 255, .8); }
.y-month { left: -8px; transform: translate(-100%, -50%); color: rgba(255, 255, 255, .8); }
.y-note { transform: translate(-50%, 8px); color: #0f1a40; font-size: .82rem; font-weight: 700; }
.y-note.y-above { transform: translate(-50%, calc(-100% - 8px)); }
.y-note i { font-style: normal; }
.y-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; pointer-events: none; }
.y-now { right: 6px; transform: translateY(calc(-100% - 5px)); font-weight: 700; }
.y-cross { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255, 255, 255, .8); pointer-events: none; }
.y-cross[hidden] { display: none; }
.year .tip { position: absolute; z-index: 3; pointer-events: none; padding: 7px 11px; border-radius: 12px; background: #fff; color: #0f1a40; font-size: .86rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 6px 22px -6px rgba(15, 26, 64, .45); }
.year .tip[hidden] { display: none; }
.year .tip strong { display: block; }
@media (max-width: 559px) {
    .year { padding-left: 40px; padding-right: 10px; }
    .year-plot { aspect-ratio: 300 / 510; }
    .y-note i { display: none; }
}

/* the table of the year, folded under the chart: the main body for search engines */
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
thead th { font-size: .82rem; font-weight: 500; color: var(--ink-2); padding-top: 0; }
tbody th { font-weight: 500; }
.year-table table { margin-top: 6px; }
.year-table thead th { position: sticky; top: 0; background: var(--paper); }
tr.today { background: var(--sun-soft); font-weight: 700; }
tr.today th { font-weight: 700; }
tr.today > :first-child { box-shadow: inset 4px 0 var(--sun); padding-left: 10px; }
.as-of { color: var(--ink-2); font-size: .88rem; margin-top: 12px; }
.as-of.stale { color: var(--ink); font-weight: 700; }
.as-of.stale::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--golden); }
#nablizo { margin-top: 36px; }
.dates { list-style: none; margin: 0; padding: 0; }
.dates li { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 13px 0; border-top: 1px solid var(--rule); }
.dates li:last-child { border-bottom: 1px solid var(--rule); }
.dates .what { font-weight: 700; }
.dates .when { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font: 800 1.5rem/1 var(--cond); white-space: nowrap; }
.dates .when small { display: block; font: 400 .8rem/1.3 var(--text); color: var(--ink-2); }
.dates .more { grid-column: 1; color: var(--ink-2); font-size: .92rem; }
.side h2 { font: 800 1.6rem/1 var(--cond); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.chips a { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 14px; border-radius: 999px; background: var(--cloud-soft); text-decoration: none; font-weight: 600; }
.chips a small { font-weight: 400; color: var(--ink-2); }
.chips a:hover { background: var(--sun-soft); }

/* home: the search, the four tiles, the map, the town tables */
.home h1 { font: 800 clamp(2.6rem, 10.5vw, 5rem)/.94 var(--cond); letter-spacing: -.012em; }
.home .sentence { font-size: 1.12rem; max-width: 46ch; margin-top: 10px; }
.search { margin-top: 20px; max-width: 640px; position: relative; }
.search input { width: 100%; font: inherit; font-size: 1.15rem; padding: 16px 18px 16px 52px; border: 0; border-radius: 18px; background: var(--cloud-soft); color: var(--ink); }
.search input::placeholder { color: var(--ink-2); }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.tile .town { font-weight: 700; }
.t-map { grid-column: 1 / -1; background: var(--panel); color: #fff; padding-bottom: 12px; }
.t-map svg { display: block; width: 100%; height: auto; max-height: 500px; margin-top: 4px; }
.t-map text { font: 600 22px var(--text); fill: #fff; paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }
.t-map .legend { color: rgba(255, 255, 255, .78); margin-top: 6px; }
@media (max-width: 599px) { .t-map text { font-size: 38px; stroke-width: 8px; } .t-map text.minor { display: none; } }
/* a dot: from cloud grey to sun yellow by the sunny share of its day; a ring without a forecast; without any, the light of the moment */
.t-map circle { fill: color-mix(in srgb, #ffc619 var(--s, 0%), #8f9dc4); }
.t-map circle.none { fill: none; stroke: #8f9dc4; stroke-width: 2; }
.t-map circle.up, .t-map .legend i.up { fill: #ffc619; background: #ffc619; }
.t-map circle.twilight, .t-map .legend i.twilight { fill: #a797ff; background: #a797ff; }
.t-map circle.night, .t-map .legend i.night { fill: #56638f; background: #56638f; }
.t-map .legend i { border-radius: 50%; }
.scale { display: inline-block; width: 120px; height: 10px; border-radius: 5px; vertical-align: -1px; margin: 0 8px; background: linear-gradient(90deg, #8f9dc4, #ffc619); }
.share-bar { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.share-bar i { display: block; height: 100%; width: var(--w); border-radius: 5px; background: var(--sun); }
.home .date { margin-top: 8px; }
/* one to four tiles (a tile needs its data): the row stays full. The home page and /energia/ */
.board-1 .tile { grid-column: 1 / -1; min-height: 0; }
@media (max-width: 599px) { .board-3 .tile:nth-child(3) { grid-column: 1 / -1; min-height: 0; } }
@media (min-width: 600px) and (max-width: 959px) {
    :is(.home, .energy) .board .t-roof { grid-column: auto; }
    .board-3 { grid-template-columns: repeat(3, 1fr); }
    .board-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    :is(.home, .energy) .tile { grid-column: span 3; }
    .board-3 .tile { grid-column: span 4; }
    .board-2 .tile { grid-column: span 6; }
    .board .t-map, .board-1 .tile { grid-column: 1 / -1; }
}
.towns { margin-top: 18px; }
.town-row { display: grid; grid-template-columns: minmax(6.2em, 1.1fr) 3.1em 3.1em minmax(90px, 2.2fr) 3.2em; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.town-row:last-child { border-bottom: 1px solid var(--rule); }
.town-row.head { border: 0; padding: 0 0 4px; color: var(--ink-2); align-items: end; }
/* the smaller size on the cells, not the row: the columns are in em and must match the rows below */
.town-row.head > * { font-size: .8rem; }
.town-row.head i { font-style: normal; }
@media (max-width: 719px) { .town-row.head i { display: none; } }
.town-row a { font-weight: 700; text-decoration: none; }
.town-row a:hover { text-decoration: underline; }
.town-row .t { font: 700 1.15rem/1 var(--cond); }
.town-row .s { display: grid; grid-template-columns: 1fr 3.4em; align-items: center; gap: 8px; }
.town-row .s b { text-align: right; font-weight: 700; white-space: nowrap; }
.town-row .k { text-align: right; }
.town-row .len { display: none; }
.towns .cells { --ch: 18px; }
/* without a forecast: the times alone, the day length on a phone too */
.towns.bare .town-row { grid-template-columns: minmax(6.2em, 1.4fr) 3.4em 3.4em minmax(6em, 1fr); }
.towns.bare .town-row .len { display: block; white-space: nowrap; color: var(--ink-2); }
@media (min-width: 720px) { .towns.bare .town-row { grid-template-columns: minmax(9em, 15em) 5em 5em 1fr; } }
@media (min-width: 720px) { .town-row { grid-template-columns: minmax(9em, 1.2fr) 4em 4em 6.4em minmax(200px, 3fr) 4em; gap: 18px; } .town-row .len { display: block; white-space: nowrap; color: var(--ink-2); } .town-row .t { font-size: 1.3rem; } }
@media (max-width: 419px) { .town-row { grid-template-columns: minmax(5.6em, 1.1fr) 2.9em 2.9em minmax(70px, 2fr) 2.2em; gap: 7px; } .town-row .s { grid-template-columns: 1fr; } .town-row .s b { display: none; } }

.site-footer { margin-top: 64px; padding: 26px 0 40px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0; font-size: .98rem; }
.site-footer nav a { color: var(--ink); }

/* energy: the share as a sentence with its figure, the sources as one stacked bar, the charts of a day, the columns of a month and a year */
.energy h1 { font: 800 clamp(1.7rem, 6.4vw, 3rem)/1.02 var(--cond); letter-spacing: -.01em; max-width: 17ch; margin-top: 8px; }
.energy h1 .share-num { display: block; font-size: 2.6em; line-height: .9; letter-spacing: -.015em; }
.energy .day .date { margin-top: 10px; max-width: 60ch; }
p.late { margin-top: 12px; max-width: 62ch; padding: 10px 14px; border-radius: 14px; background: var(--golden-soft); font-size: .95rem; }
.late[hidden] { display: none; }
.mixbar { display: flex; gap: 2px; height: 36px; margin-top: 22px; border-radius: 10px; overflow: hidden; }
.mixbar i { flex: var(--w) 0 0; min-width: 3px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 10px 0 0; padding: 0; font-size: .92rem; }
.mix-legend i, .mix th i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; }
/* the eight groups of sources: Okabe and Ito's colours, apart for the three kinds of colour blindness; each is named beside its colour */
.src-solar { background: #ffc619; }
.src-wind { background: #009e73; }
.src-water { background: #56b4e9; }
.src-nuclear { background: #cc79a7; }
.src-coal { background: #2c3454; }
.src-gas { background: #d55e00; }
.src-storage { background: #0072b2; }
.src-other { background: #dfe3ec; }
.share-bar.on-paper { height: 14px; border-radius: 7px; margin-top: 20px; max-width: 760px; background: var(--cloud-soft); }
.e-chart, .p-chart { margin-top: 18px; }
.e-chart .panel, .p-chart .panel { padding: 34px 16px 14px 56px; border-radius: 22px; background: var(--panel); color: #fff; }
.p-chart .panel-light { background: var(--cloud-soft); color: var(--ink); }
.e-plot { position: relative; height: clamp(200px, 34vw, 320px); }
.e-plot svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.e-grid { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.e-total { fill: rgba(255, 255, 255, .13); }
.e-total-line { fill: none; stroke: rgba(255, 255, 255, .78); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.e-solar { fill: #ffc619; }
.e-use { fill: none; stroke: #b9a9ff; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.e-before { fill: none; stroke: #ffc619; stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.e-mw { position: absolute; left: -8px; transform: translate(-100%, 50%); font-size: .78rem; line-height: 1; white-space: nowrap; color: rgba(255, 255, 255, .8); }
.e-mw.e-unit { top: -24px; transform: translateX(-100%); }
.e-peak { position: absolute; transform: translate(-50%, -5px); font: 800 1rem/1 var(--cond); white-space: nowrap; color: #ffc619; text-shadow: 0 0 5px var(--panel), 0 0 2px var(--panel); pointer-events: none; }
.e-end { position: absolute; top: -6px; bottom: 0; border-left: 2px solid #fff; pointer-events: none; }
.e-end b { position: absolute; top: -18px; left: 0; transform: translateX(-50%); font-size: .78rem; line-height: 1; white-space: nowrap; }
.e-end.flip b { transform: translateX(-100%); }
.e-hours { grid-auto-flow: row; grid-template-columns: repeat(8, 1fr); gap: 0; text-align: left; }
.e-hours span { justify-self: start; transform: translateX(-50%); }
.e-chart .hours { color: rgba(255, 255, 255, .72); }
.p-chart .e-grid { stroke: color-mix(in srgb, var(--ink) 14%, transparent); }
.p-chart .e-mw { color: var(--ink-2); }
.p-plot rect.pos { fill: var(--ink); }
.p-plot rect.neg { fill: var(--golden); }
.p-zero { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.p-cheap { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--sun) 60%, transparent); }
.p-now { border-color: var(--golden); }
.legend i.k-solar { --c: #ffc619; }
.legend i.k-total { --c: #9aa3c4; }
.legend i.k-bar { --c: var(--cloud); }
.legend i.k-use, .legend i.k-tick { --c: #8f7df0; width: 18px; height: 4px; border-radius: 2px; vertical-align: 3px; }
.legend i.k-tick { --c: var(--ink); }
.legend i.k-before { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed #c79a00; background: none; vertical-align: 4px; }
.e-bars { margin-top: 22px; padding-left: 50px; }
.e-bars .e-plot { height: clamp(170px, 26vw, 240px); border-bottom: 1px solid var(--rule); }
.e-bars .e-mw { color: var(--ink-2); }
.e-bars .e-line::after { content: ""; position: absolute; left: calc(100% + 8px); top: 50%; width: 100vw; max-width: calc(min(100vw, 1160px) - 90px); border-top: 1px solid var(--rule); }
.e-bars .cols { position: absolute; inset: 0; height: auto; gap: 3px; grid-auto-columns: minmax(0, 1fr); }
.e-bars .hours { grid-auto-columns: minmax(0, 1fr); }
.e-bars a.col { text-decoration: none; }
.e-bars .col .bar { border-radius: 4px 4px 1px 1px; }
.e-bars-solar .bar { background: var(--sun); }
.e-bars-total .bar { background: var(--cloud); }
.e-bars .partial .bar { opacity: .55; }
.e-bars a.col:hover .bar, .e-bars a.col:focus-visible .bar { box-shadow: 0 0 0 2px var(--ink); }
.e-bars .tick { position: absolute; left: -1px; right: -1px; bottom: var(--t); height: 3px; border-radius: 2px; background: var(--ink); }
.e-bars .val { font-size: .74rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
/* the tick of the consumption crosses the top of a column: the numbers of that chart are in the table */
.e-bars-total .val { display: none; }
@media (max-width: 599px) { .e-bars { padding-left: 40px; } .e-bars .val { font-size: .62rem; letter-spacing: -.03em; } .e-bars-month .hours { font-size: .68rem; } }
.e-bars-day .cols, .e-bars-day .hours { gap: 2px; }
.e-bars + .legend { padding-left: 50px; }
caption { text-align: left; color: var(--ink-2); font-size: .88rem; padding-bottom: 8px; }
.nums td, .nums thead th:not(:first-child) { text-align: right; padding: 8px 0 8px 10px; }
.nums td { white-space: nowrap; }
.nums thead th { vertical-align: bottom; }
.mix { max-width: 560px; margin-top: 16px; }
.mix tr.solar > * { font-weight: 700; }
.energy-table { margin-top: 28px; }
.neg-hours { color: var(--ink-2); }
@media (max-width: 719px) { .energy-table { font-size: .88rem; } .energy-table .wide { display: none; } }
.tomorrow { margin-top: 14px; }
.chips-title { font: 700 1.05rem/1.2 var(--text); margin-top: 22px; }
.chip-current { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; }
.pager a { padding: 8px 14px; border-radius: 999px; background: var(--cloud-soft); text-decoration: none; font-weight: 600; }
.pager a:hover { background: var(--sun-soft); }
.pager-more { margin-top: 14px; color: var(--ink-2); }

/* the pages of text: /uv/ and /izvori/ */
.page h1 { font: 800 clamp(2.6rem, 10.5vw, 5rem)/.94 var(--cond); letter-spacing: -.012em; margin-top: 6px; }
.page .sentence { font-size: 1.12rem; max-width: 46ch; margin-top: 12px; }
.prose .lead { margin-top: 34px; }
.prose p, .prose li { max-width: 66ch; }
.prose section.open > p, .prose section.open > ul, .prose section.open > h3 { margin-top: 14px; }
.prose h3 { font: 700 1.1rem/1.25 var(--text); margin-top: 26px; }
.prose .facts { padding-left: 1.15em; }
.prose .facts li + li { margin-top: 8px; }
.formula { padding: 12px 16px; border-radius: 14px; background: var(--cloud-soft); font-weight: 600; }
.table-scroll { overflow-x: auto; margin-top: 16px; }
.bands { margin-top: 16px; max-width: 760px; }
.bands th { white-space: nowrap; padding-right: 22px; vertical-align: top; font-weight: 700; }
.bands .uv-chip { margin-right: 6px; }
.exposure { max-width: 620px; }
.exposure .numeral { display: inline-block; min-width: 1.6em; font: 800 1.05rem/1 var(--cond); }
/* the scale: the five bands side by side, each as wide as its share of the numbers 0 to 12 */
.uv-scale { display: flex; gap: 3px; list-style: none; margin: 26px 0 0; padding: 0; border-radius: 18px; overflow: hidden; }
.uv-scale li { flex: 3 0 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 12px 13px; background: var(--uv); color: #0f1a40; }
.uv-scale li.uv-high, .uv-scale li.uv-extreme { flex-grow: 2; }
.uv-scale li.uv-very-high, .uv-scale li.uv-extreme { color: #fff; }
.uv-scale b { font: 800 clamp(1.3rem, 5.4vw, 2.2rem)/1 var(--cond); white-space: nowrap; }
.uv-scale span { font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 599px) { .uv-scale li { padding: 11px 7px 10px; } .uv-scale span { font-size: .72rem; } }
/* today's maximum of a town as a bar on the same scale */
.uv-towns { display: grid; gap: 8px; list-style: none; margin: 18px 0 0; padding: 0; max-width: 760px; }
.uv-towns li { display: grid; grid-template-columns: minmax(6.5em, 10em) 1fr 2.4em 5.6em; align-items: center; gap: 12px; }
.uv-towns a { font-weight: 700; text-decoration: none; }
.uv-towns a:hover { text-decoration: underline; }
.uv-towns .track { height: 14px; border-radius: 7px; background: var(--cloud-soft); overflow: hidden; }
.uv-towns .track i { display: block; height: 100%; width: var(--w); min-width: 8px; border-radius: 7px; background: var(--uv); }
.uv-towns em { font-style: normal; color: var(--ink-2); font-size: .93rem; }
@media (max-width: 599px) { .uv-towns li { grid-template-columns: minmax(5.6em, 7.5em) 1fr 2.4em; } .uv-towns em { display: none; } }
/* the jobs of the site and when each last ran */
.freshness { max-width: 760px; margin-top: 16px; }
.freshness .when { font: 700 1.05rem/1.2 var(--text); }
.freshness .state::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--uv-low); }
.freshness .is-late .state { color: var(--ink); font-weight: 700; }
.freshness .is-late .state::before { background: var(--golden); }

/* every oblast a chip with its count; the open one takes a row of its own and shows its towns */
.oblasts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.oblasts details { margin: 0; }
.oblasts summary { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 14px; border-radius: 999px; background: var(--cloud-soft); list-style: none; }
.oblasts summary::-webkit-details-marker { display: none; }
.oblasts summary small { font-weight: 400; color: var(--ink-2); }
.oblasts summary:hover { background: var(--sun-soft); }
.oblasts details[open] { flex-basis: 100%; }
.oblasts details[open] summary { background: var(--sun); color: #0f1a40; }
.oblasts details[open] summary small { color: inherit; }
.oblasts .chips { margin: 10px 0 10px; }

/* the search results, under the masthead field and under the home page's */
.find .results, .search .results {
    position: absolute; z-index: 5; right: 0; top: 100%; width: max(100%, 300px); margin: 8px 0 0; padding: 6px; list-style: none;
    background: var(--paper); border-radius: 16px; box-shadow: 0 0 0 1px var(--rule), 0 18px 40px -16px rgba(15, 26, 64, .45);
}
.search .results { left: 0; right: auto; width: 100%; }
.results[hidden] { display: none; }
.results li a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.results li a small { font-weight: 400; color: var(--ink-2); }
.results li.active a, .results li a:hover { background: var(--sun-soft); }
.find input:focus, .search input:focus { outline: 3px solid var(--sun); outline-offset: 0; }
@media (max-width: 719px) {
    /* a round button that opens into the field, over the links */
    .masthead { position: relative; }
    .find:focus-within { position: absolute; z-index: 6; left: 20px; right: 20px; }
    .find:focus-within input { width: 100%; padding: 9px 14px 9px 40px; cursor: text; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
    .find:focus-within input::placeholder { color: var(--ink-2); }
    .find:focus-within svg { left: 13px; }
    .find .results { left: 0; right: 0; width: auto; }
}

/* ads: hidden until a network exists; a fixed height then keeps the page from shifting */
.ad-slot { display: none; min-height: 90px; margin: 32px 0 0; }
time { white-space: nowrap; }

/* the dark theme's own surfaces, after the rules they change */
@media (prefers-color-scheme: dark) {
    .status.is-down { background: var(--night-2); }
    .src-coal { background: #56618c; }
    .src-other { background: #c9cfdd; }
}

@media print {
    .masthead .nav, .find, .ad-slot, .site-footer nav { display: none; }
    .ribbon-hero { animation: none; }
    details { display: block; }
    details > *:not(summary) { display: block; }
}
