/* ============================================================================
   Tappr Base Stylesheet
   Reset + Body-Defaults. Immer NACH tokens.css + fonts.css einbinden.
   ========================================================================= */

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

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

html,
body {
  height: 100%;
}

/* HTML-hidden-Attribut muss alle Layout-Regeln (display:flex/grid/...)
 * überstimmen — sonst bleiben Modals und Overlays sichtbar, obwohl
 * hidden=true gesetzt ist. Single Source of Truth für alle Apps die
 * base.css laden (Backoffice, Admin, Onboarding, Kitchen, Display). */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

/* SVG: bewusst NICHT im display:block / max-width:100%-Reset.
 *
 * Grund: pauschales display:block + max-width:100% lässt SVG-Icons in
 * Flex-Containern auf computed width:0px kollabieren, wenn das SVG kein
 * explizites width-HTML-Attribut hat. Wir hatten dadurch mehrfach
 * "unsichtbares Icon, klickbarer leerer Button"-Bugs (Theme-Toggle, Bell,
 * Topbar-Icons). Stattdessen:
 *
 *   - SVGs sind inline (browser-default), vertikal mittig im Text-Flow,
 *     und schrumpfen NICHT im Flex.
 *   - Width/Height kommen entweder per Attribut (icons.js setzt
 *     width="size" height="size") oder per spezifischer Klassen-Regel.
 *   - Default-Sizing für button-children und .icon weiter unten.
 *
 * Siehe CLAUDE.md "SVG-Icons in Flex-Containern" für Details. */
svg {
  flex-shrink: 0;
  vertical-align: middle;
}

/* Default 16x16 für SVG-Icons in Buttons + explizite .icon-Klasse.
 * Spezifischere Regeln (.notif-close svg, .qr-placeholder svg, etc.)
 * überschreiben das jederzeit per Spezifität. */
button > svg,
.icon {
  width: 16px;
  height: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

/* Tabular numbers standardmässig für Mono-Schrift */
code,
kbd,
samp,
.mono,
[data-font="mono"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Focus-Styles — global sichtbar für Keyboard-Navigation (§14) */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

/* Skip-Link: erst sichtbar bei Fokus */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--bg-2);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  z-index: var(--z-max);
  transition: top var(--dur-micro) var(--ease-smooth);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Text-Hilfsklassen */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--mute);
}

.mute    { color: var(--mute); }
.mute-2  { color: var(--mute-2); }
.ink-2   { color: var(--ink-2); }
.coral   { color: var(--coral); }

.tabular { font-variant-numeric: tabular-nums; }
.mono    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
