/**
 * mod_customgrid - Mobile-First Responsive CSS Grid
 * WCAG 2.1/2.2 AA compliant, zero external dependencies
 *
 * @copyright (C) 2026 Sven B. / Stadtwerke Prenzlau. All rights reserved.
 * @license   GNU General Public License version 2 or later
 */

/* ==========================================================================
   Container & Wrapper
   ========================================================================== */
.mod-customgrid {
  --mod-grid-template-cols: 1fr 1fr 1fr;
  --mod-grid-template-cols-xxl: var(--mod-grid-template-cols-xl, var(--mod-grid-template-cols));
  --mod-grid-template-cols-xl: var(--mod-grid-template-cols);
  --mod-grid-template-cols-lg: var(--mod-grid-template-cols);
  --mod-grid-template-cols-md: repeat(2, 1fr);
  --mod-grid-template-cols-sm: 1fr;
  --mod-grid-template-cols-xs: 1fr;
  --mod-grid-template-cols-tablet: var(--mod-grid-template-cols-md);
  --mod-col-min-width: auto;
  --mod-grid-gap: 1.5rem;
  --mod-grid-gap-mobile: 1.25rem;
  --mod-grid-padding: 2.5rem 1rem;
  --mod-grid-padding-mobile: 1.75rem 1rem;
  --mod-grid-max-width: 1320px;
  --mod-grid-min-height: auto;
  --mod-grid-title-weight: 300;
  --mod-grid-bg: transparent;
  --mod-grid-text-color: inherit;
  --mod-copyright-bg: transparent;
  --mod-copyright-text-color: inherit;
  --mod-copyright-padding: 1.25rem 0;

  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--mod-grid-min-height, auto);
  background-color: var(--mod-grid-bg);
  color: var(--mod-grid-text-color);
  padding: var(--mod-grid-padding);
}

