/* workdays.cloud — the whole stylesheet.

   Three colours carry the map, and the table underneath carries the same
   information for anyone the colours do not reach. */

:root {
  --bg: #fbfaf8;
  --ink: #1d1f21;
  --muted: #6b7076;
  --rule: #e2ded7;
  --sea: #ffffff;       /* white, as the light blue of a working day needs */

  --working: #dbe7fb;   /* at work: the main site's blue for a working day */
  --weekend: #f0b458;   /* the weekend, wherever it falls */
  --holiday: #2f9e8f;   /* a public holiday */
  --no-data: #c9cfd6;   /* no calendar for the day: grey, kept for that alone */
  --context: #efeee9;   /* another map's land around a continent's */
  --link-line: #c3cad3; /* the quiet underline of a link between maps */
  --border: #fbfaf8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --ink: #e9e6e1;
    --muted: #9aa1a8;
    --rule: #2c3033;
    --sea: #1c2023;

    --working: #2c4a75;
    --weekend: #b8823a;
    --holiday: #2f9e8f;
    --no-data: #3d4247;
    --context: #24282b;
    --link-line: #4b545c;
    --border: #16181a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  align-items: baseline;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

footer.bar { border: 0; border-top: 1px solid var(--rule); margin-top: 3rem; }

.brand { display: inline-flex; align-items: baseline;
         font-size: 1.15rem; font-weight: 650; text-decoration: none; color: var(--ink); }
.brand span { color: var(--holiday); }
/* The tab's icon before the name, centred in the line the name takes; the
   name keeps the baseline the tagline stands on, whatever the font. */
.brand img { align-self: center; width: 1.4em; height: 1.4em; margin-right: .4em; }
.tagline, footer p { margin: 0; color: var(--muted); font-size: .9rem; }

/* The page in another language: the code, and a menu of the others. */
.languages { margin-left: auto; position: relative; font-size: .9rem; }
.languages summary { list-style: none; cursor: pointer; display: flex; align-items: center;
                     gap: .35rem; color: var(--muted); }
.languages summary::-webkit-details-marker { display: none; }
.languages summary:hover, .languages[open] summary { color: var(--ink); }
.languages svg { width: 1rem; height: 1rem; }
.languages-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 10;
                  min-width: 8rem; padding: .3rem 0; background: var(--bg);
                  border: 1px solid var(--rule); border-radius: 8px;
                  box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.languages-menu a { display: block; padding: .35rem .9rem; color: var(--ink); text-decoration: none; }
.languages-menu a:hover { background: var(--working); }

/* One map to another, above the map: the world and the continents, then the
   countries, smaller. */
.maps { margin: 1.25rem 0 0; }
.maps ul { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.maps-wide { font-size: 1.05rem; font-weight: 600; }
.maps ul.maps-narrow { font-size: .88rem; margin-top: .35rem; }
/* Links, quietly: a thin light underline that darkens on hover into the
   accent the current map has (GB, 2026-10-29). */
.maps a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--link-line);
          text-decoration-thickness: 1px; text-underline-offset: .3em;
          transition: color .15s ease, text-decoration-color .15s ease; }
.maps a:hover, .maps a:focus-visible { color: var(--ink); text-decoration-color: var(--holiday);
                                       text-decoration-thickness: 2px; }
.maps a[aria-current="page"] { color: var(--ink); text-decoration-color: var(--holiday);
                               text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: reduce) { .maps a { transition: none; } }

main { padding: 0 clamp(1rem, 4vw, 3rem); max-width: 1200px; margin: 0 auto; }

/* --- the heading and the date ----------------------------------------- */

h1 { font-size: clamp(1.45rem, 1rem + 1.6vw, 2.1rem); line-height: 1.2; margin: 1.5rem 0 .5rem; }

/* The heading and the sentence under it, which the script keeps as tall as
   the tallest yet (map.js): a shorter one moved the map and the strip up.
   Its margins inside it, so that its height is all the room it takes. */
.day-head { display: flow-root; }

/* --- map ------------------------------------------------------------- */

