/* =======================================================*/
/*  B A S I S                                             */
/* =======================================================*/
/* --- BASIS-EINSTELLUNGEN --- */
:root {
    --primary: #2c3e50;
    /*--primary1: #00acac; # grau dreieck*/
    /*--primary2: #00acee; #ilona visitenkarte*/
    --accent: #3498db;
    --bg-light: #f9f9f9;
    --text: #333;
}

* {
    box-sizing: border-box;
}

/* =======================================================*/
/*  B O D Y                                               */
/* =======================================================*/
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text);
    background-color: #f4f4f4; /* ein schöner leichter Grauton */
    /* Hintergrundbild festlegen */
    /*background-image: url('images/background.jpg'); */
    
    /* Bild fixieren: Es bewegt sich beim Scrollen nicht mit */
    background-attachment: fixed;
    
    /* Bild so skalieren, dass es den ganzen Bildschirm füllt */
    background-size: cover;
    
    /* Bild zentrieren */
    background-position: center;
}

/* Ein Wrapper, der alle Inhalte zentriert und weiß hält */
.page-wrapper {
    max-width: 1400px; /* Gleiche Breite wie dein .container */
    margin: 0 auto;    /* Zentriert den Wrapper auf der grauen Fläche */
    background-color: #ffffff; /* Der eigentliche Inhalt ist weiß */
    /* box-shadow: 0 0 20px rgba(0,0,0,0.1); /* Optional: Sanfter Schatten zu den grauen Rändern */
    /* box-shadow: 10px 0 15px -5px rgba(0,0,0,0.1), -10px 0 15px -5px rgba(0,0,0,0.1); /* Schatten nur links und rechts */
    margin-top: 0;
    padding-top: 0;
}

/* =======================================================*/
/*  H E A D E R                                           */
/* =======================================================*/
/* Header anpassen: Er füllt nun nur noch den Wrapper aus */
header {
    width: 100%;
    height: 300px; 
    display: flex;
    /* Vertikale Ausrichtung: Ganz unten */
    align-items: flex-end;    
    /* Horizontale Ausrichtung: Mitte */
    justify-content: center;   
    
    /* Ein Sicherheitsabstand nach unten, damit die Buchstaben 
       nicht die Navigationslinie berühren (ca. 20-40px) */
    padding-bottom: 30px; 
    
    /* Sicherstellen, dass kein oberes Padding den Text wegdrückt */
    padding-top: 0;
    position: relative;
    margin-bottom: 0; /* Verhindert Spalt zur Navigation */
    background-position: center top !important;
}

header h1 {
    font-family: "Fahkwang", Sans-serif;
    font-weight: normal;
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin-top: 0; /* verhindert dass Überschrift header schiebt */ 
    /* WICHTIG: margin auf 0 und line-height normalisieren */
    margin: 0;
    line-height: 1.1; 
    /* Optional: Hintergrund-Verlauf hinter dem Text für bessere Lesbarkeit */
    /* background: linear-gradient(transparent, rgba(0,0,0,0.4)); */
    /* width: 100%; */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8); /* Erzeugt einen dunklen Schatten hinter der Schrift */
}

p {
	padding-left: 10px;
	padding-right: 10px;
	margin: 0 0 20px;
}

a {
	color: #333;
}







/* =======================================================*/
/*  N A V I G A T I O N                                   */
/* =======================================================*/
nav {
    background: white;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    box-shadow: none;
    /* border-bottom: 1px solid #eee; */
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.05); */
    margin-top: 0; /* Verhindert Spalt zum Header */
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    text-transform: uppercase;
    transition: all .3s ease;
    font-size: 22px;
    font-weight: 600;
    background-color: #39979B;
    color: #FFF;
    display: flex; /* auchbei umbruch hintergrund */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 14px; /* Zusammengefasst: oben/unten links/rechts */
    border-radius: 4px;    /* Optional: rundet die Ecken der Buttons leicht ab */
    margin: 0;
    height: 100%;
}

nav a:hover, nav a.active {
    /* Hintergrund wird etwas dunkler (Hex-Code oder Filter) */
    background-color: #2d787b; 
    
    /* Schriftfarbe bleibt explizit weiß */
    color: #FFFFFF !important; 
    
    /* Optional: Ein ganz leichter Schatten für den "Drück-Effekt" */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* =======================================================*/
/*  C O N T A I N E R                                     */
/* =======================================================*/
.container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;      /* Verhindert das Umbrechen auf Desktop */
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0rem 2rem;
    padding: 0 20px;
    gap: 20px;              /* Abstand zwischen Inhalt und Sidebar */
}

figcaption {
	display: none;
}

