/* Colour themes (13.10.2026; 29.10.2026: Dark, Light, Ocean and Violet, Ocean the default). The :root tokens in each
   page's own styles are Violet's; theme.js sets Ocean when nothing is chosen. Dark (black and white), Light and Ocean
   redefine the same tokens. The picker sits in the header's .prefs group with the language menu. */
:root {
  --accent-ring: rgba(106, 77, 255, 0.14);   /* thin glow line around the hero board */
  --accent-line: rgba(106, 77, 255, 0.45);   /* border of the accent chips */
  --logo-off: #2a3040;                       /* the unlit dots of the logo */
}
:root[data-palette="light"] {
  --bg: #f5f5fa;
  --band: #ececf5;
  --surface: #ffffff;
  --surface-2: #f0f0f8;
  --line: #d8d9e8;
  --fg: #15172a;
  --muted: #50566e;
  --glow: rgba(91, 60, 240, 0.16);
  --header-bg: rgba(245, 245, 250, 0.88);
  --accent: #5b3cf0;
  --accent-text: #4a2bd8;
  --accent-ink: #ffffff;
  --accent-bg: rgba(91, 60, 240, 0.1);
  --accent-ring: rgba(91, 60, 240, 0.16);
  --accent-line: rgba(91, 60, 240, 0.4);
  --bar: #c3c6d6;
  --logo-off: #cdcfe0;
  --free: #187a41;
  --free-bg: rgba(24, 122, 65, 0.12);
  --booked: #c2362f;
  --booked-bg: rgba(194, 54, 47, 0.12);
  color-scheme: light;
}
/* Dark (29.10.2026, Janne: "black and white"): black and greys, white as the accent, black text on white buttons */
:root[data-palette="dark"] {
  --bg: #0b0b0c;
  --band: #111113;
  --surface: #18181b;
  --surface-2: #202024;
  --line: #2e2e33;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --glow: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(11, 11, 12, 0.86);
  --accent: #f4f4f5;
  --accent-text: #ffffff;
  --accent-ink: #0b0b0c;
  --accent-bg: rgba(255, 255, 255, 0.1);
  --accent-ring: rgba(255, 255, 255, 0.14);
  --accent-line: rgba(255, 255, 255, 0.4);
  --bar: #52525b;
  --logo-off: #2e2e33;
  color-scheme: dark;
}
:root[data-palette="ocean"] {
  --bg: #0a1220;
  --band: #0d1729;
  --surface: #12203a;
  --surface-2: #172846;
  --line: #243759;
  --fg: #eaf1fb;
  --muted: #9eb0cd;
  --glow: rgba(31, 143, 255, 0.22);
  --header-bg: rgba(10, 18, 32, 0.86);
  --accent: #136fe0;
  --accent-text: #6cb4ff;
  --accent-ink: #ffffff;
  --accent-bg: rgba(19, 111, 224, 0.18);
  --accent-ring: rgba(31, 143, 255, 0.16);
  --accent-line: rgba(31, 143, 255, 0.45);
  --bar: #475978;
  --logo-off: #243759;
  color-scheme: dark;
}

/* The logo follows the theme */
.brand circle[fill="#6a4dff"] { fill: var(--accent); }
.brand circle[fill="#2a3040"] { fill: var(--logo-off); }

/* Header preferences: the colour themes now, the language menu later */
.prefs { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav ~ .prefs { margin-left: 0; }
.top .prefs + .btn { margin-left: 0; }
.palettes { display: flex; align-items: center; gap: 6px; }
.sw {
  width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid var(--sw-line); background: var(--sw-bg);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.15s ease;
}
.sw::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sw-dot); }
.sw:hover { transform: scale(1.1); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-text); }
.sw:focus-visible { border-radius: 50%; }
/* Each swatch is a small picture of its theme: the page colour with the accent in the middle */
.sw-dark { --sw-bg: #0b0b0c; --sw-line: #3f3f46; --sw-dot: #f4f4f5; }
.sw-violet { --sw-bg: #0e1016; --sw-line: #3b4258; --sw-dot: #6a4dff; }
.sw-light { --sw-bg: #f5f5fa; --sw-line: #c3c5d6; --sw-dot: #5b3cf0; }
.sw-ocean { --sw-bg: #0a1220; --sw-line: #2c4470; --sw-dot: #2b8fff; }
/* On a phone one round button cycles through the themes; it always shows the current one */
.sw-cycle { display: none; --sw-bg: var(--bg); --sw-line: var(--accent-text); --sw-dot: var(--accent); }

/* Language menu (the landing pages, 13.10.2026): eleven languages behind one small button. A <details> element, so it
   works without scripts; theme.js closes it on a click elsewhere and on Escape. */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  font-family: var(--data); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; line-height: 1.2;
  color: var(--muted); padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--fg); border-color: var(--accent-line); }
.lang-menu .globe { width: 14px; height: 14px; flex: 0 0 auto; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  min-width: 184px; max-height: calc(100vh - 96px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}
:root[data-palette="light"] .lang-list { box-shadow: 0 16px 40px rgba(21, 23, 42, 0.14); }
.lang-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--fg); font-size: 0.95rem; line-height: 1.3;
}
.lang-list a span { font-family: var(--data); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); }
.lang-list a:hover { background: var(--surface-2); }
.lang-list a[aria-current="page"], .lang-list a[aria-current="page"] span { color: var(--accent-text); font-weight: 600; }

/* Header words never wrap: a wrapped button or link would make the header two rows high (13.10.2026) */
.top .btn, .top .nav a, .lang-menu summary { white-space: nowrap; }

/* The section links make room for the theme and language controls */
@media (max-width: 1000px) { .nav { display: none; } .nav ~ .prefs { margin-left: auto; } }
/* Just above that, with four theme swatches, the longest links (German) need less space between them (29.10.2026) */
@media (min-width: 1001px) and (max-width: 1100px) { .nav { gap: 16px; } }
@media (max-width: 560px) { .palettes .sw { display: none; } .palettes .sw-cycle { display: grid; } }
@media (max-width: 420px) {
  .top .wrap { gap: 12px; }
  .palettes { gap: 5px; }
  .sw { width: 22px; height: 22px; }
  .sw::after { width: 8px; height: 8px; }
  .lang-menu .globe { display: none; }
  .lang-menu summary { padding: 5px 8px; }
}
@media (max-width: 350px) {
  .top .wrap { gap: 10px; }
  .brand { font-size: 1.3rem; gap: 8px; }
  .brand svg { width: 22px; height: 22px; }
  .top .btn { padding: 8px 12px; font-size: 0.9rem; }
  .palettes { gap: 4px; }
  .sw { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) { .sw { transition: none; } .sw:hover { transform: none; } }
