/* ============================================================
   JAKOB-IHRLER-SCHULE — theme.css
   MSTUDiO 2026 · Contao 5 · Modern CSS · Mobile-first
   ============================================================ */

/* ── 1. FONTS ──────────────────────────────────────────────── */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/nunito/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/nunito/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'FontAwesome';
  src: url('../font-awesome-4.4.0/fonts/fontawesome-webfont.woff2') format('woff2'),
       url('../font-awesome-4.4.0/fonts/fontawesome-webfont.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: block;
}


/* ── 1b. FONT AWESOME CLASSES (nur verwendete Icons) ───────── */

.fa {
  font-family: var(--font-icon);
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
}
.fa-search::before { content: '\f002'; }
.fa-bars::before   { content: '\f0c9'; }


/* ── 2. DESIGN TOKENS ──────────────────────────────────────── */

:root {
  /* Brand */
  --primary:        #006ab2;
  --primary-dark:   #114877;
  --secondary:      #edb52e;
  --headline-color: #001A33;
  --primary-red:    #c00;

  /* Neutrals */
  --white:    #fff;
  --light:    #f8f9fa;
  --body-color: #212529;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;

  /* Typography */
  --font-body:     system-ui, -apple-system, sans-serif;
  --font-headline: 'Nunito', Helvetica, Arial, sans-serif;
  --font-icon:     FontAwesome;
  --size-base:     1rem;
  --line-height:   1.6;

  /* Layout */
  --container:     1280px;
  --header-h:      60px;
  --radius:        0.375rem;
  --shadow:        0 0.5rem 1rem rgba(0, 0, 0, .1);
  --transition:    0.2s ease;
}


/* ── 3. RESET ──────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote {
  margin: 0;
}

img, video { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }


/* ── 4. BASE ───────────────────────────────────────────────── */

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: var(--line-height);
  color: var(--body-color);
  background: var(--light);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  color: var(--headline-color);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: 2rem;
}
h1::after {
  content: "";
  display: block;
  width: 100px;
  height: 3px;
  background: var(--primary);
  margin: 0.75rem auto 0;
}
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); margin: 1rem 0 0.5rem; }
h3 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }
h2 + p { margin-bottom: 2rem; }

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

#main a:not(.more):not(h2 a):not(.btn):not(.button):not(.download-element a):not(.btn a) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition), text-decoration-thickness var(--transition);
}
#main a:not(.more):not(h2 a):not(.btn):not(.button):not(.download-element a):hover {
  text-decoration-color: var(--primary-dark);
  text-decoration-thickness: 2px;
}
#main h2 a,
#main .more,
#main .btn,
#main .button { text-decoration: none; }

a[target="_blank"]:not(:has(> img))::after {
  font-family: var(--font-icon);
  content: '\f08e';
  display: inline-block;
  font-size: 0.75em;
  margin-left: 0.3em;
  vertical-align: 0.1em;
  opacity: 0.6;
}

a[href^="mailto:"]::before {
  font-family: var(--font-icon);
  content: '\f0e0';
  display: inline-block;
  width: 1.25em;
  text-align: center;
  margin-right: 0.4em;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
th, td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
  text-align: left;
}
th { font-weight: 600; background: var(--gray-200); }
tbody tr:nth-child(odd) td { background: var(--light); }
@media (max-width: 640px) {
  table { display: block; overflow-x: auto; }
}

/* Tabellen im Fließtext / content-table — cleaner, kompakter */
.content-table {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.rte table,
.content-table table {
  font-size: 0.9rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.content-table table {
  border: none;
  border-radius: 0;
  overflow: visible;
  min-width: 100%;
}
.rte th, .rte td,
.content-table th, .content-table td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--gray-200);
}
.rte tr:last-child td,
.content-table tr:last-child td { border-bottom: 0; }
.rte tbody tr:nth-child(odd) td,
.content-table tbody tr:nth-child(odd) td { background: var(--light); }
.rte td:first-child,
.content-table td:first-child { color: var(--gray-700); font-weight: 500; }
.rte th,
.content-table th { background: var(--primary); color: var(--white); border-bottom: 0; }
.content-table th[scope="row"] {
  background: none;
  color: var(--gray-700);
  font-weight: 500;
  white-space: nowrap;
  width: 1%;
}
@media (max-width: 640px) {
  .content-table th[scope="row"] { white-space: normal; width: auto; }
}

