/* =========================================================
   GRUNDLAYOUT
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;   /* keine horizontale Scrollbar */
    overflow-y: auto;     /* vertikal scrollen erlaubt, wenn nötig */
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3d79a;
    color: #1a1a1a;
}

/* =========================================================
   SEITENRAHMEN
========================================================= */

.page {
    min-height: 100vh;        /* mindestens Bildschirmhöhe */
    display: flex;
    flex-direction: column;
    overflow: visible;        /* Inhalt darf höher sein */
}


/* HEADER ***************************************************************** */

.page-header {
  padding: 1rem clamp(1.5rem, 4vw, 4rem) 0.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

/* HAUPTBEREICH *********************************************************** */

.page-main {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  padding: 0 1.5rem 0.75rem;
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden; /*scroll.fix*/
}

/* Text-Spalte links */

.info-column {
  flex: 0 0 min(26rem, 35vw);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-box {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0.9rem;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.info-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.info-text {
  margin: 0;
  line-height: 1.4;
}

.impressum-link {
  margin-top: 0.5rem;
  display: inline-block;
  color: #004b7f;
  text-decoration: underline;
}

.impressum-text {
  max-height: 70vh;     /* falls der Text lang wird */
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.5;
}

.impressum-text p {
  margin-bottom: 0.75rem;
}


/* Baum-Spalte rechts */

.tree-column {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* >>> HIER: DESKTOP tree-wrapper – nur über Breite, keine Höhe erzwingen */
.tree-wrapper {
  position: relative;
  max-width: 520px;
  width: 100%;
  overflow: hidden;
}

.tree-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Hotspots *************************************************************** */

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

#modal-image {
  display: none;           /* Standard: unsichtbar – nur bei Wünschen sichtbar */
  max-width: 100%;
  height: auto;
  margin-top: 1rem;
  border-radius: 0.5rem;
}

/* Größen: Kugeln kleiner, Geschenke größer */
.kugel {
  width: 9%;
  aspect-ratio: 1 / 1;
}

.geschenk {
  width: 13%;
  aspect-ratio: 1 / 1;
}

/* Debug-Hilfen für Hotspots 
.hotspot {
  background: rgba(255, 0, 0, 0.25);
  border: 1px solid red;
}
*/

/* MODAL ****************************************************************** */

#modal-heading,
#modal-text {
  display: none;   /* Überschrift & Text im Modal unsichtbar */
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.open {
  display: flex;
}

.modal-inner {
    max-height: 90vh;
    overflow: hidden;
}

/* Bild im Modal */
#modal-image {
    display: none;
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 0.5rem;
}

/* Schließen-X IM weißen Modal-Fenster */
.modal-close {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    z-index: 10;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    border: none;
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.25);
}

#modal-heading {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

#modal-text {
  margin: 0;
  line-height: 1.4;
}

/* Bild im Modal (zweite Definition, wie bei dir) */
#modal-image {
    display: none;      /* Wird erst per JS sichtbar */
    width: 100%;       /* Bild füllt das Modal */
    height: auto;      /* Seitenverhältnis bleibt korrekt */
    max-width: 720px;  /* Maximalbreite, sonst wird es sehr groß */
    margin: 0;         /* Kein extra Abstand */
    border-radius: 0.4rem;
}


/* RESPONSIVE ************************************************************* */


/* Handy / Tablet */
@media (max-width: 768px) {

  .page-header {
    padding: 0.5rem 1rem 0;   /* etwas kompakter */
  }

  .page-main {
    flex-direction: column;   /* Text oben, Baum unten */
    gap: 0.75rem;
    padding: 0 1rem 0.75rem;
    overflow: hidden;         /* nichts darf überlaufen */
    min-height: 0;
  }

  .info-column {
    flex: 0 0 auto;           /* nimmt nur so viel Höhe, wie der Text braucht */
    width: 100%;
  }

  .tree-column {
    flex: 1 1 auto;           /* Baum nutzt den restlichen Platz */
    width: 100%;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  /* >>> HIER: MOBILE tree-wrapper – auch keine Höhe erzwingen */
  .tree-wrapper {
    max-width: 460px;
    width: 100%;
    margin-inline: auto;
    margin-top: 0;
    overflow: hidden;
  }
}
