/*
 * Tripalike – gemeinsame Tokens & Basis-Stile (Admin + Frontend).
 * Das Frontend legt darüber die Tafel-Welt (assets/css/site.css); der Admin bleibt hell und ruhig.
 * Schriften: Geist + Geist Mono (SIL OFL), lokal ausgeliefert – siehe assets/fonts/README.md.
 */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --tm-canvas: #F7F6F2;
  --tm-card: #FFFFFF;
  --tm-border: #E5E2D9;
  --tm-border-strong: #D3CFC3;
  --tm-text: #141413;
  --tm-text-2: #68655E;
  --tm-primary: #0F4C5C;
  --tm-primary-hover: #0A3642;
  --tm-primary-tint: #E6EEEF;
  --tm-cta: #C85A32;
  --tm-cta-hover: #A94826;
  --tm-success: #2E6B4F;
  --tm-success-tint: #E8F0EA;
  --tm-danger: #A33A2A;
  --tm-danger-tint: #F6E7E3;
  --tm-warning: #8A5A12;
  --tm-warning-tint: #F5EDDD;

  /* Display und Text: Geist; Daten, Zahlen, Fallblätter: Geist Mono */
  --tm-font-serif: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tm-font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tm-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --tm-radius: 0.75rem;   /* rounded-xl */
  --tm-radius-sm: 0.5rem;
  --tm-focus: 0 0 0 3px rgba(15, 76, 92, 0.22);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--tm-canvas);
  color: var(--tm-text);
  font-family: var(--tm-font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, .tm-serif {
  font-family: var(--tm-font-serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-optical-sizing: auto;
}
h3, h4 { font-weight: 600; line-height: 1.3; }

a { color: var(--tm-primary); text-underline-offset: 3px; }
a:hover { color: var(--tm-primary-hover); }

/* Zahlen, Temperaturen, Zeiten, Match-Prozente */
.tm-mono, code, kbd {
  font-family: var(--tm-font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 0;
}

.tm-muted { color: var(--tm-text-2); }

.tm-card {
  background: var(--tm-card);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
}

/* ---------- Formulare ---------- */
.tm-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}
.tm-hint { font-size: 0.8125rem; color: var(--tm-text-2); margin: 0.375rem 0 0; }

.tm-input {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--tm-text);
  background: var(--tm-card);
  border: 1px solid var(--tm-border-strong);
  border-radius: var(--tm-radius-sm);
  padding: 0.625rem 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.tm-input:focus { outline: none; border-color: var(--tm-primary); box-shadow: var(--tm-focus); }
.tm-input.tm-mono { font-size: 0.875rem; }

.tm-checkbox { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.9375rem; cursor: pointer; }
.tm-checkbox input { margin-top: 0.3rem; accent-color: var(--tm-primary); width: 1rem; height: 1rem; }

/* ---------- Buttons ---------- */
.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.8125rem 1.25rem;
  border-radius: var(--tm-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.tm-btn:focus-visible { outline: none; box-shadow: var(--tm-focus); }
.tm-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.tm-btn-primary { background: var(--tm-primary); color: #fff; }
.tm-btn-primary:hover:not([disabled]) { background: var(--tm-primary-hover); color: #fff; }

.tm-btn-cta { background: var(--tm-cta); color: #fff; }
.tm-btn-cta:hover:not([disabled]) { background: var(--tm-cta-hover); color: #fff; }

.tm-btn-ghost { background: transparent; color: var(--tm-text); border-color: var(--tm-border-strong); }
.tm-btn-ghost:hover:not([disabled]) { background: var(--tm-card); color: var(--tm-text); border-color: var(--tm-text-2); }

/* ---------- Hinweise ---------- */
.tm-alert {
  border: 1px solid;
  border-radius: var(--tm-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}
.tm-alert-error { background: var(--tm-danger-tint); border-color: #E7C5BD; color: var(--tm-danger); }
.tm-alert-success { background: var(--tm-success-tint); border-color: #C9DCCD; color: var(--tm-success); }
.tm-alert-warning { background: var(--tm-warning-tint); border-color: #E6D5B3; color: var(--tm-warning); }

.tm-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
