/* ==========================================================================
   player-base.css
   Basisthema (Variables + Layout). Themes überschreiben nur Variablen.
   ========================================================================== */

/* -- Fonts (lokal) ------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-v20-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-v20-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}

/* -- Design Tokens (Default-Werte; per Theme überschreibbar) ------------- */
:root{
  /* Hauptfarben / Look */
  --bg: #0b0d10;
  --text: #cfd6df;

  /* Player-Optik */
  --player-radius: 4px;
  --player-shadow: 0 6px 30px rgba(0,0,0,.35);
  --player-bg: #11141a;

  /* Layout-Parameter */
  --maxw: 1300px;
  --pad-x: clamp(12px, 4vw, 48px);
  --pad-y: clamp(60px, 10vh, 120px);

  /* Typografie */
  --h1-size: clamp(18px, 3.5vw, 30px);
  --h1-gap:  clamp(18px, 3vw, 26px);

  /* Mindesthöhe Player */
  --player-min-h: 220px;

  /* Verfügbare Fläche */
  --avail-h: calc(
    100svh
    - (var(--pad-y) * 2)
    - var(--h1-size)
    - var(--h1-gap)
  );

  /* Breite aus Constraints */
  --by-width-w: min(
    calc(100vw - (2 * var(--pad-x))),
    var(--maxw)
  );

  --by-height-w: calc(var(--avail-h) * 1.7777777778);

  /* Mindestbreite, aber niemals größer als die verfügbare Breite */
  --min-w-safe: min(
    calc(var(--player-min-h) * 1.7777777778),
    var(--by-width-w)
  );

  /* Finale Breite */
  --final-w: max(
    var(--min-w-safe),
    min(var(--by-width-w), var(--by-height-w))
  );

  /* Finale Höhe */
  --player-h: calc(var(--final-w) * 0.5625);
}

/* -- Base / Reset -------------------------------------------------------- */
*{ box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -- Layout-Container ---------------------------------------------------- */
.page {min-height: 100svh;padding: calc(var(--pad-y)*.9) var(--pad-x) calc(var(--pad-y)*1.1) var(--pad-x);}

/* Titel und Player teilen dieselbe dynamische Breite */
.inner{
  width: var(--final-w);
  margin: 0 auto;
}

/* -- Header / Überschrift ------------------------------------------------ */
header { margin: 0 0 var(--h1-gap) 0; }

h1{
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  font-size: var(--h1-size);
  letter-spacing: -0.01em;
}

/* iOS: ggf. automatisch erzeugte tel:-Links in H1 neutralisieren */
h1 a[href^="tel:"]{
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
  cursor: default;
}

/* -- Player-Wrapper ------------------------------------------------------ */
.player{
  position: relative;
  width: 100%;
  height: var(--player-h);
  aspect-ratio: 16 / 9;

  background: var(--player-bg);
  border-radius: var(--player-radius);
  overflow: hidden;
  box-shadow: var(--player-shadow);
}

.player > iframe,
.player > video,
.player > embed,
.player > object{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* -- Responsive Feinschliff --------------------------------------------- */
@media (max-width: 640px){
  .player{ border-radius: var(--player-radius); } /* ggf. gleiche Rundung */
}

/* ==========================================================================
   Error-Seiten (404 etc.)
   ========================================================================== */

body.error main{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100svw;
  height: 100svh;
  flex-direction: column;
  padding: var(--pad-y) var(--pad-x);
}

body.error h1{
  font-size: clamp(20px, 5vw, 32px);
  margin: 0 0 12px 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: unset;    /* H1 nicht kürzen */
  overflow: unset;
  text-overflow: unset;
}

body.error p{
  font-size: clamp(15px, 3vw, 18px);
  font-weight: 600;
  opacity: .85;
  margin: 0;
  max-width: 60ch;
}