.content-table h2 { margin-bottom: 0.75rem; }


/* Blockquote */
blockquote {
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem 1.25rem 3rem;
  border-left: 4px solid var(--secondary);
  background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem;
  color: var(--gray-700);
}
blockquote::before {
  font-family: var(--font-icon);
  content: '\f10d';
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 1.5rem;
  color: var(--secondary);
  opacity: 0.4;
  line-height: 1;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--gray-500);
}
blockquote cite::before { content: '— '; }

/* em */
.rte em, .content-text em, .content-image em {
  font-style: italic;
  color: var(--primary-dark);
  background: var(--white);
  padding: 0.05em 0.3em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Code */
pre, code {
  background: #f4f4f4;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
pre { padding: 1rem; overflow-x: auto; }
code { padding: 0.1em 0.3em; }


/* ── 5. LAYOUT ─────────────────────────────────────────────── */

.inside,
#container,
header .inside,
footer .inside {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 768px) {
  .inside,
  #container,
  header .inside,
  footer .inside { padding-inline: 2rem; }
}

#hero .inside {
  max-width: 100%;
  padding-inline: 0;
}

/* Header */
header#header {
  background: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
header .inside {
  display: flex;
  align-items: center;
  height: var(--header-h);
}
header a { color: var(--white); }
header a:hover { color: var(--gray-300); }

/* Logo — flex-shrink:0 prevents it from squishing */
.logo { flex-shrink: 0; }
.logo img { display: block; max-height: 44px; width: auto; }

/* Sticky footer: body → #wrapper → #container → #main */
#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#container { flex: 1; }

/* Main */
#main {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

#article {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* Footer */
footer#footer {
  background: var(--gray-800);
  color: var(--gray-500);
  padding: 1.5rem 0;
  border-top: 3px solid var(--primary);
}
footer .inside {
  display: flex;
  justify-content: center;
  align-items: center;
}
footer p {
  margin-bottom: 0;
  font-size: 0.85rem;
  text-align: center;
}
footer a {
  color: var(--gray-300);
  text-underline-offset: 3px;
}
footer a:hover { color: var(--white); text-decoration: underline; }


/* ── 6. NAVIGATION ─────────────────────────────────────────── */

/* Mobile: ausblenden */
.nav-main { display: none; }

@media (min-width: 992px) {
  /* Nav fills the remaining header space */
  .nav-main {
    display: flex;
    align-items: center;
    flex: 1;
  }

  /* Push level_1 to the right so logo gets open space on the left */
  .nav-main > ul.level_1 { margin-left: auto; }

  .nav-main ul {
    display: flex;
    list-style: none;
    margin: 0; padding: 0;
    gap: 0;
  }

  /* Level 1 */
  .nav-main .level_1 > li { position: relative; }

  .nav-main .level_1 > li > a,
  .nav-main .level_1 > li > strong {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 1rem;
    height: var(--header-h);
    color: var(--white);
    font-weight: 400;
    white-space: nowrap;
    transition: background var(--transition);
  }
  .nav-main .level_1 > li > a:hover,
  .nav-main .level_1 > li > a.trail,
  .nav-main .level_1 > li > strong.active,
  .nav-main .level_1 > li > strong.forward {
    background: var(--secondary);
    color: var(--primary-dark);
  }

  /* Icons */
  .nav-main .level_1 > li > a::before,
  .nav-main .level_1 > li > strong::before {
    font-family: var(--font-icon);
    font-size: 0.85em;
  }
  .nav-main .level_1 > li.home    > a::before,
  .nav-main .level_1 > li.home    > strong::before { content: '\f015'; }
  .nav-main .level_1 > li.schule  > a::before,
  .nav-main .level_1 > li.schule  > strong::before { content: '\f19d'; }
  .nav-main .level_1 > li.termine > a::before,
  .nav-main .level_1 > li.termine > strong::before { content: '\f073'; }
  .nav-main .level_1 > li.service > a::before,
  .nav-main .level_1 > li.service > strong::before { content: '\f1cd'; }
  .nav-main .level_1 > li.kontakt > a::before,
  .nav-main .level_1 > li.kontakt > strong::before { content: '\f0e0'; }

  /* Dropdown caret */
  .nav-main .submenu > a::after,
  .nav-main .submenu > strong::after {
    content: "";
    display: inline-block;
    margin-left: 4px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    vertical-align: middle;
  }

  /* Level 2 */
  .nav-main .level_2 {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
    border: 1px solid var(--gray-200);
    padding: 0.5rem 0;
    z-index: 100;
  }
  .nav-main .level_2 > li > a,
  .nav-main .level_2 > li > strong {
    display: block;
    padding: 0.5rem 1.25rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    white-space: nowrap;
  }
  .nav-main .level_2 > li > a:hover { background: var(--gray-200); color: var(--body-color); }
  .nav-main .level_2 > li > strong.active { font-weight: 700; color: var(--primary); }

  .nav-main .submenu:hover > .level_2,
  .nav-main .active.submenu > .level_2 { display: block; }
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--white);
  cursor: pointer;
}
.nav-toggle::before {
  font-family: var(--font-icon);
  content: '\f0c9';
  font-size: 1.25rem;
}
@media (min-width: 992px) { .nav-toggle { display: none; } }

