/* ============================
   Grundlayout & Typografie
   ============================ */

html, body {
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
  border: none;
}

body, p, a {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: black;
  text-decoration: none;
}

p {
  font-size: 12px;
  line-height: 18px;
  margin: 0 0 1rem;
  text-decoration: none;
}

/* ============================
   Navigation (fixiert)
   ============================ */

#Navigation00 {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  text-align: right;
  line-height: 50px;
  margin-right: 5px;
  text-decoration: none;
}

#Navigation01 {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  text-align: right;
  line-height: 50px;
  margin-right: 5px;
  text-decoration: none;
}

#Navigation01 iframe {
  display: block;
  border: 0;
  height: 50px; /* Breite dynamisch per Script */
  text-decoration: none;
}

/* ============================
   Inhaltsbereich
   ============================ */

/* Unter fixierten Nav-Leisten; zentriert und overflow-sicher */
#Bilder {
  position: relative;
  width: min(1200px, 100vw - 2rem);
  margin: 100px auto 0 auto; /* Platz unter Navigation, zentriert */
  padding: 0 1rem;
  overflow-x: hidden; /* Sicherheitsleine gegen horizontalen Overflow */
  text-decoration: none;
}

/* Links NUR im Content-Bereich (#Bilder) */
#Bilder a:link    { color: black;   text-decoration: none; }
#Bilder a:visited { color: #484848; text-decoration: none; }
#Bilder a:hover   { color: white;   text-decoration: none; }
#Bilder a:active  { color: #f00000; text-decoration: none; }

/* Link-Block (Textspalte) */
#Bilder .link-block {
  margin-left: clamp(1rem, 4vw, 5em);
  margin-right: clamp(1rem, 4vw, 5em);
  text-align: right;
  line-height: 1.2;
  text-decoration: none;
}

#Bilder .link-block p {
  margin: 0 0 0.6rem;
  text-decoration: none;
}

#Bilder .link-block a {
  display: inline;
  margin: 0;
  text-decoration: none;
}

#Bilder .link-block a + a {
  margin-left: .2rem;
  text-decoration: none;
}

/* Einleitungszeile im Link-Block (Kommentartext) */
#Bilder .link-intro {
  margin-bottom: 1rem;
  line-height: 18px;
  text-align: right;
  color: black;
  text-decoration: none;
}

/* Absätze direkt unter #Bilder (z.B. Kontakt, Top-Link) */
#Bilder > p {
  text-align: justify;
  margin-left: clamp(1rem, 4vw, 5em);
  margin-right: clamp(1rem, 4vw, 5em);
  color: white !important;
  text-decoration: none;
}

/* Großer Abstand vor dem Footer */
.spacer-lg {
  display: block;
  width: 100%;
  height: 18rem;
  clear: both;
  flex: 0 0 auto;
}

/* Footer-iframe */
.impressum-frame {
  display: block;
  margin-top: 2rem;
  border: 0;
  width: 100%;
}

/* ============================
   Hover-Thumb Overlay (Preview)
   ============================ */

.hover-thumb {
  position: fixed;
  z-index: 2147483000;
  height: 150px;
  width: auto;
  max-width: 70vw;
  object-fit: cover;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 5s linear, transform 5s ease-in;
  pointer-events: auto; /* wie zuvor, falls benötigt */
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  border-radius: 4px;
}
.hover-thumb.animate {
  opacity: 0;
  transform: translateY(20px);
}


/* ============================
   Media Caption (Overlay-Text)
   ============================ */

.media-caption {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: 8px 16%;  /* % für responsiven Abstand */
  color: #fff;
  font: 600 14px/1.4 "Trebuchet MS", Arial, sans-serif;
  text-decoration: none;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.35), rgba(0,0,0,0));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: opacity;
}

.media-caption a {
  color: inherit;
  pointer-events: auto;
}

.media-caption--show { opacity: 1; }
.media-caption--fade { opacity: 0; }

/* Kleiner weißer Info-Button im Media-Wrapper */
.media-info-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;

  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font: 700 16px/28px "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;

  opacity: 0.6;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
}

.media-info-btn:hover {
  opacity: 1.0;
  transform: translateX(-50%) scale(1.08);
}

.media-info-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================
   Video-Container (responsiv)
   ============================ */

#videoContainer {
  width: 100%;
  margin: 10px 0;
  text-align: center;
}

#videoPlayer {
  width: 100%;
  height: auto;
  max-height: 70vh;     /* bleibt im sichtbaren Bereich */
  object-fit: contain;
}