.map { margin: 1.5rem 0 0; background: var(--sea); border: 1px solid var(--rule);
       border-radius: 10px; padding: .5rem; }
.map svg { display: block; width: 100%; height: auto; }
/* The line where the date changes lies over the map in a box of the
   drawing's own proportions, as tall as the map and centred on it, so a
   date written at a percentage of it lands where meant: also on a map held
   to a height, with the sea on either side (`.map.country`). */
.map-frame { position: relative; }
.date-line { position: absolute; top: 0; bottom: 0; left: 50%; max-width: 100%;
             transform: translateX(-50%); pointer-events: none; }
.map .date-line svg { width: 100%; height: 100%; max-height: none; }
.date-line path { fill: none; vector-effect: non-scaling-stroke;
                  stroke-linejoin: round; stroke-linecap: round; }
.date-line .halo { stroke: var(--sea); stroke-width: 4px; opacity: .85; }
.date-line .line { stroke: var(--ink); stroke-width: 1.5px; stroke-dasharray: 5 3; }
.date-side {
  position: absolute; padding: .05rem .4rem; border-radius: 4px; white-space: nowrap;
  font-size: .8rem; font-weight: 650; line-height: 1.4; color: var(--ink);
  background: color-mix(in srgb, var(--sea) 85%, transparent);
}
/* Standing on the line's lower end, at the bottom of the map (GB,
   2026-11-02), whatever the size they are drawn at; along the map's edge
   one on the other, on the line's inner side. */
.date-side.west { transform: translate(calc(-100% - 5px), calc(-100% - 3px)); }
.date-side.east { transform: translate(5px, calc(-100% - 3px)); }
.date-side.west.upper { transform: translate(calc(-100% - 5px), calc(-200% - 5px)); }
.date-side.east.upper { transform: translate(5px, calc(-200% - 5px)); }
/* A country stands taller than the world is wide: held to about the world
   map's height, with the sea on either side (GB, 2026-10-29). */
.map.country svg { max-height: min(55vh, 480px); }

/* Anything the day's <style> block does not name has no data for the day:
   it names the working countries too, so that grey means nothing else. */
.c { fill: var(--no-data); stroke: var(--border); stroke-width: .5; }
.m { stroke-width: .6; }
.c:hover { stroke: var(--ink); stroke-width: 1; }
/* Another map's land around a continent's: there, not part of it. */
.x { fill: var(--context); stroke: var(--border); stroke-width: .5; pointer-events: none; }

/* --- date strip ------------------------------------------------------ */

.strip { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 1.5rem; }

.strip .cards {
  display: flex; gap: .3rem; flex: 1;
  list-style: none; margin: 0; padding: .25rem 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-behavior: smooth; scrollbar-width: thin;
}

/* One card: weekday, the number, the month, and the holiday bar. A button,
   so it takes the page's type and none of the browser's own look. */
.day {
  display: flex; flex-direction: column; align-items: center;
  min-width: 3.05rem; padding: .35rem .3rem .3rem;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit; cursor: pointer;
}
.day:hover { border-color: var(--holiday); }