/* =======================================================*/
/*  M A I N                                               */
/* =======================================================*/
main {
    flex: 0 0 78%;          /* Fest auf ca. 80% (abzüglich Gap) */
    min-width: 0;           /* Erlaubt dem Inhalt zu schrumpfen (wichtig für Slider/Tabellen) */
    max-width: 100%;          /* wichtig: Container darf nicht über viewport gehen */
    overflow-wrap: break-word;
}

main.fullwidth {
  flex: 0 0 100% !important;
}

main h1, main h2 , main h3, main h4{
 /*   color: var(--primary);*/
  font-family: 'Roboto Slab';
  color: #39979b;
  font-size: 20px;
  line-height: 1.4;
}
main h2{
  font-size: 18px;
  line-height: 1.4;
}
main h3{
  font-size: 16px;
  line-height: 1.4;
}

main img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /*margin: 1.5rem 0;*/
}

/* =======================================================*/
/*  S I D E B A R                                         */
/* =======================================================*/
aside {
    /*flex: 0 0 18%;          /* Fest auf ca. 20% */
    flex: 0 0 250px;          /* Fest auf ca. 250px, Gesamt breite 1400px
    max-width: 300px;
    position: sticky;       /* Sidebar bleibt beim Scrollen oben */
    top: 100px;
}

aside img {
    width: 100%;            /* Bild passt sich der Breite an */
    height: auto;
    display: block;
    margin-bottom: 20px;
    border-radius: 8px;
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
}

/* --- TABELLEN STYLING --- */
/* =======================================================*/
/*  T A B L E                                             */
/* =======================================================*/
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: table;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--bg-light);
    color: var(--primary);
}


/* =======================================================*/
/* F O O T E R                                            */
/* =======================================================*/
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 4rem;
}

footer a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* =======================================================*/
/* M A I N   PDF-Links                                    */
/* =======================================================*/
/* PDF-Links automatisch kennzeichnen */
main a[href$=".pdf" i]::before {
    content: "\1F4C4"; /* Sicherer Code für das Dokument-Symbol */
    margin-right: 8px;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Optional: PDF-Links etwas hervorheben */
main a[href$=".pdf" i] {
    background-color: rgba(255, 0, 0, 0.05); /* Ganz leichter Rot-Schimmer */
    padding: 2px 5px;
    border-bottom: 1px dotted #cc0000;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

main a[href$=".pdf" i]:hover {
    background-color: rgba(255, 0, 0, 0.1);
    border-bottom-style: solid;
}


/* =======================================================*/
/* B A C K   T O   T O P                                  */
/* =======================================================*/
#backToTop {
    display: none; /* Erstmal verstecken */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    background-color: #333;
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%; /* Rundes Design */
    font-size: 20px;
    transform: rotate(-90deg); /* Pfeil nach oben drehen */
    transition: opacity 0.3s, background-color 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#backToTop:hover {
    background-color: #555;
}

/* =======================================================*/
/* S L I D E R  (T E S T I M O N I A L)                  */
/* =======================================================*/

/* =======================================================*/
/* T Y P E S                                             */
/* =======================================================*/
/* =======================================================*/
/* G A L L E R Y                                          */
/* =======================================================*/

/* =======================================================*/
/* F A C T S                                              */
/* =======================================================*/
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.fact {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}
.Afacts {
  background: white;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin: 2rem 0;
    justify-items: center;
}

.Afact {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    line-height: 1.2;
    /* gleiche Höhe durch grid */
    display: flex;
    flex-direction: column;
    min-height: 120px; /* optionale Mindesthöhe */
}

.Xfacts {
    display: flex;
    flex-wrap: wrap; /* Erlaubt Umbruch auf Handys */
    gap: 15px;
    margin: 2rem 0;
    justify-content: center;
}

.Xfact {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    flex: 1 1 150px; /* Boxen wachsen, sind aber mind. 150px breit */
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    line-height: 1.2;
}


/* =======================================================*/
/* F I G U R E                                            */
/* =======================================================*/
/* Container für das Bild */
figure.page-image,
figure.sidebar-image {
    margin: 0rem 0;
    padding: 0;
    text-align: center; /* Zentriert Bild und Text */
}

/* Das Bild selbst */
figure.page-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Schöne abgerundete Ecken */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Sanfter Schatten */
}

/* Die Bildunterschrift (der Alt-Text aus dem Markdown) */
.slide figcaption {
	display: block;
	white-space: normal; 
}


/* =======================================================*/
/* S L I D E R   -   generisch                            */
/* =======================================================*/

.slider-wrapper {
  width: 100%;
  max-width: none;   /* lässt außen bestimmen, wie breit es ist */
  margin: 0 auto;
  overflow: hidden;
}

