@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* ── Basis ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #000;
  background-size: cover;
  background-position: center;
  min-height: 100dvh;
  /* verhindert 300ms Tap-Verzögerung auf Mobile */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#slide-content {
  min-height: 100dvh;
}

/* ── Foto-Slide ─────────────────────────────────────────────────────────── */
.photo-slide {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-slide-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Content-Slide ──────────────────────────────────────────────────────── */
.content-slide {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 2rem;
  position: relative;
}

/* Buttons/Links auf Done-Screen über Nav-Zonen */
.done-content {
  position: relative;
  z-index: 60;
  text-align: center;
}

/* ── Navigations-Zonen ──────────────────────────────────────────────────── */
.nav-zone {
  position: fixed;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 200;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-left  { left: 0; }
.nav-right { right: 0; }

/* ── Typografie ─────────────────────────────────────────────────────────── */
.poem-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  letter-spacing: 0.01em;
  text-align: center;
}

.poem-author {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  text-align: center;
}

.strophe-label {
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.slide-label {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ── Gedichtzeilen ──────────────────────────────────────────────────────── */
.poem-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.slide-verse {
  text-align: left;
}

.poem-line {
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

/* ── Lücken-Lösung: grüne Hervorhebung ─────────────────────────────────── */
.gap-solution {
  color: #4ade80;
}

/* ── Lücken-Neutral: sichtbar, aber nicht hervorgehoben ─────────────────── */
.gap-neutral {
  color: inherit;
}

/* ── Zurück-Button ──────────────────────────────────────────────────────── */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 300;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 0;
}

.back-btn:hover {
  color: rgba(255,255,255,0.95);
}

/* ── Sekundär-Buttons (Fertig-Screen) ──────────────────────────────────── */
.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 2rem;
  color: white;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

/* ── Hell-Theme ─────────────────────────────────────────────────────────── */
body.theme-light {
  background-color: #ffff88;
  background-image: none !important;
}

body.theme-light .poem-title {
  color: #1a1a1a;
  text-shadow: none;
}

body.theme-light .poem-author {
  color: #333;
  text-shadow: none;
}

body.theme-light .strophe-label {
  color: #555;
}

body.theme-light .poem-line {
  color: #1a1a1a;
  text-shadow: none;
}

body.theme-light .gap-solution {
  color: #e8821a;
}

body.theme-light .back-btn {
  color: rgba(0,0,0,0.5);
}

body.theme-light .back-btn:hover {
  color: rgba(0,0,0,0.85);
}

body.theme-light .btn-secondary {
  color: #1a1a1a;
  border-color: rgba(0,0,0,0.3);
}

body.theme-light .btn-secondary:hover {
  background: rgba(0,0,0,0.08);
}

/* ── Lime-Theme (Gedicht 5) ─────────────────────────────────────────────── */
body.theme-lime {
  background-color: #8dc04e;
  background-image: none !important;
}
body.theme-lime .poem-title    { color: #1a1a1a; text-shadow: none; }
body.theme-lime .poem-author   { color: #333;    text-shadow: none; }
body.theme-lime .strophe-label { color: #444; }
body.theme-lime .poem-line     { color: #1a1a1a; text-shadow: none; }
body.theme-lime .gap-solution  { color: #ffffff; }
body.theme-lime .photo-slide      { background: #8dc04e; }
body.theme-lime .line-illus-text  { color: #1a1a1a; }
body.theme-lime .line-illus-plain { color: #1a1a1a; }
body.theme-lime .back-btn         { color: rgba(0,0,0,0.4); }
body.theme-lime .btn-secondary { color: #1a1a1a; border-color: rgba(0,0,0,0.3); }
body.theme-lime .btn-secondary:hover { background: rgba(0,0,0,0.08); }

/* ── Blue-Theme (Gedicht 3) ─────────────────────────────────────────────── */
body.theme-blue {
  background-color: #87CEEB;
  background-image: none !important;
}
body.theme-blue .poem-title    { color: #111;  text-shadow: none; }
body.theme-blue .poem-author   { color: #333;  text-shadow: none; }
body.theme-blue .strophe-label { color: #444; }
body.theme-blue .poem-line     { color: #111;  text-shadow: none; font-weight: 700; }
body.theme-blue .gap-solution  { color: #8800CC; }
body.theme-blue .back-btn      { color: rgba(0,0,0,0.4); }
body.theme-blue .btn-secondary { color: #111; border-color: rgba(0,0,0,0.3); }
body.theme-blue .btn-secondary:hover { background: rgba(0,0,0,0.08); }

/* ── Purple-Theme (Gedicht 4) ───────────────────────────────────────────── */
body.theme-purple {
  background-color: #CC88FF;
  background-image: none !important;
}
body.theme-purple .poem-title    { color: #111;  text-shadow: none; }
body.theme-purple .poem-author   { color: #333;  text-shadow: none; }
body.theme-purple .strophe-label { color: #444; }
body.theme-purple .poem-line     { color: #111;  text-shadow: none; font-weight: 700; }
body.theme-purple .gap-solution  { color: #ffffff; }
body.theme-purple .back-btn      { color: rgba(0,0,0,0.4); }
body.theme-purple .btn-secondary { color: #111; border-color: rgba(0,0,0,0.3); }
body.theme-purple .btn-secondary:hover { background: rgba(0,0,0,0.08); }

/* ── Cyan-Theme (Gedicht 6) ─────────────────────────────────────────────── */
body.theme-cyan {
  background-color: #66CCFF;
  background-image: none !important;
}
body.theme-cyan .poem-title    { color: #111;  text-shadow: none; }
body.theme-cyan .poem-author   { color: #333;  text-shadow: none; }
body.theme-cyan .strophe-label { color: #333; }
body.theme-cyan .poem-line     { color: #111;  text-shadow: none; font-weight: 700; }
body.theme-cyan .gap-solution  { color: #0066CC; }
body.theme-cyan .back-btn      { color: rgba(0,0,0,0.4); }
body.theme-cyan .btn-secondary { color: #111; border-color: rgba(0,0,0,0.3); }
body.theme-cyan .btn-secondary:hover { background: rgba(0,0,0,0.08); }
body.theme-cyan .photo-line-slide .strophe-label { color: rgba(255,255,255,0.7); }

/* ── Foto-Zeile-Slide ───────────────────────────────────────────────────── */
.photo-line-slide {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.photo-line-slide .strophe-label {
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 1;
}
.photo-line-card {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-line-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.photo-line-caption {
  flex: 0 0 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: #1a1a1a;
  text-align: center;
}
body.theme-cyan .photo-line-caption     { color: rgba(255,255,255,0.7); }
body.theme-dark-red .photo-line-caption { color: rgba(255,255,255,0.7); }

/* ── Zeilen-Illustrationen (Gedicht 11 Strophe 3) ──────────────────────── */
.line-illus-slide {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vh, 2rem);
  width: 100%;
  align-items: center;
}
.line-illus-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  font-weight: 700;
  color: #fff;
}
.line-illus-img {
  height: clamp(4rem, 12vh, 7rem);
  width: auto;
  object-fit: contain;
}
.line-illus-text {
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  font-weight: 700;
  color: #fff;
}
.line-illus-plain {
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* ── Zusammenfassung / Recap (Gedicht 11 Ende) ──────────────────────────── */
.recap-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.recap-photo {
  width: clamp(8rem, 28vw, 14rem);
  height: auto;
  border-radius: 1rem;
  object-fit: cover;
}

/* ── Scatter-Slides ─────────────────────────────────────────────────────── */
.scatter-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.scatter-word {
  position: absolute;
  line-height: 1.2;
  white-space: pre-line;
}

/* ── Dark-Red-Theme (Gedicht 7) ────────────────────────────────────────── */
body.theme-dark-red {
  background-color: #8B1A1A;
  background-image: none !important;
}
body.theme-dark-red .poem-title    { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
body.theme-dark-red .poem-author   { color: rgba(255,255,255,0.85); text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
body.theme-dark-red .strophe-label { color: rgba(255,255,255,0.7); }
body.theme-dark-red .poem-line     { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
body.theme-dark-red .gap-solution  { color: #FF69B4; }
body.theme-dark-red .back-btn      { color: rgba(255,255,255,0.55); }
body.theme-dark-red .btn-secondary { color: #fff; border-color: rgba(255,255,255,0.4); }
body.theme-dark-red .btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* ── Audio-Player ───────────────────────────────────────────────────────── */
.audio-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  z-index: 300;
}
.audio-bar audio {
  width: 100%;
  max-width: 400px;
  height: 2rem;
}

/* ── HTMX-Übergang ──────────────────────────────────────────────────────── */
#slide-content.htmx-swapping {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#slide-content {
  transition: opacity 0.2s ease-in;
}
