:root {
  --page-max: 1100px;
  --gap: clamp(16px, 3vw, 40px);
  --pad: clamp(16px, 3vw, 40px);
  --brand-size: clamp(32px, 12vw, 200px);
  --panel-shadow: -8px 10px 20px rgba(0,0,0,0.32),  -6px 4px 16px rgba(0,0,0,0.15);
  --panel-filter-shadow: 
      drop-shadow(-8px 10px 20px rgba(0,0,0,0.32))
      drop-shadow(-6px 4px 16px rgba(0,0,0,0.15));
}

/* Basics */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
 font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #ffffe6;

}


body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../images/background1.jpeg") center/cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* Scrollen nur im Wrapper, damit die Maske am Viewport „klebt“ */



body { overflow: hidden; }
/* Seite selbst scrollt NICHT */
body { overflow: hidden; }

:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* OBEN: erst voll abdecken, dann kurz ausfaden */
  --cover-top:   clamp(120px, calc(140px - 1.85vw), 225px);  /* Länge der vollen Abdeckung ab ganz oben */
  --fade-top: 32px;     /* kurze Übergangszone von unsichtbar → sichtbar */

  /* UNTEN optional: kurzer Ausblend-Übergang */
  --fade-bottom: 80px;  /* 0px = kein unterer Fade */
}

body [role="tooltip"] {
  display: none !important;
}

/* ab Desktop (Schalter beliebig anpassen, z.B. 1024px) */
@media (min-width: 1024px){
  :root{
    --cover-top: clamp(150px, calc(140px - 1.85vw), 225px);
  }
}

/* optional: auf sehr breiten Screens hart am Boden halten */
@media (min-width: 1600px){
  :root{ --cover-top: 150px; }  /* fix */
}


.viewport-mask{
  position: fixed;
  inset: 0;
  overflow: auto;
  z-index: 100;
  -webkit-overflow-scrolling: touch;

  /* Alpha-Maske: transparent = unsichtbar, #000 = sichtbar */
  -webkit-mask-image: linear-gradient(
    to bottom,
    /* OBEN lange Vollabdeckung */
    transparent 0,
    transparent calc(var(--safe-top) + var(--cover-top)),

    /* kurzer Übergang zu sichtbar */
    #000       calc(var(--safe-top) + var(--cover-top) + var(--fade-top)),

    /* sichtbare Mitte bis kurz vor unten */
    #000       calc(100% - var(--safe-bottom) - var(--fade-bottom)),

    /* kurzer Übergang nach unten raus (optional) */
    transparent 100%
  );
          mask-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--safe-top) + var(--cover-top)),
    #000       calc(var(--safe-top) + var(--cover-top) + var(--fade-top)),
    #000       calc(100% - var(--safe-bottom) - var(--fade-bottom)),
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

/* „Nachlauf“, damit der Content weich in den unteren Fade läuft */
.viewport-mask::after{
  content: "";
  display: block;
  height: calc(var(--safe-bottom) + var(--fade-bottom));
}


/* nur falls vorhanden */
.viewport-mask::before{
  /* dein bisheriger Stil … */
  z-index: 101; /* unter TinyMCE (2.1e9) bleiben */
  pointer-events: none; /* blockt keine Klicks */
}






/* dein normales Layout innen */
.page-content {
  min-height: 100%;
  /* ...restliche Styles… */
}


