/* Variablen */
:root {
/* Viewport height */
  --vh: 1vh;	  
/* Farbschema */
  --color-bg-main: #f7fbff;
  --color-bg-side: #f0f4f8;
  --color-bg-header: #a9cfff;
  --color-bg-footer: #a9cfff;
  --color-bg-special: #a9cfff;
  --color-text-primary: #0b2545; 
  --color-text-secondary: #49525B;
  --color-link: #0055aa;
  --color-link-hover: #005BBB;
  --color-link-focus: #d4b94f; /* warmes, gedämpftes Goldgelb mit gutem Kontrast */
/* Schrift und Grösse */
  --font-text-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-text-secondary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-size-primary-mobile: 14px;
  --font-size-primary-tablet: 16px;
  --font-size-primary-desktop: 18px;
  /* Dynamische Dimensionen */
  --height-header: 51px;   /* Fallback */
  --height-nav: 38px;   /* Fallback */
}

/* alles für Consent Management Policy CMP*/
.hidden {
  display: none;
}

.cookie-banner, .cookie-settings {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #eee;
  padding: 1em;
  text-align: center;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
  z-index: 10000;
}

.cookie-settings {
  top: 20%;
  bottom: auto;
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid #ccc;
  background: white;
  padding: 1em;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Basis-Styles für alle Geräte */
html, body {
  height: 100%;
  font-family: var(--font-text-primary);
  font-size: var(--font-size-primary-mobile);
  line-height: 1.5;
  margin: 0;/* Wichtig, um unerwünschte Abstände zu vermeiden */
  padding: 0;
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
}

h1 {
  color: var(--color-text-primary);
  font-size: clamp(1.5rem, 4vw, 3rem);
}
h2 {
  color: var(--color-text-primary);
  font-size: clamp(1.25rem, 3vw, 2.5rem);
}

h3 {
  color: var(--color-text-primary);
  font-size: clamp(1.125rem, 2vw, 2.25rem);
}

p {
  color: var(--color-text-primary);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

a {
  color: var(--color-link);
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

a:focus {
  color: var(--color-link-focus);
  text-decoration: underline;
}

/* Basis-Grid für alle Geräte */
* {
  box-sizing: border-box;
}

.grid-container {
  background-color: var(--color-bg-main); /* Pastellblau konsistent */
  display: grid;
  grid-template-columns: repeat(12, [col-start] 1fr);
  /* rows created automatically in order of HTML appearance */
  z-index: 30; /* Header bleibt immer oben */
  width: 100%; /* full width */
  Min-height: 0; /* for shrinking * /  
  height: calc(var(--vh) * 100);  /* always use calculated viewport height for container */
  max-height: 100vh;  /* be strict */
  max-width: 100vw;
  border: none;
  margin: 0 auto;
  padding: 0;
  gap: 0; /* space between grid items */
  overflow-x: hidden;
}

.grid-header {
  position: sticky;
  top: 0;
  -webkit-backface-visibility: hidden; /* improve GPU compositing */
  will-change: transform;               /* hint browser for smoother rendering */
  z-index: 1000;
  background-color: var(--color-bg-header);
  display: grid; /* eigenes Grid im Header */
  grid-template-columns: 1fr auto auto;
  user-select: none;
  padding: 15px 10px;
  gap: 0 10px; /* no  vertical gap but space between items*/
  align-items: center;
  justify-content: stretch;
  font-family: var(--font-text-primary);
  color: var(--color-text-primary);
  font-weight: bold;
  font-size: 0.875rem;
  }

.grid-nav {
  background-color: var(--color-bg-side);
  display: flex;
  user-select: none;
  padding: 5px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text-primary);
  color: var(--color-text-primary);
  font-weight: bold;
  font-size: clamp(12px, 1.5vw, 18px); /* responsive font sizing */
}

.grid-nav ul {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap; /* erlaubt das Umbrechen */
  margin: 0;
  padding: 0;
  align-self: flex-start; /* key to prevent stretching */
  justify-content: center; /* zentriert die Links */
  list-style: none;
}

.grid-nav ul li {
  flex: 1 1 150px; /* flexibel, aber mindestens 150px breit sonst Umbruch */
  margin: 0 10px;
  text-align: center;
}

.grid-main {
  box-sizing: border-box;
  display: grid;
  position: relative;
  grid-template-columns: 1fr;
  user-select: none;
  justify-content: center;
  font-family: var(--font-text-primary);
  color: var(--color-text-primary);
  font-size: 1.2em;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.grid-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 5%;      /* start border at 5% of width */
  width: 90%;     /* border spans 90% of width */
  height: 2px;
  background-color: var(--color-bg-header);
  border-radius: 2px;
}

.grid-main::after {
  content: "";
  display: block;
  height: 100px;           /* avoids scroll issue on iOS */
  pointer-events: none;   /* avoid interaction */
  user-select: none;      /* prevent text selection */
  background: transparent;
}

.grid-sidebar {
    background-color: var(--color-bg-side);
    display: flex;
    position: relative;
    padding: 20px;
    font-style: oblique;
    font-size: clamp(14px, 1.5vw, 18px);
    align-items: flex-start;
    overflow-wrap: break-word;
  }

.grid-sidebar::before, .grid-sidebar::after {
  content: "";
  position: absolute;
  left: 10%;      /* start border at 10% of width */
  width: 80%;     /* border spans 80% of width */
  height: 2px;
  background-color: var(--color-bg-header);
  border-radius: 2px;
}

.grid-sidebar::before {
  top: 0;
}

.grid-sidebar::after {
  bottom: 0;
}

  .grid-ads {
    background-color: var(--color-bg-side);
    display: flex;
    font-size: clamp(14px, 1.2vw, 18px);
    padding: 20px;
    align-items: flex-start;
    overflow-wrap: break-word;
  }

.grid-footer {
  background-color: var(--color-bg-footer);
  display: grid; /* eigenes Grid im Footer */
  grid-template-columns: auto auto auto 1fr auto;
  user-select: none;
  overflow: auto;
  min-height: 70px; /* etwas größer als max icon Höhe für Abstand */
  border: none;
  padding: 20px;
  gap: 0 20px; /* no vertical gap but space between grid items */
  align-items: center;
  justify-content: center;
  font-family: var(--font-text-primary);
  color: var(--color-text-primary);
  font-weight: bold;
  font-size: 0.875rem;
}
/* Sizing of images for inline icons*/
.imgicon {
  width: 1em;              /* relative width for responsiveness */
  height: 1em;             /* same as width to keep uniform square size */
  max-width: 59px;        /* maximum size limit */
  max-height: 59px;       /* maximum size limit */
  display: inline-block;   
  object-fit: contain;     /* keeps aspect ratio, fits inside box */
  background-color: transparent; /* optional: helps visualize area */
  vertical-align: middle;  /* aligns inline-block nicely with text */
  margin-right: 0.3em;  /* adds space between image and text */
}
/* Sizing of images for mediaicons*/
.mediaicon {
  width: 1.5em;              /* relative width for responsiveness */
  height: 1.5em;             /* same as width to keep uniform square size */
  max-width: 120px;        /* maximum size limit */
  max-height: 120px;       /* maximum size limit */
  display: inline-block;   
  object-fit: contain;     /* keeps aspect ratio, fits inside box */
  background-color: transparent; /* optional: helps visualize area */
  vertical-align: middle;  /* aligns inline-block nicely with text */
  margin-right: 0.3em;  /* adds space between image and text */
}

.responsive-image-large {
  min-width: 0;                /* allow shrinking */
  max-width: 100%;             /* never exceed container width */
  max-height: 60vh;            /* limit height */
  object-fit: contain;         /* scale image to fit inside */
  width: auto;
  height: auto;
  margin-top: 1rem;    /* extra space above image */
  margin-left: 5px;
  margin-right: 10px;
  display: block;
}

/* Additional Styling for paragraphs with IDs in HTML*/
#HeaderName {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.05em;
}

#OrtGruss {
  color: var(--color-text-secondary);
}