/* Mobile Menu — nav-main reused as full-screen overlay on small screens */
@media (max-width: 991px) {
  .nav-main.is-open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--gray-800);
    overflow-y: auto;
    z-index: 999;
    padding: 1rem;
  }
  .nav-main.is-open ul { list-style: none; padding: 0; margin: 0; }
  .nav-main.is-open a,
  .nav-main.is-open strong {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-main.is-open strong { font-weight: 700; color: var(--secondary); }
  .nav-main.is-open .level_2 a { padding-left: 2rem; font-size: 0.9rem; color: var(--gray-300); }
}


/* ── 7. SEARCH ─────────────────────────────────────────────── */

.search_box { flex-shrink: 0; margin-left: 1rem; }
.search_box .formbody {
  display: flex;
  align-items: stretch;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
/* Span-Wrapper um den Button flush machen */
.search_box .formbody > span {
  display: flex;
}

/* #header prefix beats the general input specificity (0,2,1) */
#header .search_box input {
  display: block;
  width: auto;
  max-width: 140px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius) 0 0 var(--radius);
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15);
  color: var(--white);
  box-shadow: none;
}
#header .search_box input::placeholder { color: rgba(255,255,255,.6); }
#header .search_box input:focus {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.7);
  outline: none;
  box-shadow: none;
}
#header .search_box input:focus-visible {
  outline: 3px dashed #fff;
  outline-offset: 3px;
}
.search_box button {
  padding: 0 0.6rem;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
}
.search_box button:hover { background: rgba(255,255,255,.35); }


/* ── 8. HERO / SLIDER ──────────────────────────────────────── */

.home #main { padding-top: 0; }

.ce_sliderStart { position: relative; overflow: hidden; }
.ce_sliderStart img,
.content-slider img { width: 100%; aspect-ratio: 16/5; object-fit: cover; display: block; }

/* swipe.min.css setzt height:30px + position:relative — beides überschreiben */
.slider-control { display: none; height: auto; }
@media (min-width: 768px) {
  .slider-control {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: auto;        /* height:30px aus swipe.css aufheben */
    aspect-ratio: 16/5;
    z-index: 10;
    pointer-events: none;
  }
}

/* Höhere Spezifität als swipe.css (.slider-control a / .slider-control .slider-menu) */
.ce_sliderStart .slider-control .slider-prev,
.ce_sliderStart .slider-control .slider-next {
  position: absolute;
  top: 50%;
  left: auto; right: auto;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  background: rgba(0,0,0,.4);
  border-radius: 50%;
  overflow: hidden;
  text-indent: -999em;
  pointer-events: all;
  transition: background var(--transition);
}
.ce_sliderStart .slider-control .slider-prev { left: 1rem; }
.ce_sliderStart .slider-control .slider-next { right: 1rem; }
.ce_sliderStart .slider-control .slider-prev::before,
.ce_sliderStart .slider-control .slider-next::before {
  font-family: var(--font-icon);
  font-size: 0.9rem;
  line-height: 1;
  color: var(--white);
  text-indent: 0;
}
.ce_sliderStart .slider-control .slider-prev::before { content: '\f053'; }
.ce_sliderStart .slider-control .slider-next::before { content: '\f054'; }
.ce_sliderStart .slider-control .slider-prev:hover,
.ce_sliderStart .slider-control .slider-next:hover { background: rgba(0,0,0,.65); }

