/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: #f7f9fa;
  color: #333;
}

/* Main Content */
main {
  padding: 2rem;
  margin-top: 70px;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

.content-article ul, .content-article ol{
    margin-top: 10px;
    padding-left: 30px;
    padding-top: 10px;
    padding-bottom: 10px;
    background-color: rgba(20,100,200,0.2);
    border-radius: 5px;
}

.content-article ul > li, .content-article ol > li {
  padding: 5px;
}

.content-article img{
  margin-top: 5px;
  margin-bottom: 5px;
}

.content-article figure{
  margin-top: 20px;
  margin-bottom: 20px;
}

.content-article {
    /* Begrenzung auf Desktop & Tablet */
    max-width: 800px;
    margin: 0 auto;              /* zentriert den Block */
  
    /* Flexibles Innen-Padding:   min   ideal   max */
    padding-left:  clamp(12px, 5vw, 24px);
    padding-right: clamp(12px, 5vw, 24px);
  
    font-size: 19px;
    /* border: 1px solid red; */
  }

  .content-article p{
  }
  
.content-article h1, .exercise h1{
  margin-top: 5px;
  margin-bottom: 15px;
}

.content-article h2, .exercise h2{
    margin-top: 20px;
    margin-bottom: 10px;
}

.content-article h3, .exercise h3{
    margin-top: 20px;
    margin-bottom: 2px;
}

.content-article h1 {
  /* 1.6 rem (≈ 25 px) Minimum, 
     zw. 3 vw und 4 vw dynamisch, 
     max. 3.2 rem (≈ 51 px) */
  font-size: clamp(1.6rem, 4vw + 0.5rem, 2.2rem);
  line-height: 1.2;
}

.content-article h1 { overflow-wrap: break-word; } /* Fallback älterer Browser */

.content-article .center {
  margin-top: 20px;
  margin-bottom: 20px;
  text-align: center;
}

nav.back-to-overview {
  margin-top: 5px;
  margin-bottom: 5px;
  padding-top: 10px;
  padding-bottom: 10px;
  text-align: center;
}

.exercise > ol > li {
    margin-top: 20px
}

.exercise > ol > li > ol {
    margin-top: 10px;
    padding-left: 20px;
    background-color: rgba(20,100,200,0.2);
    border-radius: 5px;
}

.exercise > ol > li > ol li{
    padding: 10px;
    margin-left: 10px;
}


/* Sidebar */
.sidebar a{
  text-decoration: none;
  color: inherit;
  /* border: 1px solid blue; */
  display: flex;
  flex-direction: row;
  justify-content:left;
  align-items: center;
  gap: 0.5rem;
}

.sidebar img{
  /* border: 1px solid red; */
  width: 11%;
}

/* a:focus-visible, button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; } */

.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background-color: #183c64;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 1000;
}

.sidebar.open {
  left: 0;
}

.sidebar .close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #ecf0f1;
  cursor: pointer;
  display: block;
  margin-left: auto;
}

.sidebar ul {
  list-style: none;
  margin-top: 1rem;
  background-color: transparent;
}

.sidebar ul li {
  margin-bottom: 1rem;
  background-color: transparent;
}

.sidebar ul li a,
.sidebar ul li span {
  color: #ecf0f1;
  font-size: 1rem;
  /* display: block; */
  padding: 0.3rem 0;
  transition: color 0.2s;
}

.sidebar ul li a:hover,
.sidebar ul li span:hover {
  color: #3ed9c0;
}

/* --- Sidebar: ein-/ausklappbare Submenüs -------------------- */
.sidebar .submenu {
  display: none;          /* war vorher immer sichtbar */
  list-style: none;
  margin-top: 0.3rem;
  margin-left: 1rem;
}

.sidebar .submenu li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}


.sidebar li.open > .submenu {   /* li erhält Klasse „open“ via JS */
  display: block;
}

/* Pfeil rechts (▸) bei zugeklapptem Menü  */
.sidebar li.has-submenu > a::after {
  content: '\25B6';          /* Unicode ▸ */
  margin-left: .3rem;
  font-size: .8em;
  transition: transform .2s;
}

/* Pfeil nach unten (▾) bei aufgeklapptem Menü  */
.sidebar li.open.has-submenu > a::after {
  content: '\25BC';          /* Unicode ▾ */
}


/* Language Switch */
.lang-switch {
  display: flex;
  justify-content: space-around;
}

.lang-switch button {
  background: #ecf0f1;
  border: none;
  margin: 0.4rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: bold;
  border-radius: 4px;
  transition: background 0.2s;
}

.lang-switch button:hover {
  background: #bdc3c7;
}


/* Udo Rehle Mathematik Label */
#label-img {
  width: 100%;
}

/*👉#navbar-placeholder {
  position: fixed;
  top: 0;
  left: 0px;
  width: 260px;
  height: 100%;
  background-color: #2c3e50;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 1000;
}
👈*/
/*👉#navbar-placeholder.is-loading {
  visibility: hidden;
  ➡ Platz ist da, Inhalt erst nach Fetch ⬅
}👈*/

.topbar {
  top: 0px;
  width: 100%;
  height: 70px;
  /* background-color: rgba(255, 255, 255, 0.2); */
  /* color: #ecf0f1; */
  background: url("/png/banner2.png") center/cover no-repeat;
  box-shadow:
    0 6px 18px rgba(0,0,0,.10); /*  weiche, breite Schattenfahne*/
    /* 0 1px 0 rgba(0,0,0,.06);     hauchdünne Trennlinie */
  display: flex;
  position: fixed;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
  z-index: 999;
}

.topbar>* {
  padding: 10px;
}


/* Menu Button (Burger) */
.menu-btn {
  /* position: fixed; */
  /* top: 1rem; */
  /* left: 1rem; */
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 999;
  color: #434545;
}


.site-notice{
  margin-top: 30px;
  margin-bottom: 30px;
  color:#3c4c5c;
}


/* ===== CHANGED: Teaser-Grid & Cards ===== */
.teasers { /* NEU */
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(12px, 2vw, 20px);
}

.teaser-card { /* NEU */
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}

.teaser-card:hover, .teaser-card:focus-within { /* NEU */
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.teaser-card > img { /* NEU */
  display: block;
  width: 100%;
  height: auto;
}

.teaser-body { /* NEU */
  padding: 0.9rem 1rem 1.1rem;
}

.teaser-body h3 { /* NEU */
  margin: 0 0 .35rem 0;
  font-size: 1.15rem;
}

.teaser-body p { /* NEU */
  font-size: 0.98rem;
  color: #4a4f57;
  margin-bottom: .8rem;
}

a.cta { /* NEU */
  align-self: start;
  display: inline-block;
  text-decoration: none;
  background: #183c64;
  color: #ecf0f1;
  padding: .5rem .8rem;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1;
  transition: background .15s ease, transform .05s ease;
}

a.cta:hover { /* NEU */
  background: #1f4a7c;
}

a.cta:active { /* NEU */
  transform: translateY(1px);
}

/* ===== END CHANGED ===== */


/* Responsive Layout */
/* ab Tablet-Größe: Sidebar immer sichtbar, kein Burger-Button */
@media (min-width: 768px) {
  .sidebar {
    left: 0;
  }

  .menu-btn {
    display: none;
  }

  #close-btn{
    display: none;
  }

  main {
    width: calc(100% - 260px);
    margin-left: 260px;
  }

  .topbar {
    width: calc(100% - 260px);
    margin-left: 260px;
  
  }
}