/* Slider‑Track (gemeinsam für Quotes + Carousel) */
.slider-wrapper .slider-track {
  display: flex;
  transition: transform 0.4s ease;
}


/* =======================================================*/
/* S L I D E                                              */
/* =======================================================*/
.slider-wrapper .slide {
  flex-shrink: 0;
  padding: 0.5rem;
  box-sizing: border-box;
}


/* =======================================================*/
/* S L I D E   -   N A V I G A T I O N                   */
/* =======================================================*/
/* Slider‑Navigation (gemeinsam für Quotes + Carousel) */
.slider-wrapper .slider-nav {
  margin-top: 1rem;
  text-align: center;
}

.slider-wrapper .nav-prev:disabled,
.slider-wrapper .nav-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: #f0f0f0;
  box-shadow: none;
}

.slider-wrapper:has(.nav-prev:disabled):has(.nav-next:disabled) .nav-prev,
.slider-wrapper:has(.nav-prev:disabled):has(.nav-next:disabled) .nav-next {
  display: none;
}

.slider-wrapper .nav-prev,
.slider-wrapper .nav-next {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  border: 1px solid #ccc;
  background: #f8f8f8;
  cursor: pointer;
  transition: all 0.3s ease; /* macht das Ausgrauen sanft */
}

.slider-wrapper .nav-prev:hover,
.slider-wrapper .nav-next:hover {
  background: #e8e8e8;
}

/* =======================================================*/
/* S L I D E   -   Q U O T E S                            */
/* =======================================================*/
.slider-wrapper.type-quotes {
  margin-bottom: 2rem;
}

.slider-wrapper.type-quotes .slide {
  min-width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;   /* innen seitlich kein zusätzliches Padding, das main übersteigt */
  box-sizing: border-box;
}

.slider-wrapper.type-quotes .quote-card {
  width: 100%;
  max-width: 100%;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

#slider-testimonial.type-quotes .quote-card {
  font-style: italic;
  background: #fff;
  padding: 2.5rem;
  border-radius: 15px;
  border: none;
  border-left: 8px solid var(--accent);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 200px;
}

.slider-wrapper.type-quotes .quote-card p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;

  /* Nagelt den Text innerhalb main */
  word-break: break-word;      /* lange Wörter brechen */
  overflow-wrap: break-word;
  hyphens: auto;               /* optional: Trennungen */
}

.slider-wrapper.type-quotes .quote-card cite {
  font-style:  italic;
  font-weight: bold;          /* fett */
  font-size:   0.9rem;
  color:       #555;
  text-align:  right;         /* rechtsbündig */
  display:     block;         /* damit text-align wirkt */
}

.slider-wrapper.type-quotes .quote-icon {
  font-size: 2rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  display: block;
}


/* =======================================================*/
/* S L I D E   -   C A R O U S E L                        */
/* =======================================================*/
/* Bildbreite flexibel einstellbar */
.slider-wrapper.type-carousel .slide {
  width: 33%;        /* 3 Bilder sichtbar, änderbar: 50%, 25%, 100% */
  padding: 0.5rem;
}


.slider-wrapper.type-carousel figure {
  margin: 0;
  height: 350px;          /* Wunsch‑Höhe des Carousels, z.B. 400px */
  position: relative;     /* damit img darin „hängt“ */
  overflow: hidden;       /* um Überstände zu schneiden */
}

.slider-wrapper.type-carousel img {
  width: 100%;
  Xheight: 100%;           /* volle Höhe des figure */
  height: 85%;           /* volle Höhe des figure */
  object-fit: cover;      /* Bild proportional füllt die Höhe */
  object-position: center; /* zentriert im Container */
  display: block;
  border-radius: 6px;
}

.Xslider-wrapper.type-carousel figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

/*.slide figcaption */
.slide figcaption {
  font-size: 0.95rem;
  font-weight: 600;        /* ← Halbfett */
  color: #222;             /* ← Dunkelgrau */
  text-align: center;
  margin: 0;
  padding: 0.5rem;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  border: 1px solid #eee;
}

.slide Xfigcaption {
  display: block !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: red !important;
  background: yellow !important;
  border: 3px solid red !important;
  padding: 1rem !important;
  margin: 0 !important;
  text-align: center !important;
  border-radius: 8px !important;
  position: static !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* Wenn du auf bestimmten IDs nochmal anpassen willst, z.B. für ein 100%‑Carousel */
#slider-grundriss.slider-wrapper.type-carousel figure {
  height: 800px;          /* Wunsch‑Höhe des Carousels, z.B. 400px */
}
#slider-grundriss.slider-wrapper.type-carousel figure img {
  width: auto;      
}
#slider-grundriss.slider-wrapper.type-carousel .slide {
  width: 50%;        /* 3 Bilder sichtbar, änderbar: 50%, 25%, 100% */
}