#language, #disclaimer-link {
  justify-self: end;
}

#contact {
  color: var(--color-text-secondary);
}

#DatumUhr {
  font-weight: bold;
  color: var(--color-text-secondary);
  padding: 5px 0;
  text-align: center;
  box-sizing: border-box; /* Ensure padding doesn't break width */
}

#Credits {
  font-weight: bold;
  color: var(--color-text-secondary);
  padding: 10px 20px;
  align-self: start;
  justify-self: start;
  text-align: left;
  box-sizing: border-box; /* Ensure padding doesn't break width */
}

#back-button1, #back-button2  {
  width: 50%; /* 50% of parent container's width */
  max-width: 200px; /* optional max width */
  min-width: 100px; /* optional min width */
  padding: 8px 16px;
  box-sizing: border-box; /* include padding in width */
  margin-bottom: 1em;
}

/* Responsive adjustments per device*/
/* Mobile first */
html, body {
  height: 100%;
  font-family: var(--font-text-primary);
  font-size: var(--font-size-primary-mobile);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
}
.anker-offset {
  scroll-margin-top: calc(10px + var(--height-header) + var(--height-nav)); /* Höhe des Headers */
}
#back-button1, #back-button2  {
  scroll-margin-top: calc(10px + var(--height-header) + var(--height-nav)); /* Höhe des Headers */
}

