/* Queer Fact of the Day, Version 2 (kantig)
   Layout: poster panel per fact (asymmetric meta column + giant headline), one multilingual marquee,
   the full story below, a sharp 12-month calendar as the home hub, a searchable archive.
   Shape rule: everything sharp (radius 0), 2px ink borders. */
:root {
  --bg: #f3f2f6;
  --fg: #16141b;
  --muted: #5b5766;
  --line: #16141b;
  --surface: #ffffff;
  --day: #2c4fa3;
  --day-ink: #f4f6ff;
  --f-display: "Anybody", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-mono: "DM Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111015; --fg: #efecf4; --muted: #a7a2b3; --line: #efecf4; --surface: #1b1a21;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111015; --fg: #efecf4; --muted: #a7a2b3; --line: #efecf4; --surface: #1b1a21;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* hidden must win over component display rules (search filter, empty state) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  padding-inline: var(--gutter);
  padding-block: 0 48px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--day); outline-offset: 3px; }
.wrap { max-width: 1320px; margin-inline: auto; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  flex-wrap: wrap; padding-block: 12px;
}
/* the logo files carry wide black margins: crop them so the wordmark reads at header size */
.logo { display: block; line-height: 0; overflow: hidden; background: #0b0a0c; padding: 4px 8px; }
.logo img { height: 96px; width: auto; max-width: none; margin: -16px -15px -20px -26px; }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav > a {
  text-decoration: none; padding: 7px 14px; border: 2px solid var(--line);
  font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.nav > a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.nav > a:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .nav > a:not([aria-current]):hover { background: var(--fg); color: var(--bg); } }
.langs { display: flex; border: 2px solid var(--line); }
.langs a, .langs span {
  font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 12px; text-decoration: none;
}
.langs > * + * { border-left: 2px solid var(--line); }
.langs [aria-current="true"] { background: var(--fg); color: var(--bg); }

/* ---------- Kicker line ---------- */
.kicker {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  margin: 14px 0 14px; font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted);
}
.kicker a { text-underline-offset: 3px; }
.site-title {
  margin: 0; font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 140;
  font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1; text-transform: uppercase; letter-spacing: -0.01em;
  color: var(--fg);
}