.dow, .mon {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); line-height: 1.5;
}
.dom { font-size: 1.15rem; font-weight: 620; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* The tick sits in a fixed-height track so every card is the same size and the
   bars share a baseline; --h is the height as a percentage of the busiest day.
   Not `.bar` — that name is taken by the page header and footer, and a card
   would have inherited their padding and bottom border. */
.tick { display: flex; align-items: flex-end; width: 1.5rem; height: 14px; margin-top: .3rem; }
.tick::after {
  content: ""; display: block; width: 100%;
  height: calc(var(--h, 0) * 0.14px);
  background: var(--holiday); border-radius: 1px;
}

/* The card for right now: „Now” over the dates it covers, framed in the
   holiday colour, so it reads as another kind of card than a date. The
   thicker border takes its width from the padding: the card keeps the
   others' height. */
.day.now-card { border: 2px solid var(--holiday); padding: calc(.35rem - 1px) calc(.3rem - 1px) calc(.3rem - 1px); }
.day.now-card .dow { color: var(--holiday); font-weight: 650; }
.day.now-card .dom { white-space: nowrap; }

/* The card on screen, a date or right now. */
.day.current { border-color: var(--holiday); background: var(--holiday); color: #fff; }
.day.current .dow, .day.current .mon { color: rgba(255, 255, 255, .85); }
.day.current .tick::after { background: rgba(255, 255, 255, .9); }

.step {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 2.2rem; height: 2.2rem; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--bg); color: var(--ink);
  font: inherit; cursor: pointer;
}
.step:hover:enabled { border-color: var(--holiday); }
.step:disabled { opacity: .35; cursor: default; }

/* Under the strip: back to right now, and a date from the browser's
   calendar. In the page from the start, so that showing it moves nothing;
   without a script `day.html` hides it. */
.jump {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  margin: -.75rem 0 1.5rem; font-size: .95rem;
}
/* Framed in the holiday colour, „Now” as its card on the strip is, so the
   two read as the strip's controls (GB, 2026-11-02: easy to miss in grey). */
.jump label { color: var(--ink); }
.jump .now, .jump input {
  padding: .35rem .8rem; border: 1px solid var(--holiday); border-radius: 6px;
  background: var(--bg); color: var(--ink); font: inherit;
}
.jump .now { border-width: 2px; padding: calc(.35rem - 1px) calc(.8rem - 1px);
             font-weight: 600; text-decoration: none; }
.jump .now:hover, .jump .now:focus-visible { background: var(--holiday); color: #fff; }
/* The browser's own calendar, in the page's light or dark. */
.jump input { color-scheme: light dark; }
/* A date outside the year: the field says so while it is being typed. */
.jump input:invalid { border-color: var(--weekend); }

/* Under the strip: why a date did not come, or that one needs a script. */
.notice { margin: -1rem 0 1.5rem; color: var(--muted); font-size: .9rem; }

/* --- the day --------------------------------------------------------- */

/* No margin below: the links to the other maps keep their own from it. */
.caption { font-size: 1.15rem; margin: 0; }
.caption b { font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; padding: 0; margin: 0 0 2rem; }
.legend li { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .9rem; }
.sw { width: .95rem; height: .95rem; border-radius: 3px; display: inline-block; }
.sw.working { background: var(--working); }
.sw.weekend { background: var(--weekend); }
.sw.holiday { background: var(--holiday); }
.sw.no-data { background: var(--no-data); }
/* At work, with part of the country off: the stripes the map has, from the
   narrowest to the widest, as more of the country is off. */
.sw.part-holiday, .sw.part-weekend {
  --part: var(--holiday); width: 2.1rem;
  background:
    repeating-linear-gradient(45deg, var(--part) 0 1.5px, var(--working) 1.5px 6px) left / 34% 100% no-repeat,
    repeating-linear-gradient(45deg, var(--part) 0 3px, var(--working) 3px 6px) center / 34% 100% no-repeat,
    repeating-linear-gradient(45deg, var(--part) 0 4.5px, var(--working) 4.5px 6px) right / 34% 100% no-repeat;
}
.sw.part-weekend { --part: var(--weekend); }
.patterns { position: absolute; width: 0; height: 0; overflow: hidden; }

h2 { font-size: 1.05rem; margin: 2rem 0 .75rem; }

.days { border-collapse: collapse; width: 100%; }
.days th, .days td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--rule); font-weight: 400; }
.days thead th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.days tbody th { font-weight: 550; width: 40%; }
.days a { color: inherit; }

.inline-list { color: var(--muted); }
/* Right now: the countries on two dates at once, under the legend. */
.split { margin: -1rem 0 2rem; color: var(--muted); }

/* --- the text under the map, the same every day ---------------------- */

.about { max-width: 46rem; margin-top: 3rem; padding-top: .5rem; border-top: 1px solid var(--rule); }
.about p { margin: 0 0 1rem; }

/* The fragment is replaced wholesale; a hint that it is being fetched. */
#day.loading { opacity: .55; }