.grid-container {
  grid-template-rows: auto auto auto auto auto auto;
  overflow-y: visible;
}

.grid-container > * {
  padding: 10px;
  grid-column: col-start / span 12;
}

  .grid-header, #OrtGruss {
    font-size: 0.875rem;
  }
  #content {
    font-size: 1rem;
  }
.grid-nav {
  position: sticky;
  top: var(--height-header);
  z-index: 500;
  display: grid; /* eigenes Grid im Navigationsbereich */
  grid-template-columns: 1fr;
  gap: 0 10px; /* no vertical gap but space between grid items */
  border: none;
  padding: 10px;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}
/* ul as flexbox - spread links horizontally on small screens */
.grid-nav ul {
  display: flex;
  Width: 100%; /* fill the .grid-nav cell */
  flex-direction: row; /* explicitly horizontal on small devices */
  flex-wrap: nowrap; /* erlaubt das Umbrechen hier nicht */
  justify-content: space-between; /* spread links across full width */
  padding: 0;
  margin: 0;
  list-style: none;
}

/* li styling */
.grid-nav ul li {
  flex: 1; /* make links take equal width */
  text-align: center;
}

.grid-footer {
    font-size: 0.875rem;
  }

.disclaimer-text {
  font-size: 1rem; /* base size for paragraph */
}

.disclaimer-text p {
  font-size: 1em; /* normal body text */
  line-height: 1.5; /* improves readability */
}

.disclaimer-text ul {
  list-style-position: inside; /* center bullety */
}