/* Hintergrund oben links */
.bg-corner {
  position: fixed;
  top: 0;
  left: 0;
  width: 45vw;
  height: auto;
  aspect-ratio: 1 / 1;
  background: url('../images/bayern.png') no-repeat top left;
  background-size: contain;
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

/* Logo oben links */
.logo {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
}


.logo img {
  height: var(--brand-size);
  width: auto;
  display: block;
  filter: var(--panel-filter-shadow);
}





/* Layout */
main.page {
 /* margin-left: -2vw; */
  max-width: var(--page-max);
  /* margin: 0 auto; */
  /* padding: 0 var(--pad) 18vh; */
  display: grid;
  /* grid-template-columns: 1fr; */
  /* gap: clamp(12px, 2.5vw, 28px); */
  z-index: 100;
  margin-top: 11em;

}

/* Zwei H1 wie Startseite, etwas höher positioniert */

main.page section:first-child {
   margin-top: clamp(56px, 15vh, 220px);
 
}

main.page .headline {
 
  text-align: center;
  line-height: 1.1;
}


main.page .headline h1 {
  margin: 0.2em 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
}
main.page .headline h1 + h1 {
  font-weight: 700;
  opacity: .9;
}

/* Erste Section */
main.page > section:first-of-type .headline {
  margin-bottom: 3em;   /* größerer Abstand */
}

/* Alle folgenden Sections */
main.page > section:nth-of-type(n+2) .headline {
  margin-bottom: -2.5em; /* kleinerer Abstand */
}



/* Seiten überschrift  */
.page-title {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  margin-top:  clamp(5px, 3vw, 70px)!important; /* 39px; */ 
  font-size: 2.5em;
  width: 60%;
  overflow-wrap: anywhere;
  hyphens: auto;
}


/* Großer Block analog zu start.css .content-box */

.content-box {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  opacity: .95;
  background-color: #008394b0;
  color: #fff;
  margin: 0 auto;
  margin-top: 3em;
  width: clamp(240px, 70vw, 44rem);
  word-wrap: break-word;
  text-align: left;
  padding: clamp(0.6em, 2vw, 1.2em);
  border-radius: 10px;
  box-shadow: var(--panel-shadow);
}


.content-box p { margin: 0.3em 0; }
.content-box a { 
  color: #ffffe6;
}


/* Fließtext */
.page-content {
  max-width: 65ch;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.6;
  /* margin-top: 45px; */
  padding-left: 1ch;
  padding-right: 1ch;
}

.page-content article {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  opacity: .9;
  background-color: #008394b0;
  margin-bottom: 1em;
/*  width: clamp(200px, 60vw, 28em); */
  word-wrap: break-word;
  text-align: center;
  padding: 0.5em;
  border-radius: 8px;
  box-shadow: var(--panel-shadow);


}

.article-card__title {
  line-height: 1em;

}


.article-card__body {
  margin-left: 1.5em;
  margin-right: 1.5em;
}

.article-card__body a {
  color: #ffffe6;
}


.article-card__intro {
  text-align: left;
}

.article-card__intro img[width],
.article-card__intro img[height]{
  max-width: 100%;
}

.article-card__intro img {
  margin-top: 1em;
   margin-bottom: 1em;
}

.float-start {
  float: left;
  margin-right: 1.5em;
  margin-left: 0;
}

.float-end {
  float: right;
  margin-left: 1.5em;
  margin-right: 0;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
  display: block;
}


/* ===== artikel headline ========= */



/* Gemeinsamer Container */
.article-card {
 /* display: flex; */
  justify-content: space-between; /* Titel links, Meta rechts */
  align-items: center;            /* mittige Ausrichtung bei einem Element */
  gap: 1rem;
  flex-wrap: wrap;                /* bricht sauber bei schmalem Layout um */
}


/* Titel */
.article-card__title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem);
  line-height: 2;
  flex: 1 1 auto;
  float: left;
}

/* Meta-Bereich (rechts) */
.article-card__meta {
 /* display: flex; */
  flex-direction: column;       /* Standard: untereinander (für Datum + Autor) */
  align-items: flex-end;        /* rechtsbündig! */
  text-align: right;
  font-size: clamp(0.9rem, 0.3vw + 0.85rem, 1rem);
  color: var(--muted, #555);
  line-height: 7ch;
  min-width: 8ch;
  color: #ffffe6;
  right: 0;
}

.article-card__meta span,
.article-card__meta time { 
height: 1em;
line-height: 6ch;
display: block;
}

/* --- Dynamik nach Inhalt steuern --- */

/* (A) Wenn NUR EIN Element (Autor ODER Datum) */
.article-card__meta:has(:only-child) {
  flex-direction: row;          /* nebeneinander, mittig zur Überschrift */
  align-items: center;
  text-align: right;
  gap: 0.3rem;
}

/* (B) Wenn KEINE Überschrift vorhanden */
.article-card:not(:has(.article-card__title)) {
  justify-content: flex-end;     /* alles rechtsbündig */
  align-items: center;
}
.article-card:not(:has(.article-card__title)) .article-card__meta {
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

/* --- Responsiv: Meta unter Überschrift bei schmalem Layout --- */
@media (max-width: 600px) {
 .article-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* H2 sicher untereinander, links und breit */
  .article-card__title {
    float: none;            /* float außerhalb neutralisieren */
    display: block;
    width: 100%;
    text-align: left;
    order: 1;               /* wirkt nur bei flex-parent */
  }

  .article-card__meta {
    order: 2;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    line-height: 1.2;
  }
}

.headdivide {
  width: 100%;
  display: flex;
}
.headwrap {
  display: flex;
  width: 100%;
  text-align: left;
}

/* Responsiv */
@media (max-width: 640px) {
  :root { 
   

      /* Höhe des reinen Bild-Streifens oben (Content komplett verdeckt) */
  --fade-opaque: 135px;   /* z.B. 180–280px */

  /* Länge des weichen Übergangs darunter */
  --fade-length: 15px;    /* z.B. 50–90px */

  /* Gesamthöhe des Overlays */
  --fade-height: calc(var(--fade-opaque) + var(--fade-length));
  }

 /* .brand { top: 8px; left: 8px; }
  .page-guard { height: calc(var(--brand-size) + 16px); }
  main.page .headline { margin-top: clamp(50px, 8vh, 160px); }
  
  .menu-button { 
/ *    top: -8px; * /
    right: 6vw; 
  }

  .content-box { width: min(88vw, 44rem); }


/ * Fließtext * /
.page-content {

  margin-top: 70px;
}
*/

  .page-title {
        margin-top: clamp(38px, calc(80px - 6vw), 60px);
 }
 
}