/* ============================
   Thumbnails bar (thumb-show.js)
   ============================ */

/* Container */
#thumbnails-container {
  width: min(1100px, 100vw - 2rem);
  margin: 0.5rem auto 1rem auto;
  padding: 0.25rem;
  background: transparent;
  opacity: 1;
  transition: opacity 0.8s ease;
}

/* Wrapende Reihe */
#thumbnails-container .thumb-row {
  display: flex;
  flex-wrap: wrap;         /* umbricht automatisch */
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 12px;
}

/* Button-Kachel */
#thumbnails-container .thumb {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;

  flex: 1 1 220px;         /* Basisbreite -> bricht automatisch um */
  max-width: 320px;
  min-width: 160px;

  transition: transform 120ms ease, box-shadow 120ms ease, opacity 200ms ease;
}

#thumbnails-container .thumb:focus-visible {
  outline: 2px solid #888;
  outline-offset: 2px;
}

#thumbnails-container .thumb:hover {
  transform: translateY(-2px);
}

/* Bilder innerhalb der Kachel */
#thumbnails-container .thumb img {
  display: block;
  width: auto;         /* nicht zwingend 100%, damit Höhe dominiert */
  height: 150px;       /* feste Höhe */
  max-width: 100%;     /* Kachelbreite nicht sprengen */
  border: 2px solid #ccc;
  border-radius: 6px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  object-fit: cover;   /* füllt die 150px hoch, schneidet ggf. */
}

#thumbnails-container .thumb img:hover {
  transform: translateY(-2px);
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* Fade-out aus JS */
#thumbnails-container.fade-out {
  opacity: 0;
  transition: opacity 300ms ease;
}

/* ============================
   Responsive Feintuning
   ============================ */

/* Hochformat: Thumbs einspaltig untereinander */
@media (orientation: portrait) {
  #thumbnails-container {
    width: min(800px, 100vw - 1.5rem);
  }
  #thumbnails-container .thumb-row {
    justify-content: stretch;
  }
  #thumbnails-container .thumb {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* Sehr schmale Screens */
@media (max-width: 480px) {
  #Bilder {
    margin-top: 84px; /* etwas kompakter als 100px */
  }
  #Bilder .link-block {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  #Bilder > p {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  #thumbnails-container {
    margin: 0.25rem auto 0.75rem auto;
    padding: 0.25rem;
  }
  #thumbnails-container .thumb {
    flex-basis: 100%;
  }
}

/* ============================
   Model-viewer spezifische Regeln
   ============================ */

/* Standard im Viewer: Links schwarz */
.link-container a {
  color: black;
  text-decoration: none;
}

/* Background an (per JS: .bg-on am Container) -> Links weiß */
.link-container.bg-on a {
  color: white;
  text-decoration: none;
}

/* Optional: Fullscreen-Variante */
.link-container.fullscreen-bg-on a {
  color: white;
  text-decoration: none;
}

/* ============================
   Interaktions-States
   ============================ */

.link-active {
  font-size: calc(1em + 2px);
  font-weight: bold;
  text-decoration: none;
}

/* ============================
   Cross‑browser font normalization (Meta Quest friendly)
   ============================ */

/* Prevent mobile/VR auto text scaling and keep base sizing stable */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep a stable root; we don't change your 12px paragraph sizing */
  font-size: 16px; /* base for rem; doesn't affect your px values */
  line-height: 1.4;
}

/* Ensure everything inherits consistently unless explicitly sized */
body {
  font-size: 1rem; /* 16px base for rem consumers */
  line-height: 1.6;
}

/* Links inherit font-size/line-height from their context to avoid mismatches */
a {
  font-size: inherit;
  line-height: inherit;
}

/* Fixed navs: make sure both sides share the same base, but keep your px line-height */
#Navigation00, #Navigation01 {
  font-size: 1rem;  /* aligns link sizing with body text contexts */
}

/* Paragraph-like texts that were defined with px keep their values; reinforce consistent rendering */
#Bilder .link-intro,
p {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Iframe-embedded UIs: prevent nested scaling in some Android/VR browsers */
iframe {
  font-size: inherit;
}

/* Meta Quest (OculusBrowser) minor correction to avoid unexpected font upscaling of anchors
   Applies only on that browser via UA check (class set by JS below) */
html.meta-quest-fix a {
  font-size: inherit !important;
  line-height: inherit !important;
}


/* Game embedded responsive scaling*/
.game-frame-wrap {
  position: relative;
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
}
.game-frame-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}


