/*
 * Layout fuer Samsung QM49R / Chromium M56.
 *
 * Bewusst NICHT verwendet (in Chromium 56 nicht vorhanden):
 *   display:grid, gap, clamp()/min()/max(), aspect-ratio, :is(), :has(),
 *   inset, position:sticky, CSS-Nesting, Container Queries.
 * Verwendet werden ausschliesslich Flexbox, Custom Properties und Margins.
 *
 * Alle Groessen in vw/vh: 1920x1080 und 3840x2160 sehen identisch aus.
 */

/* ------------------------------------------------------------------ *
 * Zentrale Stellschrauben - hier das Farbschema an die eigene CI anpassen
 * ------------------------------------------------------------------ */
:root {
  /* Farben (neutral vorbelegt) */
  --color-bg:          #0e1316;
  --color-bg-soft:     #161d22;
  --color-text:        #f2f5f7;
  --color-text-muted:  #9fb0ba;
  --color-accent:      #2e7d9a;
  --color-accent-text: #ffffff;
  --color-price:       #ffffff;
  --color-strike:      #8a9aa4;
  --color-line:        rgba(242, 245, 247, 0.14);

  /* Schrift */
  --font-stack: "Samsung One", "Segoe UI", Tahoma, "DejaVu Sans", Arial, Helvetica, sans-serif;
  --fs-badge:    1.5vw;
  --fs-headline: 4.6vw;
  --fs-tariff:   2.3vw;
  --fs-bullet:   1.9vw;
  --fs-price:    13vw;
  --fs-currency: 5vw;
  --fs-period:   1.7vw;
  --fs-strike:   2.8vw;
  --fs-caption:  2.4vw;
  --fs-fine:     1.05vw;

  /* Abstaende (kein gap - alles ueber margin) */
  --pad-x: 5vw;
  --pad-y: 6vh;
  --space-s: 1.2vh;
  --space-m: 2.4vh;
  --space-l: 4vh;

  /* Ueberblendung, wird von app.js aus offers.json ueberschrieben */
  --transition-ms: 600ms;

  /* Fortschrittsbalken */
  --progress-height: 0.5vh;
}

/* Eigene Schrift statt Systemschrift? WOFF nach assets/fonts/ legen,
   den Block einkommentieren und --font-stack oben anpassen.
@font-face {
  font-family: "Eigene Schrift";
  src: url("fonts/eigene-schrift.woff") format("woff");
  font-weight: 400;
  font-style: normal;
}
*/

/* ------------------------------------------------------------------ *
 * Grundlagen
 * ------------------------------------------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
}

body {
  color: var(--color-text);
  font-family: var(--font-stack);
  font-size: 2vw;
  line-height: 1.25;
  cursor: none; /* URL Launcher zeigt keinen Cursor - hier zur Sicherheit aus */
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  border: 0;
}

/* ------------------------------------------------------------------ *
 * Buehne und Ueberblendung
 * ------------------------------------------------------------------ */

/* stage wird per JS alle paar Minuten minimal verschoben (Einbrennschutz) */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: translate(0, 0);
  transition: transform 6s ease-in-out;
}

.layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  transition: opacity var(--transition-ms) ease-in-out;
  will-change: opacity;
}

.layer.is-visible {
  opacity: 1;
}

.slide {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad-y) var(--pad-x);
  background-color: var(--color-bg);
  background-image: linear-gradient(150deg, var(--color-bg-soft) 0%, var(--color-bg) 62%);
}

/* ------------------------------------------------------------------ *
 * Angebots-Slide
 * ------------------------------------------------------------------ */
.offer {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.offer__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 56%;
  min-width: 0;
  padding-right: 3vw;
}

