/* kazkazi.de — blog styles on top of tokens.css (Tech Template design system).
   Rules from the system: ink on paper, one typeface, rectangles, 1px/2px ink borders,
   no soft shadows, color only for states, hover = border weight swap. */

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

html {
  background: var(--paper);
  color: var(--ink-90);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

a { color: var(--ink); text-decoration-thickness: var(--bw-hair); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: var(--bw-rule); }
a:focus-visible { outline: var(--bw-rule) solid var(--ink); outline-offset: var(--bw-rule); }

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding-left: var(--s-5);
  padding-right: var(--s-5);
}

/* Label: uppercase, wide tracking (eyebrows, table heads, footer) */
.label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-70);
}

/* ---------- Top bar ---------- */
.top { border-bottom: var(--border-rule); }
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 56px;
}

/* Wordmark: the system's bracket logo, drawn in CSS around live text */
.brand {
  position: relative;
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.brand::before, .brand::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--s-2);
  border: var(--bw-heavy) solid var(--ink);
}
.brand::before { left: 0; border-right: 0; }
.brand::after { right: 0; border-left: 0; }

.top nav { display: flex; gap: var(--s-4); }
.top nav a { font-size: var(--fs-small); }

/* ---------- Home ---------- */
.intro { padding-top: var(--s-8); padding-bottom: var(--s-6); }
.intro h1 {
  margin: var(--s-3) 0 0;
  font-size: clamp(var(--fs-h1), 9vw, var(--fs-display));
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}
.lede { margin: var(--s-4) 0 0; max-width: 640px; color: var(--ink-70); }

main { flex: 1; padding-bottom: var(--s-8); }

/* ---------- Post index: ruled table ---------- */
.posts { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.posts thead tr { border-top: var(--border-rule); border-bottom: var(--border-rule); }
.posts th { text-align: left; padding: var(--s-2) var(--s-3) var(--s-2) 0; }
.posts td { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: var(--bw-hair) solid var(--ink-15); vertical-align: baseline; }
.posts tbody tr:last-child td { border-bottom: var(--border-rule); }
.posts .date { white-space: nowrap; color: var(--ink-70); width: 1%; }
.posts .lang { width: 1%; text-align: right; padding-right: 0; }
.posts th.lang { padding-right: 0; }
.posts td a { font-size: var(--fs-body); font-weight: var(--fw-semibold); text-decoration: none; }
.posts td a:hover { text-decoration: underline; text-decoration-thickness: var(--bw-rule); }
.empty { padding: var(--s-4) 0; border-top: var(--border-rule); border-bottom: var(--border-rule); color: var(--ink-70); }

/* Chip (neutral) for the post language */
.chip {
  display: inline-block;
  padding: 1px var(--s-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: var(--border-default);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Document pages (posts, legal) ---------- */
.doc { padding-top: var(--s-7); }
.doc .crumb { font-size: var(--fs-small); color: var(--ink-70); letter-spacing: var(--tracking-wide); margin: 0 0 var(--s-3); }
.doc .crumb a { color: var(--ink-70); }
.doc h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  margin-top: var(--s-5);
  padding: var(--s-3) 0;
  border-top: var(--bw-hair) solid var(--ink-15);
  border-bottom: var(--bw-hair) solid var(--ink-15);
}
.meta-row div { display: flex; flex-direction: column; gap: 2px; }
.meta-row .v { font-size: var(--fs-small); }

.body { max-width: 72ch; margin-top: var(--s-6); }
.body > :first-child { margin-top: 0; }
.body p, .body ul, .body ol { margin: 0 0 var(--s-4); line-height: var(--lh-loose); }
.body li { margin-bottom: var(--s-1); }
.body h2 { margin: var(--s-7) 0 var(--s-3); font-size: 22px; font-weight: var(--fw-semibold); line-height: var(--lh-snug); color: var(--ink); }
.body h3 { margin: var(--s-5) 0 var(--s-2); font-size: 16px; font-weight: var(--fw-semibold); letter-spacing: 0.02em; color: var(--ink); }
.body hr { border: 0; border-top: var(--border-rule); margin: var(--s-6) 0; }
.body blockquote { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border-left: var(--bw-heavy) solid var(--ink); color: var(--ink-70); }
.body blockquote > :last-child { margin-bottom: 0; }
.body code { font-size: 0.92em; background: var(--ink-05); padding: 1px 6px; border: var(--border-muted); }
.body pre { margin: 0 0 var(--s-4); padding: var(--s-4); border: var(--border-default); overflow-x: auto; font-size: var(--fs-small); line-height: var(--lh-normal); }
.body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.body img { max-width: 100%; height: auto; border: var(--border-default); filter: grayscale(1); }
.body table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s-4); font-size: var(--fs-small); }
.body thead tr { border-top: var(--border-rule); border-bottom: var(--border-rule); }
.body th { text-align: left; padding: var(--s-2) var(--s-3); font-size: var(--fs-caption); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); color: var(--ink-70); }
.body td { padding: var(--s-2) var(--s-3); border-bottom: var(--bw-hair) solid var(--ink-15); }
.body tbody tr:last-child td { border-bottom: var(--border-rule); }
.body .note { color: var(--ink-70); font-size: var(--fs-small); }

