/* License: LICENSE.md */
/* www-styles.css — Stylesheet for www.odat.ch content pages */

@font-face {
  font-family: "DINish";
  src: url("/fonts/DINish[slnt,wdth,wght].woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 108%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f6f6f6;
  --color-text: #222222;
  --color-text-secondary: #6f6f6f;
  --color-surface: #ffffff;
  --color-border: #e2e2e2;
  --color-blue-4: #006dca;
  --color-powder-2: #8df0ff;
  --font-base: clamp(14px, calc(12.2px + 0.25vw), 18px);
}

/* Dark mode: explicit toggle */
.dark-mode {
  --color-bg: #222222;
  --color-text: #f6f6f6;
  --color-text-secondary: #8b8b8b;
  --color-surface: #3e3e3e;
  --color-border: #3e3e3e;
  --color-blue-4: #0089fc;
  --color-powder-2: #004048;
}

/* Dark mode: system preference fallback (no-JS) */
@media (prefers-color-scheme: dark) {
  html:not(.light-mode):not(.dark-mode) {
    --color-bg: #222222;
    --color-text: #f6f6f6;
    --color-text-secondary: #8b8b8b;
    --color-surface: #3e3e3e;
    --color-border: #3e3e3e;
    --color-blue-4: #0089fc;
    --color-powder-2: #004048;
  }
}

html {
  height: 100%;
  font-size: var(--font-base);
}

body {
  font-family: "DINish", Bahnschrift, "DIN Alternate", "Franklin Gothic Medium",
    "Nimbus Sans Narrow", sans-serif-condensed, sans-serif;
  font-weight: 420;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
  line-height: 1.55;
  position: relative;
}

/* ── Top bar (logo left, toggle right) ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 50rem;
  padding: 1.25rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
  padding: 0.25rem;
  margin: -0.25rem;
}

.logo-link img {
  height: 36px;
  width: auto;
}

/* Logo switching: light/dark */
.logo-bright { display: block; }
.logo-dark { display: none; }

.dark-mode .logo-bright { display: none; }
.dark-mode .logo-dark { display: block; }

@media (prefers-color-scheme: dark) {
  html:not(.light-mode):not(.dark-mode) .logo-bright { display: none; }
  html:not(.light-mode):not(.dark-mode) .logo-dark { display: block; }
}

/* ── Dark mode toggle (icon only) ── */
.dm-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

@media (hover: hover) {
  .dm-toggle:hover {
    background-color: var(--color-border);
  }
}

.icon-light-mode { display: block; }
.icon-dark-mode { display: none; }

.dark-mode .icon-light-mode { display: none; }
.dark-mode .icon-dark-mode { display: block; }

@media (prefers-color-scheme: dark) {
  html:not(.light-mode):not(.dark-mode) .icon-light-mode { display: none; }
  html:not(.light-mode):not(.dark-mode) .icon-dark-mode { display: block; }
}

/* ── Article content ── */
article {
  width: 100%;
  max-width: 50rem;
  flex: 1;
}

h1 {
  font-size: 1.728rem;
  font-weight: 620;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h2 {
  font-size: 1.44rem;
  font-weight: 620;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h3 {
  font-size: 1.2rem;
  font-weight: 620;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

p {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

ul,
ol {
  margin-bottom: 0.4em;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.3rem;
}

a {
  color: var(--color-blue-4);
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-decoration-skip-ink: auto;
  text-underline-offset: 0.18em;
}

@media (hover: hover) {
  a:hover {
    background-color: var(--color-powder-2);
  }
}

a:focus-visible {
  outline: 2px solid #00386d;
  outline-offset: 2px;
}

/* ── Footer ── */
footer {
  width: 100%;
  max-width: 50rem;
  margin-top: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.footer-sep {
  margin: 0 0.4em;
}