/* ==========================================================================
   Mobile Display: Untereinander & Zentriert (Smartphones <= 767.98px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .mod-customgrid {
    padding: var(--mod-grid-padding-mobile, 2rem 1.25rem);
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__grid,
  .mod-customgrid--mobile-center .mod-customgrid__grid {
    grid-template-columns: 1fr !important;
    gap: var(--mod-grid-gap-mobile, 2rem);
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__column,
  .mod-customgrid--mobile-center .mod-customgrid__column {
    text-align: center;
    align-items: center;
    justify-content: flex-start;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__title,
  .mod-customgrid--mobile-center .mod-customgrid__title {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__media,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__media--column,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__media--row,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__media--grid2,
  .mod-customgrid--mobile-center .mod-customgrid__media,
  .mod-customgrid--mobile-center .mod-customgrid__media--column,
  .mod-customgrid--mobile-center .mod-customgrid__media--row,
  .mod-customgrid--mobile-center .mod-customgrid__media--grid2 {
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__media-item,
  .mod-customgrid--mobile-center .mod-customgrid__media-item {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__img,
  .mod-customgrid--mobile-center .mod-customgrid__img {
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__img-link,
  .mod-customgrid--mobile-center .mod-customgrid__img-link {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__body,
  .mod-customgrid--mobile-center .mod-customgrid__body {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__body p,
  .mod-customgrid--mobile-center .mod-customgrid__body p {
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__body ul,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__body ol,
  .mod-customgrid--mobile-center .mod-customgrid__body ul,
  .mod-customgrid--mobile-center .mod-customgrid__body ol {
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    list-style-position: inside;
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__body li,
  .mod-customgrid--mobile-center .mod-customgrid__body li {
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper ul,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper ol,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper .mod-menu,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper ul,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper ol,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper .mod-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-left: 0;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper li,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper li {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__module-wrapper a,
  .mod-customgrid--mobile-center .mod-customgrid__module-wrapper a {
    display: inline-block;
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__copyright-wrapper,
  .mod-customgrid:not(.mod-customgrid--mobile-left) .mod-customgrid__copyright,
  .mod-customgrid--mobile-center .mod-customgrid__copyright-wrapper,
  .mod-customgrid--mobile-center .mod-customgrid__copyright {
    text-align: center !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Tablet Display: Zentrierte Spalteninhalte (Tablets 768px bis 1199.98px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__column,
  .mod-customgrid--tablet-center .mod-customgrid__column {
    text-align: center;
    align-items: center;
    justify-content: flex-start;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__title,
  .mod-customgrid--tablet-center .mod-customgrid__title {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__media,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__media--column,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__media--row,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__media--grid2,
  .mod-customgrid--tablet-center .mod-customgrid__media,
  .mod-customgrid--tablet-center .mod-customgrid__media--column,
  .mod-customgrid--tablet-center .mod-customgrid__media--row,
  .mod-customgrid--tablet-center .mod-customgrid__media--grid2 {
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__media-item,
  .mod-customgrid--tablet-center .mod-customgrid__media-item {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__img,
  .mod-customgrid--tablet-center .mod-customgrid__img {
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__img-link,
  .mod-customgrid--tablet-center .mod-customgrid__img-link {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__body,
  .mod-customgrid--tablet-center .mod-customgrid__body {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__body p,
  .mod-customgrid--tablet-center .mod-customgrid__body p {
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__body ul,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__body ol,
  .mod-customgrid--tablet-center .mod-customgrid__body ul,
  .mod-customgrid--tablet-center .mod-customgrid__body ol {
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    list-style-position: inside;
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__body li,
  .mod-customgrid--tablet-center .mod-customgrid__body li {
    text-align: center;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper {
    text-align: center;
    width: 100%;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper ul,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper ol,
  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper .mod-menu,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper ul,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper ol,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper .mod-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-left: 0;
    margin-left: auto;
    margin-right: auto;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper li,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper li {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mod-customgrid:not(.mod-customgrid--tablet-left) .mod-customgrid__module-wrapper a,
  .mod-customgrid--tablet-center .mod-customgrid__module-wrapper a {
    display: inline-block;
    text-align: center;
  }
}

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

.mod-customgrid__inner {
  width: 100%;
  max-width: var(--mod-grid-max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Responsive Grid System (Mobile-First mit feinen Endgeräte-Breakpoints)
   ========================================================================== */
.mod-customgrid__grid {
  display: grid;
  grid-template-columns: var(--mod-grid-template-cols-xs, 1fr);
  gap: var(--mod-grid-gap-mobile, var(--mod-grid-gap, 1.25rem));
  width: 100%;
  align-items: stretch;
}

/* SM: Smartphone Querformat / Phablets (>= 576px) */
@media (min-width: 576px) {
  .mod-customgrid__grid {
    grid-template-columns: var(--mod-grid-template-cols-sm, var(--mod-grid-template-cols-xs, 1fr));
    gap: var(--mod-grid-gap);
  }
}

/* MD: Tablets Hochformat (>= 768px) */
@media (min-width: 768px) {
  .mod-customgrid__grid {
    grid-template-columns: var(--mod-grid-template-cols-md, var(--mod-grid-template-cols-tablet, repeat(2, 1fr)));
  }
}

/* LG: Tablets Querformat / Laptops & kleine Monitore (>= 992px)
   Verhindert das unschöne Einquetschen von z. B. 5 Spalten auf 992px */
@media (min-width: 992px) {
  .mod-customgrid__grid {
    grid-template-columns: var(--mod-grid-template-cols-lg, var(--mod-grid-template-cols));
  }
}

/* XL: Standard Desktop & Widescreen (>= 1200px) */
@media (min-width: 1200px) {
  .mod-customgrid__grid {
    grid-template-columns: var(--mod-grid-template-cols-xl, var(--mod-grid-template-cols));
  }
}