.back { margin-top: var(--s-7); font-size: var(--fs-small); }

/* ---------- Footer ---------- */
.foot { border-top: var(--border-rule); padding: var(--s-4) 0 var(--s-6); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.foot a { color: var(--ink-70); }
.foot a:hover { color: var(--ink); }

@media (max-width: 560px) {
  .wrap { padding-left: var(--s-4); padding-right: var(--s-4); }
  .intro { padding-top: var(--s-7); }
  .posts .date { display: block; width: auto; padding-bottom: 0; border-bottom: 0; }
  .posts thead { display: none; }
  .posts tr { display: grid; grid-template-columns: 1fr auto; border-bottom: var(--bw-hair) solid var(--ink-15); }
  .posts tbody tr:first-child { border-top: var(--border-rule); }
  .posts tbody tr:last-child { border-bottom: var(--border-rule); }
  .posts td, .posts tbody tr:last-child td { border-bottom: 0; }
  .posts .date { grid-column: 1 / -1; padding-top: var(--s-3); }
  .posts td:not(.date) { padding-top: var(--s-1); }
}

/* ---------- Route map (shortcode routemap) ---------- */
.map { margin: 0 0 var(--s-5); }
.map-canvas { height: 440px; border: var(--border-default); background: var(--ink-05); }
.map-consent { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--s-3); padding: var(--s-5); max-width: 60ch; }
.map-consent p { margin: 0; font-size: var(--fs-small); line-height: var(--lh-normal); color: var(--ink-70); }
.map figcaption { margin-top: var(--s-2); font-size: var(--fs-small); color: var(--ink-70); }
.btn { font: inherit; font-size: var(--fs-small); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); padding: 7px 12px; border: var(--border-default); border-radius: var(--r-1); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-hard-sm); cursor: pointer; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: var(--shadow-none); }
.btn:focus-visible { outline: var(--bw-rule) solid var(--ink); outline-offset: var(--bw-rule); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.map .leaflet-container { font-family: var(--font-mono); font-size: var(--fs-caption); }
.map .leaflet-control-attribution { background: var(--paper); color: var(--ink-70); }
.map .leaflet-control-attribution a { color: var(--ink); }
.map .leaflet-bar a, .map .leaflet-bar { border-radius: 0; border-color: var(--ink); color: var(--ink); }
.map .leaflet-tooltip { font-family: var(--font-mono); border-radius: 0; border: var(--border-default); box-shadow: none; color: var(--ink); }
.map-pin { background: var(--paper); border: var(--bw-rule) solid var(--ink); }
.map-pin--night { background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-size: var(--fs-caption); font-weight: var(--fw-bold); }
@media (max-width: 560px) { .map-canvas { height: 360px; } }
/* Leaflet tiles and markers are <img>s inside .body: undo the article image rules. */
.body .map img { max-width: none; border: 0; filter: none; }
.map .leaflet-tile-pane { filter: grayscale(1) contrast(1.05); }
.map--day .map-canvas { height: 320px; }
