/* ============================================================
   muveup Facelift: Basis
   Roboto (variabel, woff2, latin + latin-ext), Reset, Typografie, Fokus, reduzierte Bewegung.
   Braucht css/tokens.css davor. Vorladen im Seitenkopf:
   <link rel="preload" href="/fonts/roboto/roboto-latin-wght-normal.woff2" as="font" type="font/woff2" crossorigin>
   ============================================================ */

/* Ersatzschrift mit den Maßen von Roboto: der Wechsel zur Webschrift verschiebt keine Zeile */
@font-face {
  font-family: 'Roboto Fallback';
  src: local('Arial'), local('Helvetica');
  size-adjust: 99.7%;
  ascent-override: 92.4%;
  descent-override: 24.3%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto/roboto-latin-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/roboto/roboto-latin-wght-normal.woff2') format('woff2');
  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: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto/roboto-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/roboto/roboto-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto/roboto-latin-wght-italic.woff2') format('woff2-variations'),
       url('../fonts/roboto/roboto-latin-wght-italic.woff2') format('woff2');
  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: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto/roboto-latin-ext-wght-italic.woff2') format('woff2-variations'),
       url('../fonts/roboto/roboto-latin-ext-wght-italic.woff2') format('woff2');
  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;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

img {
  height: auto;
}

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

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

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: from-font;
  text-underline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Alt-Klasse aus Bestands-Skripten (Medien-Slider, Profile, Listen) */
.hidden,
.is-start-hidden {
  display: none !important;
}

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
  color: var(--color-text);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); }

/* Betonungsmuster: ein Schlüsselwort kursiv, gleicher Schnitt */
em {
  font-style: italic;
  font-weight: inherit;
}

strong, b {
  font-weight: var(--fw-semibold);
}

.mu-display {
  font-size: var(--fs-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-base);
  color: var(--color-primary);
}

.mu-hero {
  font-size: var(--fs-hero);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
}

.mu-h1 { font-size: var(--fs-h1); font-weight: var(--fw-medium); line-height: var(--lh-tight); }
.mu-h2 { font-size: var(--fs-h2); font-weight: var(--fw-medium); line-height: var(--lh-tight); }
.mu-h3 { font-size: var(--fs-h3); font-weight: var(--fw-medium); line-height: var(--lh-tight); }
.mu-h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); line-height: var(--lh-base); }
.mu-text-lg { font-size: var(--fs-body-lg); }
.mu-text { font-size: var(--fs-body); }
.mu-text-sm { font-size: var(--fs-small); }
.mu-text-xs { font-size: var(--fs-micro); }
.mu-text-muted { color: var(--color-text-muted); }
.mu-text-subtle { color: var(--color-text-subtle); }
.mu-text-primary { color: var(--color-primary); }
.mu-text-accent { color: var(--color-accent-text); }
.mu-text-danger { color: var(--color-danger-text); }
.mu-text-success { color: var(--color-success-text); }
.mu-text-italic { font-style: italic; }
.mu-text-medium { font-weight: var(--fw-medium); }
.mu-text-strong { font-weight: var(--fw-semibold); }
.mu-text-center { text-align: center; }

::placeholder {
  color: var(--color-text-placeholder);
  opacity: 1;
}

::selection {
  background: var(--c-purple-20);
}

/* ---------- Fokus ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-xs);
}

/* ---------- Hilfsklassen ---------- */
.mu-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mu-stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.mu-stack > .mu-btn { align-self: flex-start; }
.mu-stack--sm { gap: var(--sp-2); }
.mu-stack--lg { gap: var(--sp-5); }
.mu-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.mu-row--between { justify-content: space-between; }
.mu-row--end { justify-content: flex-end; }
/* Eingabe mit Knopf in einer Zeile (Link übernehmen) */
.mu-row--input { flex-wrap: nowrap; }
.mu-row--input > .mu-input { flex: 1 1 auto; min-width: 0; }
/* Felder nebeneinander, schmal untereinander (Datum und Gage) */
.mu-row--fields { align-items: flex-start; gap: var(--sp-3); }
.mu-row--fields > .mu-field { flex: 1 1 160px; }
.mu-grow { flex: 1 1 auto; min-width: 0; }
.mu-divider { height: 0; border: 0; border-top: var(--bw) solid var(--color-border); margin: var(--sp-4) 0; }
/* Zwischentitel innerhalb eines Abschnitts: trennt Themen ruhig, ohne weiteren Reiter */
.mu-subhead { color: var(--color-primary); font-size: var(--fs-h4); font-weight: var(--fw-semibold); line-height: var(--lh-base); }
.mu-subhead:not(:first-child) { padding-top: var(--sp-5); border-top: var(--bw) solid var(--color-border); }

html.mu-scroll-locked,
html.mu-scroll-locked body {
  overflow: hidden;
}

html.mu-scroll-locked.mu-scroll-gutter {
  scrollbar-gutter: stable;
}

/* ---------- Mobile: kein Zoom in Eingaben ---------- */
@media (max-width: 900px) {
  input, select, textarea {
    font-size: var(--fs-input-mobile);
  }

  /* F21c: Ein fokussiertes Feld landet nicht unter der festen Kopfzeile oder Fußleiste */
  html {
    scroll-padding-top: calc(var(--topbar-h-mobile) + var(--safe-top) + var(--sp-3));
    scroll-padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--sp-3));
  }
}

/* ---------- Sprache: deutsche Texte im HTML blitzen auf Englisch nicht auf (js/i18n.js) ---------- */
html.mu-i18n-pending [data-i18n] {
  visibility: hidden;
}

/* ---------- Scrollbars: schmal und einheitlich (F24c) ----------
   Chrome und Safari über ::-webkit-scrollbar. scrollbar-width nur dort, wo es das nicht gibt (Firefox),
   sonst schaltet Chrome die Gestaltung ab. Wer keine Leiste zeigen will, setzt weiter scrollbar-width: none.
   Farbe je Umgebung über --scrollbar-rgb: Lila als Grundwert und beim Team, Orange bei Veranstaltenden, Musikschaffenden und Community.
   Panels folgen ihrem Rahmen (css/layout.css). */
:root:has(> body:is([data-app-role="organizer"], [data-app-role="artist"], [data-app-role="community-member"])) {
  --scrollbar-rgb: var(--c-orange-rgb);
}

::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  background: rgb(var(--scrollbar-rgb) / var(--scrollbar-alpha));
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--scrollbar-rgb) / var(--scrollbar-alpha-hover));
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgb(var(--scrollbar-rgb) / var(--scrollbar-alpha)) transparent;
  }
}

/* ---------- Installierte App (F21c) ----------
   Nur im Vollbild der installierten App, der Browser-Tab bleibt wie gewohnt.
   Kein Gummiband am Seitenrand: Aktualisieren läuft über js/pull-to-refresh.js.
   Bedienelemente lassen sich nicht markieren und zeigen beim langen Drücken keine Link-Vorschau,
   Texte, Namen und Adressen bleiben markierbar. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html,
  body {
    overscroll-behavior-y: none;
  }

  .mu-topbar,
  .mu-sidebar,
  .mu-bottom-nav,
  .mu-main-card__tab,
  .mu-segment,
  .mu-tabs,
  .mu-chip,
  .mu-tile,
  .mu-fab,
  .mu-card__more,
  .mu-stepper,
  .mu-switch,
  .mu-menu,
  .mu-panel__head,
  .mu-dialog__actions {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

/* ---------- Reduzierte Bewegung: nur Opacity ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color !important;
    transition-duration: var(--dur-fast) !important;
    scroll-behavior: auto !important;
  }
}