/* Bullets: top:auto + width:auto + margin-left:0 überschreiben swipe.css */
.ce_sliderStart .slider-control .slider-menu {
  position: absolute;
  top: auto;
  bottom: 1rem;
  left: 0; right: 0;
  width: auto;
  margin-left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  font-size: 0;
  pointer-events: all;
}
.ce_sliderStart .slider-control .slider-menu b {
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  font-size: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.ce_sliderStart .slider-control .slider-menu b.active {
  background: var(--secondary);
  transform: scale(1.3);
}


/* content-swiper (Swiper.js) */
.content-swiper {
  position: relative;
  overflow: hidden;
}
.content-swiper figure {
  width: 100%;
  margin: 0;
}
.content-swiper figure img {
  width: 100%;
  aspect-ratio: 16/5;
  object-fit: cover;
  display: block;
}

/* H1 als Overlay über dem Slider */
.content-swiper > h1 {
  position: absolute;
  bottom: 16%;
  left: 1.25rem;
  z-index: 10;
  margin: 0;
  padding: 0.5rem 1.25rem;
  max-width: min(28rem, calc(100% - 2.5rem));
  background: rgba(255,255,255,.82);
  color: var(--primary-dark);
  border-radius: var(--radius);
  text-align: left;
  line-height: 1.25;
  pointer-events: none;
}
@media (min-width: 768px) {
  .content-swiper > h1 {
    left: max(2rem, calc((100% - var(--container)) / 2 + 2rem));
  }
}
.content-swiper > h1::after { display: none; }

/* Navigations-Pfeile */
.content-swiper .swiper-button-prev,
.content-swiper .swiper-button-next {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0,0,0,.4);
  border-radius: 50%;
  color: var(--white);
  transition: background var(--transition);
}
.content-swiper .swiper-button-prev::after,
.content-swiper .swiper-button-next::after { display: none; }
.content-swiper .swiper-button-prev:hover,
.content-swiper .swiper-button-next:hover { background: rgba(0,0,0,.65); }
.content-swiper .swiper-navigation-icon { width: 0.55rem; height: auto; }

/* Pagination Bullets */
.content-swiper .swiper-pagination-bullet {
  background: rgba(255,255,255,.55);
  opacity: 1;
  transition: background var(--transition), transform var(--transition);
}
.content-swiper .swiper-pagination-bullet-active {
  background: var(--secondary);
  transform: scale(1.3);
}

/* ── 9. NEWSTICKER ─────────────────────────────────────────── */

.marquee.mod_newsticker {
  background: var(--primary-dark);
  max-width: var(--container);
  margin-inline: auto;
}
.js-marquee {
  padding: 0.5rem 0;
  font-size: 1rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ── 10. BUTTONS ───────────────────────────────────────────── */
/*
  Varianten (auf <a> oder <div> mit <a> darin):
    .btn              — outlined, Primary-Farbe
    .btn.btn-primary  — gefüllt, weiße Schrift
    .btn.btn-secondary— gefüllt, Secondary (Gold)
*/

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  background: transparent;
  font-size: var(--size-base);
  line-height: 1.5;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn::after {
  font-family: var(--font-icon);
  content: '\f101';
  flex-shrink: 0;
}
.btn:hover {
  background: var(--primary);
  color: var(--white);
}
/* Link innerhalb eines div.btn */
.btn a {
  color: inherit;
  text-decoration: none;
  flex: 1;
}
.btn.center {
  display: flex;
  width: fit-content;
  margin-inline: auto;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
}
.btn-secondary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary-dark);
}
.btn-secondary:hover {
  background: color-mix(in srgb, var(--secondary) 85%, black);
  border-color: color-mix(in srgb, var(--secondary) 85%, black);
  color: var(--primary-dark);
}


/* ── 11. FORMS ─────────────────────────────────────────────── */

label, legend { display: block; margin-bottom: 0.3rem; font-size: 0.95rem; }
fieldset { border: 0; padding: 0; }

input:not([type=checkbox]):not([type=radio]),
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  font-size: var(--size-base);
  line-height: 1.5;
  color: var(--body-color);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,106,178,.2);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px dashed var(--primary-red, #c00);
  outline-offset: 3px;
}
textarea { min-height: 7rem; resize: vertical; }