/* XXL: Große Monitore (>= 1400px) */
@media (min-width: 1400px) {
  .mod-customgrid__grid {
    grid-template-columns: var(--mod-grid-template-cols-xxl, var(--mod-grid-template-cols-xl, var(--mod-grid-template-cols)));
  }
}

/* ==========================================================================
   Ausgleich der letzten Spalte (Last-Column Balancing)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
  .mod-customgrid--balance-last .mod-customgrid__column:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
  }

  .mod-customgrid--balance-last .mod-customgrid__column:last-child:nth-child(odd) .mod-customgrid__media {
    align-items: center;
    justify-content: center;
  }
}

/* ==========================================================================
   Grid Columns
   ========================================================================== */
.mod-customgrid__column {
  --col-bg: transparent;
  --col-text-color: inherit;
  --col-padding: 0;
  --col-border-radius: 0;
  --col-min-height: auto;
  --col-img-height: auto;
  --col-img-gap: 0.85rem;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0; /* Verhindert Layout-Sprengung bei langen Texten */
  min-height: var(--col-min-height, auto);
  background-color: var(--col-bg);
  color: var(--col-text-color);
  padding: var(--col-padding);
  border-radius: var(--col-border-radius);
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}

/* ==========================================================================
   Media & Images / Logo Gallery (WCAG accessible)
   ========================================================================== */
.mod-customgrid__media {
  display: flex;
  flex-direction: column;
  gap: var(--col-img-gap, 0.85rem);
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.mod-customgrid__media--column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--col-img-gap, 0.85rem);
}

.mod-customgrid__media--row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--col-img-gap, 0.85rem);
}

.mod-customgrid__media--grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: var(--col-img-gap, 0.85rem);
}

.mod-customgrid__media-item {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  max-width: 100%;
}

.mod-customgrid__img {
  display: block;
  max-width: 100%;
  height: var(--col-img-height, auto);
  max-height: var(--col-img-height, none);
  object-fit: contain;
  border-radius: 4px;
}

.mod-customgrid__column[style*="--col-img-height: auto"] .mod-customgrid__img {
  height: auto;
  max-height: none;
}

.mod-customgrid__img-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 4px;
  line-height: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mod-customgrid__img-link:hover {
  opacity: 0.85;
}

.mod-customgrid__img-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ==========================================================================
   Column Titles & Headings
   ========================================================================== */
.mod-customgrid__title {
  margin: 0;
  font-weight: var(--col-title-weight, var(--mod-grid-title-weight, 300));
  line-height: 1.3;
  color: inherit;
  font-size: 1.25rem;
  letter-spacing: -0.2px;
}

.mod-customgrid__title b,
.mod-customgrid__title strong {
  font-weight: 700;
}

/* ==========================================================================
   Column Body Text (Safe HTML)
   ========================================================================== */
.mod-customgrid__body {
  font-size: 1rem;
  line-height: 1.6;
  color: inherit;
}

.mod-customgrid__body p {
  margin: 0 0 0.75rem 0;
}

.mod-customgrid__body p:last-child {
  margin-bottom: 0;
}

.mod-customgrid__body ul,
.mod-customgrid__body ol {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
}

.mod-customgrid__body li {
  margin-bottom: 0.35rem;
}

.mod-customgrid__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.mod-customgrid__body a:hover {
  text-decoration-thickness: 2px;
}

.mod-customgrid__body a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   Embedded Joomla Sub-Module
   ========================================================================== */
.mod-customgrid__module-wrapper {
  width: 100%;
  margin-top: 0.25rem;
}

.mod-customgrid__module-wrapper ul,
.mod-customgrid__module-wrapper ol,
.mod-customgrid__module-wrapper .mod-menu {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mod-customgrid__module-wrapper li {
  margin-bottom: 0.5rem;
}

.mod-customgrid__module-wrapper li:last-child {
  margin-bottom: 0;
}

.mod-customgrid__module-wrapper a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}