/* =======================================================*/
/* L I G H T B O X                                        */
/* =======================================================*/

/* Overlay */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.show {
  display: flex;
  opacity: 1;
}

/* Swipe-fähig machen */
.lightbox-content {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y; /* vertikales Scrollen erlauben */
  user-select: none;
}

/* Bild im Lightbox */
#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Schließen‑Button (X) */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  font-weight: normal;
  line-height: 1;
}

/* Navigation‑Buttons (links/rechts) */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.lightbox-nav:hover {
  opacity: 1;
}

/* Linker Button */
.lightbox-prev {
  left: 20px;
}

/* Rechter Button */
.lightbox-next {
  right: 20px;
}

#lightbox-caption {
  color: #fff;
  font-size: 2rem;
  text-align: center;
  margin-top: 1rem;
  opacity: 0.9;
}

/* =======================================================*/
/*  I M A G E   C O M P A R I S O N S                     */
/* =======================================================*/
* {box-sizing: border-box;}

.img-comp-container {
  position: relative;
  height: 200px; /*should be the same height as the images*/
}

.img-comp-img {
  position: absolute;
  width: auto;
  height: auto;
  overflow:hidden;
}

.img-comp-img img {
  display:block;
  vertical-align:middle;
}

.img-comp-slider {
  position: absolute;
  z-index:9;
  cursor: ew-resize;
  /*set the appearance of the slider:*/
  width: 40px;
  height: 40px;
  background-color: #2196F3;
  opacity: 0.7;
  border-radius: 50%;
}



/* =======================================================*/
/* M O B I L E                                            */
/* =======================================================*/
@media (max-width: 768px) {

  .slider-wrapper {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y; /* horizontales Swipe bleibt frei */
  }

    .Xslider-nav { display: none; }

    /* 1. Den Flexbox-Container auf vertikal umstellen */
    .container {
        display: block !important; /* Erzwingt das Untereinanderstehen */
        margin: 0rem 0px;
    }

    /* 2. Die Sidebar komplett entfernen */
    aside {
        display: none !important; /* !important stellt sicher, dass kein anderes Script/Style sie anzeigt */
    }

    /* 3. Den Hauptbereich auf volle Breite setzen */
    main {
        width: 100% !important;
        padding: 3px; /* Optional: Etwas Rand für bessere Lesbarkeit auf dem Handy */
        margin: 0;
    }
    
    /* 4. Sicherstellen, dass Bilder im Text nicht überlaufen */
    img {
        max-width: 100%;
        height: auto;
    }

  /* Mobile: Gesamthöhe des Carousels reduzieren */
  .slider-wrapper.type-carousel figure {
    height: 180px;        /* statt 350px */
    position: relative;
    overflow: hidden;        /* wichtig: Überstände abschneiden */
  }

    nav {
	    padding: 0.5rem;
	 }

    nav a {
       font-size: 12px;
       padding: 8px 12px;
       min-height: 44px; /* gute klickgröße */
       width: auto;
       }

    nav ul {
       gap: 4px;
       flex-wrap: wrap;
       }

    header h1 {
        font-size: 2.0rem;         /* Schrift etwas kleiner für Mobile */
        text-align: center;        /* Erzwingt Zentrierung nach dem Umbruch */
        
        /* Sperrbereich links und rechts: 
           Der Text nutzt nur noch 70% der Breite, 
           was den Umbruch früher erzwingt. */
        max-width: 70%;            
        margin-left: auto;
        margin-right: auto;
        
        line-height: 1.2;          /* Genug Platz zwischen den umgebrochenen Zeilen */
        padding-bottom: 5px;      /* Feinjustierung für den unteren Rand */
    }

    header {
        height: 230px;             /* Optional: Header auf Mobile etwas niedriger */
        padding-bottom: 10px;
    }

    table {
        display: block; /* Macht die Tabelle flexibler */
        width: 100%;
        overflow-x: auto; /* Erlaubt horizontales Scrollen innerhalb der Tabelle */
        -webkit-overflow-scrolling: touch; /* Flüssiges Wischen auf dem Handy */
        white-space: nowrap; /* Verhindert, dass Text innerhalb der Zellen unschön umbricht */
    }

    th, td {
        min-width: 120px; /* Garantiert, dass die Spalten lesbar bleiben */
        padding: 8px;
    }

	#slider-grundriss.slider-wrapper.type-carousel .slide {
	  width: 80%;        /* 3 Bilder sichtbar, änderbar: 50%, 25%, 100% */
	}
}