.widget { margin-bottom: 1rem; }
span.mandatory { color: #dc3545; }

.formbody {
  background: var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
}

input[type=checkbox],
input[type=radio] { display: inline; width: auto; }

.checkbox_container span { display: flex; align-items: center; gap: 0.5rem; }

.ce_form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ce_form > h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  margin: 0;
  padding: 0.75rem 1.25rem;
}
.ce_form > h2::before {
  font-family: var(--font-icon);
  content: '\f0e0';
  margin-right: 0.5rem;
  opacity: 0.8;
}
.ce_form .formbody {
  background: none;
  padding: 1.5rem 1.25rem;
}
.ce_form label,
.ce_form .checkbox_container legend {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-700);
  letter-spacing: 0.01em;
}
.ce_form input:not([type=checkbox]):not([type=radio]),
.ce_form textarea,
.ce_form select {
  background: var(--white);
  border-color: var(--gray-600);
  padding: 0.6rem 0.85rem;
}
.ce_form .widget-explanation {
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.5rem 0.75rem;
}
.ce_form .widget-explanation p {
  font-size: 0.85rem;
  color: var(--gray-700);
  margin: 0;
}
.ce_form .widget-explanation p::before {
  font-family: var(--font-icon);
  content: '\f05a';
  margin-right: 0.35em;
  color: var(--primary);
}
.ce_form .widget-checkbox {
  border: 1px solid var(--gray-300);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  background: var(--white);
}
.ce_form .widget-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  margin-bottom: 0;
}
.ce_form .widget-submit .submit {
  padding: 0.5rem 2rem;
  background: var(--primary);
  color: var(--white);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: var(--size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.ce_form .widget-submit .submit::after {
  font-family: var(--font-icon);
  content: '\f1d8';
  margin-left: 0.5em;
}
.ce_form .widget-submit .submit:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* ── 12. CONTENT ELEMENTS ──────────────────────────────────── */

/* .information — Card-Stil für Kontakt-/Info-Blöcke */
.information {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.information h2 {
  font-size: 1rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.information h2::before {
  font-family: var(--font-icon);
  content: '\f05a';
  margin-right: 0.5rem;
  color: var(--primary);
  font-size: 1.1em;
}

/* content-element-group Grid — Klasse an der Gruppe im Backend setzen */
.content-element-group { margin-bottom: 2rem; }

.content-element-group.cols-2   { display: grid; grid-template-columns: 1fr 1fr;      gap: 2rem; }
.content-element-group.cols-3   { display: grid; grid-template-columns: 1fr 1fr 1fr;  gap: 2rem; }
.content-element-group.cols-1-2 { display: grid; grid-template-columns: 1fr 2fr;      gap: 2rem; }
.content-element-group.cols-2-1 { display: grid; grid-template-columns: 2fr 1fr;      gap: 2rem; }

@media (max-width: 767px) {
  .content-element-group.cols-2,
  .content-element-group.cols-3,
  .content-element-group.cols-1-2,
  .content-element-group.cols-2-1 { grid-template-columns: 1fr; }
}

/* Text — both old (ce_text block) and new (content-text) */
.ce_text,
.content-text { margin-bottom: 2rem; }

/* .contact / .information — Card mit abgetrennter Überschrift */
.contact.content-text,
.information.content-text {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0;
}
.contact.content-text h2,
.information.content-text h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--white);
  background: var(--primary);
  margin: 0;
  padding: 0.5rem 1rem;
}
.contact.content-text h2::before {
  font-family: var(--font-icon);
  content: '\f095';
  margin-right: 0.5rem;
  opacity: 0.8;
}
.information.content-text h2::before {
  font-family: var(--font-icon);
  content: '\f05a';
  margin-right: 0.5rem;
  color: var(--white);
  opacity: 0.8;
}
.contact.content-text .rte,
.information.content-text .rte {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}
.contact.content-text .rte p,
.information.content-text .rte p { margin-bottom: 0.5rem; }
.contact.content-text .rte p:last-child,
.information.content-text .rte p:last-child { margin-bottom: 0; }

/* RTE (rich text) */
.rte p:last-child,
.teaser p:last-child { margin-bottom: 0; }
.rte ul, .rte ol { margin-bottom: 1rem; }
.rte li { margin-bottom: 0.25rem; }

/* ul — farbige Icons statt Standard-Bullets */
.rte ul {
  list-style: none;
  padding-left: 0.25rem;
}
.rte ul > li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.rte ul > li::before {
  font-family: var(--font-icon);
  content: '\f111';
  flex-shrink: 0;
  font-size: 0.45em;
  color: var(--primary);
  margin-top: 0.55em;
}

/* Unterliste — Ring */
.rte ul ul {
  margin-top: 0.25rem;
  margin-bottom: 0;
  padding-left: 1rem;
}
.rte ul ul > li::before {
  content: '\f10c';
  color: var(--gray-500);
}

/* Bilder — old: image_container float_*, new: figure inside media--* parent */
.image_container { margin-bottom: 1rem; }

.image_container.float_left,
.media--left figure {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 0.5rem;
}
.image_container.float_right,
.media--right figure {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}
.image_container.float_above,
.media--above figure { margin-bottom: 1rem; }

/* Clear floats inside media wrappers */
.media::after { content: ""; display: table; clear: both; }

@media (max-width: 640px) {
  .image_container.float_left,
  .image_container.float_right,
  .media--left figure,
  .media--right figure { float: none; margin-inline: 0; }
}

/* Figure / Figcaption */
figure { margin: 0 0 1rem; width: fit-content; max-width: 100%; }

figure a { display: block; overflow: hidden; }
figure a img { transition: transform 0.3s ease; }
figure a:hover img { transform: scale(1.04); }

/* Bildlink-Badge: dauerhaft sichtbar, unterscheidet von Lightbox */
.content-image figure a:not(.cboxElement):not([data-lightbox]),
.content-text  figure a:not(.cboxElement):not([data-lightbox]),
.content-hyperlink figure a:not(.cboxElement):not([data-lightbox]) {
  position: relative;
}
.content-image figure a:not(.cboxElement):not([data-lightbox])::before,
.content-text  figure a:not(.cboxElement):not([data-lightbox])::before,
.content-hyperlink figure a:not(.cboxElement):not([data-lightbox])::before {
  font-family: var(--font-icon);
  content: '\f0c1';
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 1.75rem; height: 1.75rem;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  line-height: 1.75rem;
  text-align: center;
  font-size: 0.75rem;
  z-index: 2;
  pointer-events: none;
  transition: background var(--transition);
}
.content-image figure a[target="_blank"]:not(.cboxElement)::before,
.content-text  figure a[target="_blank"]:not(.cboxElement)::before,
.content-hyperlink figure a[target="_blank"]:not(.cboxElement)::before {
  content: '\f08e';
}
.content-image figure a:not(.cboxElement):not([data-lightbox]):hover::before,
.content-text  figure a:not(.cboxElement):not([data-lightbox]):hover::before,
.content-hyperlink figure a:not(.cboxElement):not([data-lightbox]):hover::before {
  background: rgba(0, 0, 0, 0.75);
}

figure a[target="_blank"][title]::after {
  content: attr(title);
  display: block;
  overflow: visible;
  font-size: 0.8rem;
  color: var(--gray-600);
  background: var(--gray-200);
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

figcaption,
.caption {
  font-size: 0.9rem;
  color: var(--gray-600);
  background: var(--gray-200);
  padding: 0.5rem 0.75rem;
}

/* Galerie — old: ce_gallery, new: content-gallery */
.ce_gallery > ul,
.content-gallery > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ce_gallery figure,
.content-gallery figure { margin: 0; }
.ce_gallery img,
.content-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); }
/* cols-N modifier from new Twig template */
.content-gallery--cols-3 > ul { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.content-gallery--cols-2 > ul { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Accordion — old: ce_accordionStart/ce_accordion, new: content-accordion (handorgel) */
.ce_accordion,
.ce_accordionStart { background: var(--white); margin-bottom: 0.5rem; }

/* Accordion (handorgel) */
.content-accordion { margin-bottom: 0.25rem; }
.handorgel__header__button {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--gray-200);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: var(--size-base);
  font-family: var(--font-body);
  text-align: left;
  transition: background var(--transition);
}
.handorgel__header__button::before {
  font-family: var(--font-icon);
  content: '\f0a9';
  color: var(--primary);
  font-size: 1.1em;
  flex-shrink: 0;
}
.handorgel__header--open .handorgel__header__button,
.handorgel__header__button:hover { background: var(--gray-300); }
.handorgel__header--open .handorgel__header__button::before { content: '\f0ab'; }
.handorgel__content__inner { padding: 1rem; }

/* Downloads */
.content-downloads ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.content-downloads .download-element a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  color: var(--body-color);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.content-downloads .download-element a:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: var(--primary);
}
.content-downloads .download-element a::before {
  font-family: var(--font-icon);
  font-size: 1.4rem;
  flex-shrink: 0;
  color: var(--gray-500);
  content: '\f15b';
}
.content-downloads .download-element.ext-pdf a::before { content: '\f1c1'; color: #e74c3c; }
.content-downloads .download-element.ext-doc a::before,
.content-downloads .download-element.ext-docx a::before { content: '\f1c2'; color: #2b7cd3; }
.content-downloads .download-element.ext-xls a::before,
.content-downloads .download-element.ext-xlsx a::before { content: '\f1c3'; color: #1d7044; }
.content-downloads .download-element a::after {
  font-family: var(--font-icon);
  content: '\f019';
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--gray-500);
  flex-shrink: 0;
}

/* Hyperlink */
.content-hyperlink { margin-bottom: 1rem; }

/* Lead / Intro */
.lead p { font-size: 1.25rem; line-height: 1.7; color: var(--gray-700); }

/* Columns / Cards */
.ce_column { margin-bottom: 1rem; }
.ce_column > .ce_text,
.ce_column > .content-text {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
}
.ce_column > .ce_text > h3,
.ce_column > .content-text > h3 {
  padding: 0.75rem 1rem;
  margin: 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 1.05rem;
}
.ce_column > .ce_text > p,
.ce_column > .content-text > p {
  padding: 1rem;
  margin: 0;
  flex: 1;
}

/* Section Heading Accent */
.content-headline h2::after,
.mod_eventlist > h2::after,
.mod_newslist > h2::after,
.mod_fullcalendar > h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  background: var(--secondary);
  margin-top: 0.4rem;
}


/* ── 13. NEWS MODULE ───────────────────────────────────────── */

.mod_newslist.row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.mod_newslist .layout_latest {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.mod_newslist .layout_latest:hover {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2rem rgba(0,0,0,.12);
}
.mod_newslist .layout_latest img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.mod_newslist .layout_latest .news-img-wrap { position: relative; }
.mod_newslist .layout_latest .date-badge {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  z-index: 1;
  pointer-events: none;
}
.mod_newslist .layout_latest h2 {
  font-size: 1.1rem;
  padding: 0.75rem 1rem 0;
  margin: 0;
  color: var(--primary);
}
.mod_newslist .layout_latest p { padding: 0.5rem 1rem; flex: 1; font-size: 0.9rem; }
.mod_newslist .layout_latest p.info {
  font-size: 0.8rem;
  color: var(--gray-600);
  padding: 0 1rem 0.75rem;
}
.mod_newslist .layout_latest p.info time::before {
  font-family: var(--font-icon);
  content: '\f1ea';
  margin-right: 4px;
}
.mod_newslist .layout_latest p.more { padding: 0.5rem 1rem 1rem; }

/* News Reader */
.mod_newsreader .layout_full { max-width: 800px; margin-inline: auto; }
.mod_newsreader h1 { text-align: left; }
.mod_newsreader h1::after { margin-left: 0; }


/* ── 14. EVENTS MODULE ─────────────────────────────────────── */

.mod_eventlist .header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
}
.mod_eventlist .header:first-of-type { margin-top: 0; }
.mod_eventlist .header::before {
  font-family: var(--font-icon);
  content: '\f073';
  color: var(--primary);
}
.mod_eventlist .header .day {
  color: var(--gray-600);
  font-weight: 400;
  font-size: 0.85rem;
}

.mod_eventlist .event,
.mod_eventlist .layout_upcoming {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.mod_eventlist .event h2,
.mod_eventlist .layout_upcoming h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}
.mod_eventlist .event h2 a,
.mod_eventlist .layout_upcoming h2 a {
  color: var(--body-color);
}
.mod_eventlist .event h2 a:hover,
.mod_eventlist .layout_upcoming h2 a:hover { color: var(--primary); }

.mod_eventlist p.time,
.mod_eventlist p.location {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin: 0;
}
.mod_eventlist p.location::before {
  font-family: var(--font-icon);
  content: '\f041';
  margin-right: 4px;
  color: var(--gray-500);
}
.mod_eventlist time::before {
  font-family: var(--font-icon);
  content: '\f017';
  margin-right: 4px;
  color: var(--gray-500);
}


/* ── 15. MINI CALENDAR ─────────────────────────────────────── */

table.minicalendar {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.minicalendar td,
table.minicalendar th {
  padding: 3px 4px;
  text-align: center;
  border: 1px solid var(--gray-300);
}
table.minicalendar td.days.active,
table.minicalendar .current { background: var(--primary); color: var(--white); }
table.minicalendar .today { background: var(--secondary); color: var(--white); }
table.minicalendar .weekend { background: var(--gray-200); }
table.minicalendar .label { background: var(--gray-500); color: var(--white); font-size: 0.75rem; }
table.minicalendar th.previous,
table.minicalendar th.next { background: var(--primary); color: var(--white); }
table.minicalendar th.previous a,
table.minicalendar th.next a { color: var(--white); }


/* ── 16. PAGINATION ────────────────────────────────────────── */

.pagination { padding: 1.5rem 0; }
.pagination ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 4px;
}
.pagination ul li a,
.pagination ul li strong {
  display: block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--white);
  line-height: 1.25;
}
.pagination ul li strong.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.pagination ul li a:hover { background: var(--gray-200); }


/* ── 17. SEARCH MODULE ─────────────────────────────────────── */

.mod_search .formbody {
  background: none;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.mod_search .widget-text { flex: 1; margin-bottom: 0; }
.mod_search .widget-submit { margin-bottom: 0; }
.mod_search .widget-submit .submit {
  padding: 0.6rem 1.25rem;
  background: var(--primary);
  color: var(--white);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: var(--size-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}
.mod_search .widget-submit .submit::after {
  font-family: var(--font-icon);
  content: '\f002';
  margin-left: 0.5em;
}
.mod_search .widget-submit .submit:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.mod_search p.header {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-300);
}

.search_default {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.search_default h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.search_default h3 a {
  color: var(--primary);
  text-decoration: none;
}
.search_default h3 a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.search_default p.context {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}
.search_default p.url {
  font-size: 0.8rem;
  color: var(--gray-500);
  word-break: break-all;
  margin-bottom: 0;
}
mark.highlight {
  background: color-mix(in srgb, var(--secondary) 30%, transparent);
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}

/* ── 17. MEMBER LIST ───────────────────────────────────────── */

.mod_memberlist table th { background: var(--primary); color: var(--white); }
.mod_memberlist table tr:hover td { background: var(--gray-200); }

span.phone::before {
  font-family: var(--font-icon);
  content: '\f098';
  display: inline-block;
  width: 1.25em;
  text-align: center;
  margin-right: 0.4em;
}
span.fax::before {
  font-family: var(--font-icon);
  content: '\f1ac';
  display: inline-block;
  width: 1.25em;
  text-align: center;
  margin-right: 0.4em;
}
address {
  font-style: normal;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
address::before {
  font-family: var(--font-icon);
  content: '\f041';
  flex-shrink: 0;
  width: 1.25em;
  text-align: center;
  margin-top: 0.1em;
}


/* ── 18. LOGIN ─────────────────────────────────────────────── */

.mod_login {
  max-width: 400px;
  margin-inline: auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}


/* ── 19. VERTRETUNGSPLAN ───────────────────────────────────── */

.mod_vertretungsplan table th { background: var(--primary); color: var(--white); }
.mod_vertretungsplan .datum { font-weight: 700; color: var(--primary-dark); }

/* ── 20. KLASSEN LIST ──────────────────────────────────────── */

.mod_klassenlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.mod_klassenlist .item { text-align: center; }
.mod_klassenlist img { border-radius: var(--radius); margin-inline: auto; }


/* ── 20. UTILITIES ─────────────────────────────────────────── */

.text-center { text-align: center; }

.invisible {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ce_image.block { display: block; }

[class^="mod_"]:not(.mod_article):not(.mod_navigation) { margin-bottom: 2rem; }
.mod_article { padding-block: 3rem; }
.mod_article.hero { padding-block: 0; }
#main .mod_article:last-child { padding-bottom: 4rem; }

/* ── Accessibility ───────────────────────────────────────────── */

/* Focus-Ring */
:focus-visible {
  outline: 3px dashed var(--primary-red, #c00);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Skip-Navigation */
a.invisible:focus,
a.invisible:focus-visible {
  position: fixed;
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  width: auto; height: auto;
  padding: .4rem 1rem;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  background: #c00;
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  outline: 3px dashed #fff;
  outline-offset: 2px;
  z-index: 9999;
}