.mod-customgrid__module-wrapper a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Full-Width Copyright Row
   ========================================================================== */
.mod-customgrid__copyright-wrapper {
  width: 100%;
  margin-top: var(--mod-grid-gap);
  background-color: var(--mod-copyright-bg);
  color: var(--mod-copyright-text-color);
  padding: var(--mod-copyright-padding);
}

.mod-customgrid__copyright-wrapper--divider {
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.mod-customgrid__copyright {
  font-size: 0.875rem;
  line-height: 1.5;
  color: inherit;
}

.mod-customgrid__copyright--left {
  text-align: left;
}

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

.mod-customgrid__copyright--right {
  text-align: right;
}

.mod-customgrid__copyright--between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mod-customgrid__copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mod-customgrid__copyright a:hover {
  text-decoration-thickness: 2px;
}

.mod-customgrid__copyright a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   Accessibility Utilities (WCAG 2.1/2.2 AA)
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================================
   A11Y High-Contrast Support (SWP A11Y Plugin & BITV / WCAG 2.1/2.2 AA)
   Automatische Farbanpassung für weiße PNG-Dateien, Logos & Sektionen
   ========================================================================== */

/* Globale Bereinigung für Kontrast-Modi: Footer & Spalten haben KEINE Kasten-Rahmen */
html[data-a11y-contrast] .mod-customgrid,
html[data-a11y-contrast] section.mod-customgrid,
html[data-a11y-contrast] footer.mod-customgrid,
html[data-a11y-contrast] div.mod-customgrid,
html[data-a11y-contrast] .mod-customgrid .mod-customgrid__column,
html[data-a11y-contrast] .mod-customgrid .mod-customgrid__grid,
html[data-a11y-contrast] .mod-customgrid .mod-customgrid__inner,
html[data-a11y-contrast] .mod-customgrid .mod-customgrid__module-wrapper,
html[data-a11y-contrast] .mod-customgrid article,
html[data-a11y-contrast] .mod-customgrid section,
html[data-a11y-contrast] .mod-customgrid aside,
html.swp-a11y-contrast-white-black .mod-customgrid,
html.swp-a11y-contrast-white-black section.mod-customgrid,
html.swp-a11y-contrast-white-black footer.mod-customgrid,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-yellow-black .mod-customgrid,
html.swp-a11y-contrast-yellow-black section.mod-customgrid,
html.swp-a11y-contrast-yellow-black footer.mod-customgrid,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-black-yellow .mod-customgrid,
html.swp-a11y-contrast-black-yellow section.mod-customgrid,
html.swp-a11y-contrast-black-yellow footer.mod-customgrid,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__column {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* 1. SCHWARZ AUF GELB (Black-on-Yellow / data-a11y-contrast="black-yellow")
   Hintergrund ist leuchtend Gelb (#ffff00), Text & Links sind Schwarz (#000000).
   Weiße PNGs (z. B. Logos) werden automatisch zu 100% deckendem Schwarz. */
html[data-a11y-contrast="black-yellow"] .mod-customgrid,
html.swp-a11y-contrast-black-yellow .mod-customgrid {
  --mod-grid-bg: #ffff00 !important;
  --mod-grid-text-color: #000000 !important;
  --mod-copyright-bg: #ffff00 !important;
  --mod-copyright-text-color: #000000 !important;
  --col-bg: #ffff00 !important;
  --col-text-color: #000000 !important;
  background-color: #ffff00 !important;
  background: #ffff00 !important;
  color: #000000 !important;
  border: none !important;
}

html[data-a11y-contrast="black-yellow"] .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__column {
  background-color: #ffff00 !important;
  background: #ffff00 !important;
  color: #000000 !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-a11y-contrast="black-yellow"] .mod-customgrid .mod-customgrid__title,
html[data-a11y-contrast="black-yellow"] .mod-customgrid .mod-customgrid__body,
html[data-a11y-contrast="black-yellow"] .mod-customgrid .mod-customgrid__copyright,
html[data-a11y-contrast="black-yellow"] .mod-customgrid .mod-customgrid__inner *,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__title,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__body,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__copyright,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-customgrid__inner * {
  color: #000000 !important;
}

html[data-a11y-contrast="black-yellow"] .mod-customgrid a:not(.mod-customgrid__img-link),
html.swp-a11y-contrast-black-yellow .mod-customgrid a:not(.mod-customgrid__img-link) {
  color: #000000 !important;
  text-decoration: underline 2px solid #000000 !important;
}

/* Bildfilter: Weiße PNGs -> Schwarz */
html[data-a11y-contrast="black-yellow"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html[data-a11y-contrast="black-yellow"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-black-yellow .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-black-yellow .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter) {
  filter: brightness(0) !important;
}

/* 2. GELB AUF SCHWARZ (Yellow-on-Black / data-a11y-contrast="yellow-black")
   Hintergrund ist Schwarz (#000000), Text & Links sind Kontrast-Gelb (#ffff00).
   Weiße PNGs (z. B. Logos) werden automatisch zu strahlendem Gelb (#ffff00). */
html[data-a11y-contrast="yellow-black"] .mod-customgrid,
html.swp-a11y-contrast-yellow-black .mod-customgrid {
  --mod-grid-bg: #000000 !important;
  --mod-grid-text-color: #ffff00 !important;
  --mod-copyright-bg: #000000 !important;
  --mod-copyright-text-color: #ffff00 !important;
  --col-bg: #000000 !important;
  --col-text-color: #ffff00 !important;
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffff00 !important;
  border: none !important;
}

html[data-a11y-contrast="yellow-black"] .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__column {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffff00 !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-a11y-contrast="yellow-black"] .mod-customgrid .mod-customgrid__title,
html[data-a11y-contrast="yellow-black"] .mod-customgrid .mod-customgrid__body,
html[data-a11y-contrast="yellow-black"] .mod-customgrid .mod-customgrid__copyright,
html[data-a11y-contrast="yellow-black"] .mod-customgrid .mod-customgrid__inner *,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__title,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__body,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__copyright,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-customgrid__inner * {
  color: #ffff00 !important;
}

html[data-a11y-contrast="yellow-black"] .mod-customgrid a:not(.mod-customgrid__img-link),
html.swp-a11y-contrast-yellow-black .mod-customgrid a:not(.mod-customgrid__img-link) {
  color: #ffff00 !important;
  text-decoration: underline 2px solid #ffff00 !important;
}

/* Bildfilter: Weiße PNGs -> Gelb (#ffff00) */
html[data-a11y-contrast="yellow-black"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html[data-a11y-contrast="yellow-black"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-yellow-black .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-yellow-black .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter) {
  filter: brightness(0) saturate(100%) invert(88%) sepia(87%) saturate(1915%) hue-rotate(359deg) brightness(105%) contrast(106%) !important;
}

/* 3. WEISS AUF SCHWARZ (White-on-Black / data-a11y-contrast="white-black")
   Hintergrund ist Schwarz (#000000), Text & Links sind Reinweiß (#ffffff).
   Keine Kasten-Rahmen um Spalten! */
html[data-a11y-contrast="white-black"] .mod-customgrid,
html.swp-a11y-contrast-white-black .mod-customgrid {
  --mod-grid-bg: #000000 !important;
  --mod-grid-text-color: #ffffff !important;
  --mod-copyright-bg: #000000 !important;
  --mod-copyright-text-color: #ffffff !important;
  --col-bg: #000000 !important;
  --col-text-color: #ffffff !important;
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
  border: none !important;
}

html[data-a11y-contrast="white-black"] .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__column {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-a11y-contrast="white-black"] .mod-customgrid .mod-customgrid__title,
html[data-a11y-contrast="white-black"] .mod-customgrid .mod-customgrid__body,
html[data-a11y-contrast="white-black"] .mod-customgrid .mod-customgrid__copyright,
html[data-a11y-contrast="white-black"] .mod-customgrid .mod-customgrid__inner *,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__title,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__body,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__copyright,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-customgrid__inner * {
  color: #ffffff !important;
}

html[data-a11y-contrast="white-black"] .mod-customgrid a:not(.mod-customgrid__img-link),
html.swp-a11y-contrast-white-black .mod-customgrid a:not(.mod-customgrid__img-link) {
  color: #ffffff !important;
  text-decoration: underline 2px solid #ffffff !important;
}

html[data-a11y-contrast="white-black"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html[data-a11y-contrast="white-black"] .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-white-black .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__img:not(.mod-customgrid__img--no-filter),
html.swp-a11y-contrast-white-black .mod-customgrid:not(.mod-customgrid--a11y-disabled) .mod-customgrid__media img:not(.mod-customgrid__img--no-filter) {
  filter: brightness(0) invert(1) !important;
}

/* 4. DUNKELMODUS (Dark Mode / data-a11y-contrast="dark") */
html[data-a11y-contrast="dark"] .mod-customgrid,
html.swp-a11y-contrast-dark .mod-customgrid {
  --mod-grid-bg: #141c2b !important;
  --mod-grid-text-color: #f1f5f9 !important;
  --mod-copyright-bg: #0f1726 !important;
  --mod-copyright-text-color: #94a3b8 !important;
  border: none !important;
}

html[data-a11y-contrast="dark"] .mod-customgrid .mod-customgrid__column,
html.swp-a11y-contrast-dark .mod-customgrid .mod-customgrid__column {
  border: none !important;
  box-shadow: none !important;
}

/* Submenu Dropdown Chevron im Footer (z. B. in Spalte 3 "Schnell Navigiert") */
html[data-a11y-contrast] .mod-customgrid button.dropdown-toggle,
html[data-a11y-contrast] .mod-customgrid .dropdown-toggle,
html[data-a11y-contrast] .mod-customgrid .mod-menu__toggle,
html[data-a11y-contrast] .mod-customgrid button:not([class*="btn-"]),
html.swp-a11y-contrast-white-black .mod-customgrid button.dropdown-toggle,
html.swp-a11y-contrast-white-black .mod-customgrid .dropdown-toggle,
html.swp-a11y-contrast-white-black .mod-customgrid .mod-menu__toggle,
html.swp-a11y-contrast-white-black .mod-customgrid button:not([class*="btn-"]),
html.swp-a11y-contrast-yellow-black .mod-customgrid button.dropdown-toggle,
html.swp-a11y-contrast-yellow-black .mod-customgrid .dropdown-toggle,
html.swp-a11y-contrast-yellow-black .mod-customgrid .mod-menu__toggle,
html.swp-a11y-contrast-yellow-black .mod-customgrid button:not([class*="btn-"]),
html.swp-a11y-contrast-black-yellow .mod-customgrid button.dropdown-toggle,
html.swp-a11y-contrast-black-yellow .mod-customgrid .dropdown-toggle,
html.swp-a11y-contrast-black-yellow .mod-customgrid .mod-menu__toggle,
html.swp-a11y-contrast-black-yellow .mod-customgrid button:not([class*="btn-"]) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 4px !important;
}

/* ==========================================================================
   Spalten-Mindestbreite & Auto-Wrap Schutz
   ========================================================================== */
.mod-customgrid:not([style*="--mod-col-min-width: auto"]) .mod-customgrid__column {
  min-width: var(--mod-col-min-width, 0);
}

/* ==========================================================================
   Druckoptimierung (Print Page-Breaks)
   ========================================================================== */
@media print {
  .mod-customgrid {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .mod-customgrid__grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
  }

  .mod-customgrid__column {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    flex: 1 1 180px !important;
  }
}