.disclaimer-text h2 {
  font-size: 1.25em; /* slightly larger for subheadings */
  line-height: 1.4;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.disclaimer-text h1 {
  font-size: 1.75em; /* prominent main heading */
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

/* Medium devices (tablets > 576px */
@media (min-width: 576px) {

html, body {
  font-size: var(--font-size-primary-tablet);
  line-height: 1.5;
  overflow: visible;
}
.anker-offset {
  scroll-margin-top: 0; /* reset */
}
#back-button1, #back-button2  {
  scroll-margin-top: 0; /* reset */
}
  .grid-container {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow-x: hidden;
  overflow-y: auto;
  }
  
  .grid-sidebar {
    grid-column: col-start / span 3;
    grid-row: 3;
    flex-direction: column;
    min-height: max-content;
    padding: 30px;
    overflow: hidden;
  }

  .grid-sidebar::after {
    content: none;          /* removes the pseudo-element */
    height: 0;
    background-color: transparent;
  }

.grid-sidebar::before {
  left: 5%;      /* start border at 5% of width */
  width: 95%;     /* border spans 95% of width */
  height: 2px;
}

  .grid-ads {
   background-color: var(--color-bg-footer); /* Show as footer for now */ 
   grid-column: col-start / span 3;
  }

  .grid-main {
    grid-column: col-start 4 / span 9;
    grid-row: span 1;
    width: 100%;
    min-width: 0;
    max-width: 90vw;
    height: 100%;
    min-height: 0;
    max-height: 90vh;
    overflow-y: auto;
  }

.grid-main::before {
  left: 0%;      /* start border at 5% of width */
  width: 95%;     /* border spans 95% of width */

}

  .grid-nav {
    font-size: 0.875rem;
  }

  .grid-nav ul {
    justify-content: flex-start; /* align links left */
    gap: 1rem; /* space between links */
  }

  .grid-nav ul li {
    flex: none; /* natural width */
    text-align: left;
  }

  .grid-header, #OrtGruss {
    font-size: 0.875rem;
  }
  #content {
    font-size: 1.25rem;
  }
  
  .grid-footer {
    grid-column: col-start 4 / span 9;
    font-size: 0.875rem;
  }
}

.disclaimer-text {
  font-size: 1rem; /* base size for paragraph */
}

.disclaimer-text p {
  font-size: 1em; /* normal body text */
  line-height: 1.5; /* improves readability */
}

.disclaimer-text h2 {
  font-size: 1.25em; /* slightly larger for subheadings */
  line-height: 1.4;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.disclaimer-text h1 {
  font-size: 1.75em; /* prominent main heading */
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

/* Large  devices (Desktops) > 768px */
@media (min-width: 768px) {

html, body {
  font-size: var(--font-size-primary-desktop);
  line-height: 1.5;
}

  .grid-container{
  grid-template-rows: auto auto 1fr auto;
  overflow-y: auto;
  }

  .grid-nav {
    grid-column: col-start / span 2;
    position: static;
    grid-row: 2 / 4;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    width: max-content; /* Breite passt sich Inhalt an */
    font-size: 1rem;
    overflow: hidden;
  }

  .grid-nav ul {
    display: flex;
    flex-direction: column; /* stack links vertically */
    justify-content: flex-start; /* align items to top */
    gap: 1rem; /* space between links */
  }

  .grid-nav ul li {
    flex: none; /* reset flex-grow */
    text-align: left; /* align text left for vertical nav */
  }

  .grid-main {
    grid-column: col-start 3 / span 8;
    grid-row: 2 / 4;
    padding-inline: 45px;
  }

  .grid-main::before {
    content: none;          /* removes the pseudo-element */
    height: 0;
    background-color: transparent;
  }

  .grid-sidebar {
    grid-column: col-start 11 / span 2;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    background-color: var(--color-bg-side); /* Integrate with side here */
    padding: 0;
    padding-inline: 30px;
    overflow: hidden;
  }

.grid-sidebar::before {
  left: 20%;      /* start border at 20% of width */
  width: 70%;     /* border spans 70% of width */
  height: 2px;
}

  .grid-ads {
    background-color: var(--color-bg-side); /* Integrate with side here */ 
    grid-column: col-start 11 / span 2;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding-inline: 30px;
    overflow: hidden;
  }

  .grid-footer {
    grid-column: col-start / span 12;
  }

  .grid-header, #OrtGruss {
    font-size: 0.875rem;
  }

  #content {
    font-size: 1.75rem;
  }

  .grid-footer {
    font-size: 0.875rem;
  }

.disclaimer-text {
  font-size: 1rem; /* base size for paragraph */
}

.disclaimer-text p {
  font-size: 1em; /* normal body text */
  line-height: 1.5; /* improves readability */
}

.disclaimer-text h2 {
  font-size: 1.25em; /* slightly larger for subheadings */
  line-height: 1.4;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.disclaimer-text h1 {
  font-size: 1.75em; /* prominent main heading */
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}
}