/* ---------- Poster (one fact) ---------- */
.poster {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--day); color: var(--day-ink);
  display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(22px, 4.5vw, 64px);
  transition: background-color 450ms ease, color 450ms ease;
}
#today { min-height: min(72vh, 700px); }
.ghost {
  position: absolute; z-index: 0; right: -0.04em; bottom: -0.1em; pointer-events: none; user-select: none;
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 50;
  font-size: clamp(9rem, 30vw, 26rem); line-height: 0.8; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 2px var(--day-ink); opacity: 0.32;
  font-variant-numeric: tabular-nums;
}
.poster > .meta, .poster > .body { position: relative; z-index: 1; min-width: 0; }
.meta { display: flex; flex-direction: column; gap: 18px; font-family: var(--f-mono); font-size: 0.82rem; letter-spacing: 0.04em; }
.meta .label { display: block; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; opacity: 0.85; }
.meta .daynum {
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 70;
  font-size: clamp(3rem, 7vw, 5.5rem); line-height: 0.85; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.meta .month {
  font-family: var(--f-display); font-weight: 700; font-variation-settings: "wdth" 110;
  font-size: 1.25rem; line-height: 1; text-transform: uppercase; margin-top: 4px;
}
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-block; border: 1.5px solid currentColor; padding: 2px 8px;
  font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
}
.body { display: flex; flex-direction: column; gap: 26px; align-self: end; }
.poster h1, .poster h2 {
  margin: 0; font-family: var(--f-display); font-weight: 850; font-variation-settings: "wdth" 112;
  font-size: clamp(2.2rem, 6vw, 5.4rem); line-height: 0.94; letter-spacing: -0.035em;
  text-wrap: balance; hyphens: auto; overflow-wrap: break-word; max-width: 16ch;
}
.text { margin: 0; max-width: 58ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.55; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer;
  border: 2px solid currentColor; background: transparent; color: inherit; text-decoration: none;
  padding: 10px 18px; font-weight: 600;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.poster .btn.solid { background: var(--day-ink); color: var(--day); border-color: var(--day-ink); }
@media (hover: hover) and (pointer: fine) {
  .poster .btn:not(.solid):hover { background: var(--day-ink); color: var(--day); }
  .plain .btn:hover, .empty .btn:hover { background: var(--fg); color: var(--bg); }
}
.note { font-family: var(--f-mono); font-size: 0.8rem; text-underline-offset: 3px; }

/* load moment: flag stripes drop away from the poster */
.stripes { position: absolute; inset: 0; z-index: 3; display: flex; pointer-events: none; }
.stripes span { flex: 1; transform-origin: bottom; animation: drop 820ms var(--ease-in-out) forwards; }
@keyframes drop { to { transform: scaleY(0); } }

/* hidden until today's fact is filled in by script */
.poster.loading .body > *, .poster.loading .meta > *, .poster.loading .ghost { opacity: 0; }

/* ---------- Marquee ---------- */
.marquee { margin-block: 28px; overflow: hidden; border-block: 2px solid var(--line); padding-block: 10px; white-space: nowrap; }
.marquee-track { display: inline-flex; gap: 2.2rem; animation: slide 46s linear infinite; }
.marquee span {
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 130;
  font-size: clamp(1.4rem, 3vw, 2.2rem); text-transform: uppercase; letter-spacing: -0.01em;
}
.marquee span:nth-child(even) { color: transparent; -webkit-text-stroke: 1.5px var(--fg); font-style: italic; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Full story below the poster ---------- */
.story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(28px, 4vw, 48px);
}
.story-body { font-size: clamp(1.06rem, 1.3vw, 1.18rem); line-height: 1.72; max-width: 66ch; min-width: 0; }
.story-body p { margin: 0 0 1.1em; }
.story-body p:first-child::first-letter {
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 60;
  float: left; font-size: 3.8em; line-height: 0.8; margin: 0.05em 0.08em 0 0;
}
.story-side {
  display: flex; flex-direction: column; gap: 12px; align-self: start; min-width: 0;
  border-top: 2px solid var(--line); padding-top: 14px;
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px);
}
.story-side h2 { margin: 8px 0 0; font-family: var(--f-mono); font-size: 0.74rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.byline { margin: 0; font-family: var(--f-mono); font-size: 0.85rem; }
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sources a { font-family: var(--f-mono); font-size: 0.85rem; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* ---------- Previous / next ---------- */
.daynav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.daynav a {
  text-decoration: none; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-width: 0;
  border: 2px solid var(--line); background: var(--surface);
  transition: transform 200ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.daynav a small { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.daynav a span {
  font-family: var(--f-display); font-weight: 750; font-variation-settings: "wdth" 100; font-size: 1.1rem; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daynav .next { text-align: right; }
.daynav .mid a { background: var(--fg); color: var(--bg); justify-content: center; height: 100%; font-weight: 600; }
.daynav a:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .daynav .prev:hover, .daynav .next:hover { background: var(--fg); color: var(--bg); } .daynav a:hover small { color: inherit; } }

/* ---------- Section headings ---------- */
.sec { margin-top: clamp(48px, 7vw, 88px); }
.big {
  margin: 0 0 18px; font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 140;
  font-size: clamp(2.1rem, 6vw, 4.6rem); line-height: 0.9; letter-spacing: -0.035em; text-transform: uppercase; text-wrap: balance;
}
.big em { font-style: italic; color: transparent; -webkit-text-stroke: 2px var(--fg); padding-right: 0.06em; }
.lead { margin: 0 0 26px; color: var(--muted); max-width: 60ch; }

/* ---------- Year calendar (home hub) ---------- */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); gap: 16px; }
.month-card { border: 2px solid var(--line); background: var(--surface); padding: 14px; }
.month-card h3 {
  margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 120; font-size: 1.15rem; text-transform: uppercase;
}
.month-card h3 small { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); font-weight: 400; text-transform: none; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.days a, .days span {
  aspect-ratio: 1; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 0.8rem; font-variant-numeric: tabular-nums; text-decoration: none;
}
.days span { color: var(--muted); opacity: 0.45; }
.days a { background: var(--c, var(--day)); color: var(--ci, #fff); font-weight: 500; transition: transform 160ms var(--ease-out); }
.days a.today { outline: 3px solid var(--fg); outline-offset: 2px; position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .days a:hover { transform: scale(1.14); position: relative; z-index: 2; } }

/* ---------- Archive ---------- */
.controls { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 300px) auto; gap: 18px 24px; align-items: end; margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.field input, .field select { width: 100%; border: 2px solid var(--line); background: var(--surface); padding: 11px 14px; border-radius: 0; }
.field input::placeholder { color: var(--muted); }
.count { font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted); padding-bottom: 13px; white-space: nowrap; }
.month-group { margin-bottom: 36px; }
.month-group > h3 {
  margin: 0 0 12px; padding-block: 6px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; background: var(--bg);
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 130; font-size: 1.7rem; text-transform: uppercase; letter-spacing: -0.02em;
}
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.item {
  --c: #888; --ci: #fff;
  display: flex; flex-direction: column; gap: 12px; min-width: 0; text-decoration: none;
  border: 2px solid var(--line); background: var(--surface); padding: 18px 18px 20px;
  transition: transform 220ms var(--ease-out), background-color 220ms ease, color 220ms ease;
}
.item .row { display: flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); transition: color 220ms ease; }
.item .d {
  background: var(--c); color: var(--ci); min-width: 2.7rem; height: 2.7rem; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 850; font-variation-settings: "wdth" 80; font-size: 1.35rem; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.item h4 {
  margin: 0; font-family: var(--f-display); font-weight: 780; font-variation-settings: "wdth" 104;
  font-size: 1.38rem; line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; hyphens: auto;
}
.item p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 220ms ease; }
.item:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .item:hover { background: var(--c); color: var(--ci); transform: translateY(-3px); }
  .item:hover .row, .item:hover p { color: var(--ci); }
  .item:hover .d { background: var(--ci); color: var(--c); }
}
.empty { border: 2px dashed var(--line); padding: 40px 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.empty p { margin: 0; font-size: 1.15rem; }

/* ---------- Plain pages (language chooser, 404) ---------- */
.plain { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.plain h1 {
  margin: 0; font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 140;
  font-size: clamp(2.4rem, 8vw, 6rem); line-height: 0.9; text-transform: uppercase; letter-spacing: -0.035em;
}
.choices { display: flex; flex-wrap: wrap; gap: 10px; }

footer {
  margin-top: 64px; padding-top: 22px; border-top: 2px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted);
}

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  background: var(--fg); color: var(--bg); padding: 10px 16px; font-family: var(--f-mono); font-size: 0.85rem;
  transform: translate(-50%, 0); opacity: 1; transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out);
}
.toast[data-hidden] { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .logo img { height: 76px; margin: -13px -12px -16px -21px; }
  .poster { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  #today { min-height: 0; }
  .meta { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; }
  .meta .daynum { font-size: 3.4rem; }
  .ghost { font-size: 11rem; }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .count { padding-bottom: 0; }
  .story { grid-template-columns: minmax(0, 1fr); }
  .story-side { position: static; }
  .daynav { grid-template-columns: 1fr 1fr; }
  .daynav .mid { grid-column: 1 / -1; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stripes { display: none; }
  .marquee-track { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Impressum, Datenschutz, Footer-Links */
footer a { color: inherit; text-underline-offset: 3px; }
footer a[aria-current="page"] { text-decoration: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; }
.legal { max-width: 70ch; font-size: clamp(1rem, 1.2vw, 1.1rem); line-height: 1.7; }
.legal h2 { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.2; margin: 2em 0 0.5em; }
.legal p, .legal address { margin: 0 0 1em; font-style: normal; }
.legal a { color: inherit; text-underline-offset: 3px; overflow-wrap: anywhere; }