.offer__side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  flex: 0 0 40%;
  min-width: 0;
  text-align: right;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: var(--space-m);
  padding: 0.9vh 1.6vw;
  border: 0.2vh solid var(--color-accent);
  border-radius: 0.6vh;
  background-color: rgba(46, 125, 154, 0.18);
  color: var(--color-text);
  font-size: var(--fs-badge);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.offer__headline {
  font-size: var(--fs-headline);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.offer__tariff {
  margin-top: var(--space-s);
  color: var(--color-accent);
  font-size: var(--fs-tariff);
  font-weight: 600;
}

.bullets {
  margin-top: var(--space-l);
  list-style: none;
}

.bullets__item {
  position: relative;
  margin-bottom: var(--space-m);
  padding-left: 2.6vw;
  color: var(--color-text);
  font-size: var(--fs-bullet);
  font-weight: 500;
}

.bullets__item:last-child {
  margin-bottom: 0;
}

/* Aufzaehlungszeichen als CSS-Form, damit kein Bild geladen werden muss */
.bullets__item:before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 1.1vw;
  height: 0.28vh;
  background-color: var(--color-accent);
}

/* ------------------------------------------------------------------ *
 * Preis
 * ------------------------------------------------------------------ */
.price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price__strike {
  margin-bottom: 0.4vh;
  color: var(--color-strike);
  font-size: var(--fs-strike);
  font-weight: 600;
}

.price__strike-text {
  position: relative;
  text-decoration: line-through;
  text-decoration-color: var(--color-strike);
}

.price__main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  color: var(--color-price);
  line-height: 0.88;
}

.price__amount {
  font-size: var(--fs-price);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.price__currency {
  margin-top: 1.2vh;
  margin-left: 0.6vw;
  font-size: var(--fs-currency);
  font-weight: 700;
}

.price__period {
  margin-top: var(--space-s);
  color: var(--color-text-muted);
  font-size: var(--fs-period);
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Bild im Angebots-Slide
 * ------------------------------------------------------------------ */
.offer__media {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 34vh;
  margin-bottom: var(--space-m);
  overflow: hidden;
}

.offer__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ------------------------------------------------------------------ *
 * Bild-Slide
 * ------------------------------------------------------------------ */
.slide--image {
  padding: 0;
  justify-content: flex-end;
}

.full-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-image--contain {
  object-fit: contain;
}

.caption {
  position: relative;
  width: 100%;
  /* unten extra Luft, damit der Fortschrittsbalken nicht im Text liegt */
  padding: var(--space-m) var(--pad-x) 4.5vh;
  background-color: rgba(14, 19, 22, 0.78);
  font-size: var(--fs-caption);
  font-weight: 700;
}

/* ------------------------------------------------------------------ *
 * Text-Slide und Standby
 * ------------------------------------------------------------------ */
.slide--text {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
}

.text-block__headline {
  font-size: var(--fs-headline);
  font-weight: 800;
  line-height: 1.06;
}

.text-block__subline {
  margin-top: var(--space-m);
  color: var(--color-text-muted);
  font-size: var(--fs-tariff);
  font-weight: 500;
}

/* ------------------------------------------------------------------ *
 * Kleingedrucktes
 * ------------------------------------------------------------------ */
.fine-print {
  flex: 0 0 auto;
  margin-top: var(--space-m);
  padding-top: var(--space-s);
  border-top: 0.1vh solid var(--color-line);
  color: var(--color-text-muted);
  font-size: var(--fs-fine);
  font-weight: 400;
  line-height: 1.35;
}

.slide--text .fine-print {
  border-top: 0;
  text-align: center;
}

/* ------------------------------------------------------------------ *
 * Fortschrittsbalken
 * ------------------------------------------------------------------ */
.progress {
  position: absolute;
  right: var(--pad-x);
  bottom: 1.6vh;
  left: var(--pad-x);
  height: var(--progress-height);
  background-color: rgba(242, 245, 247, 0.08);
  border-radius: var(--progress-height);
  overflow: hidden;
}

.progress__bar {
  width: 100%;
  height: 100%;
  background-color: var(--color-accent);
  opacity: 0.75;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.progress[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ *
 * Debug-Overlay (?debug=1)
 * ------------------------------------------------------------------ */
.debug {
  position: absolute;
  top: 1.5vh;
  left: 1.5vw;
  z-index: 10;
  padding: 1.2vh 1.4vw;
  background-color: rgba(0, 0, 0, 0.72);
  border: 0.1vh solid var(--color-line);
  border-radius: 0.6vh;
  color: #b6ffcc;
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 1vw;
  line-height: 1.5;
  white-space: pre;
}

.debug[hidden] {
  display: none;
}
