/* ==========================================================================
   Quickstart Site Package — Base Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Fallback font stacks (overridden by settings when a custom font is set) */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-headings: var(--font-primary);

  /* Derived values (not exposed as settings) */
  --color-white: #fff;
  --color-black: #000;
  --color-text-light: #555;
  --color-border: rgba(0, 0, 0, 0.1);
  --line-height-base: 1.5;
  --spacing: 1rem;

  /* Z-index scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1050;

  /* Card shadows */
  --card-bg: var(--color-white);
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Base Elements
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

@media (max-width: 1100px) {
  body.menu-open {
    overflow: hidden;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  line-height: 1.2;
  color: var(--color-primary);
  margin-block: 0 0.75em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-block: 0 1em;
}

blockquote {
  margin-block: 0 1em;
  padding-left: 1em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-light);
}

ul, ol {
  margin-left: 20px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--spacing);
}

.container-fluid {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--spacing);
}

.section-py {
  padding-block: var(--section-padding, 3rem);
}

/* --------------------------------------------------------------------------
   Grid Utilities
   -------------------------------------------------------------------------- */
.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-2-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-3-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-3-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Sidebar layout (container) */
.grid-2-cols-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-2-cols-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

@media (min-width: 992px) {
  .grid-2-cols-sidebar {
    grid-template-columns: 1fr 350px;
  }
}

/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.navigation-wrapper {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.main-header-color {
  background: var(--header-bg);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  color: var(--header-color);
}

.main-header a {
  color: var(--header-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-header img {
  height: auto;
  width: auto;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  margin-left: 0;
}

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

.nav-item {
  position: relative;
}

.nav-item.has-submenu > .nav-link .nav-indicator-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 0.4rem;
  border: solid var(--nav-link-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.nav-item.has-submenu:hover > .nav-link .nav-indicator-icon,
.nav-item.has-submenu:focus-within > .nav-link .nav-indicator-icon {
  transform: rotate(-135deg);
}

.nav-item.active > .nav-link,
.nav-item.current > .nav-link {
  color: var(--nav-active-color);
}

.nav-item.current > .nav-link {
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: var(--spacing);
  color: var(--nav-link-color);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--nav-link-hover);
}

/* Submenu */
.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: var(--nav-submenu-bg);
  border-top: 2px solid var(--nav-submenu-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: var(--z-dropdown);
  list-style: none;
}

.nav-submenu-item {
  display: block;
}

.nav-submenu-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-submenu-link:hover,
.nav-submenu-link:focus {
  background-color: rgba(63, 180, 152, 0.1);
  color: var(--color-accent);
}

.nav-submenu-item.active > .nav-submenu-link,
.nav-submenu-item.current > .nav-submenu-link {
  color: var(--nav-active-color);
}

.nav-item:hover > .nav-submenu,
.nav-item:focus-within > .nav-submenu {
  display: block;
}

/* Language Nav */
.lang-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.75rem;
}

.lang-nav li {
  text-transform: uppercase;
}

.lang-nav li.active1 a {
  color: var(--color-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  padding: var(--spacing);
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  margin-bottom: 5px;
  background: var(--hamburger-color);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.hamburger span:last-child {
  margin-bottom: 0;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile navigation */
@media (max-width: 1100px) {
  .navigation-wrapper {
    flex-flow: row-reverse;
  }

  .hamburger {
    display: block;
  }

  .nav-list {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-height));
    flex-direction: column;
    background: var(--nav-submenu-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: var(--z-fixed);
  }

  .nav-list.active {
    display: block;
  }

  .nav-submenu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--nav-submenu-border);
    margin-left: var(--spacing);
  }

  .nav-submenu.active {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.main-footer {
  margin-top: auto;
  padding: 2.5rem 0;
  background-color: var(--footer-bg);
  color: var(--footer-color);
  font-size: 0.875rem;
}

.main-footer a {
  color: var(--footer-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.main-footer a:hover {
  opacity: 0.75;
  color: var(--footer-color);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.footer-company div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .footer-company {
    display: flex;
    gap: 3rem;
    line-height: 1.6;
  }
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-right {
    align-items: flex-end;
    text-align: right;
  }
}

.footer-socials {
  display: flex;
  list-style: none;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease, transform 0.2s ease;
}

.footer-socials a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  opacity: 1;
}

.footer-socials svg {
  display: block;
}

.footer-copyright {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */
.banner {
  position: relative;
  height: var(--banner-height);
  min-height: var(--banner-min-height);
  overflow: hidden;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 1;
}

.banner-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  z-index: 2;
}

.banner-caption {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-caption-headline {
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--banner-caption-color);
  margin: 0;
}

.banner-caption p {
  color: var(--banner-caption-color);
  margin-top: 0.5rem;
}

/* Banner carousel integration */
.banner-carousel {
  height: var(--banner-height);
  min-height: var(--banner-min-height);
}

.banner-carousel .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Carousel (generic)
   -------------------------------------------------------------------------- */
.carousel-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 50vh;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
  height: 100%;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prev-button,
.next-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: var(--color-white);
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  z-index: 2;
  transition: background 0.2s ease;
}

.prev-button:hover,
.next-button:hover {
  background: rgba(0, 0, 0, 0.7);
}

.prev-button {
  left: 10px;
}

.next-button {
  right: 10px;
}

/* --------------------------------------------------------------------------
   Cards (teaser / news)
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  width: 100%;
  max-width: 400px;
}

.grid-3-cols .card {
  max-width: unset;
  margin-inline: unset;
}

.card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.card a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card__image {
  overflow: hidden;
}

.card__image picture {
  display: block;
}

.card__image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card__image img {
  transform: scale(1.05);
}

.card__header {
  padding: 1.25rem 1.25rem 0;
}

.card__header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.card__bodytext {
  padding: 0.75rem 1.25rem 1.25rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

/* Card variant: image on top (default) */
.card--image-top {
  flex-direction: column;
}

/* Card variant: image on bottom */
.card--image-bottom .card__image {
  order: 1;
}

/* Card variant: compact (sidebar style, no image) */
.card--compact {
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
}

.card--compact .card__header {
  padding: 1rem 0 0;
}

.card--compact .card__header h3 {
  font-size: 1rem;
}

.card--compact .card__bodytext {
  padding: 0.5rem 0 1rem;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */
figure.table {
  margin-block: 0 1.5em;
  /* Responsiveness: figure acts as scroll container on narrow screens */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

figure.table table,
.ce-bodytext table {
  width: 100%;
  min-width: 480px; /* below this, scroll instead of squeezing */
  border-collapse: collapse;
  background-color: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  overflow: hidden; /* clips cell corners to the radius */
  font-size: 0.95rem;
}

figure.table th,
figure.table td,
.ce-bodytext th,
.ce-bodytext td {
  padding: 0.65rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

figure.table thead th,
.ce-bodytext thead th {
  background-color: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-headings);
  font-weight: 600;
  white-space: nowrap;
}

figure.table tbody tr:last-child td,
.ce-bodytext tbody tr:last-child td {
  border-bottom: none;
}

/* Zebra striping, uses the same surface color as .section-bg */
figure.table tbody tr:nth-child(even),
.ce-bodytext tbody tr:nth-child(even) {
  background-color: var(--section-bg);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  figure.table th,
  figure.table td,
  .ce-bodytext th,
  .ce-bodytext td {
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */
.news-img-wrap {
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Section variants (usable on containers via layout field)
   -------------------------------------------------------------------------- */
.section-bg {
  background: var(--section-bg);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}




/* --- MOBIL-ANSICHT (Standard / Mobile First) --- */
/* Wir zwingen das Element in ein vertikales Flexbox-Layout.
   Dadurch steht das Bild IMMER über dem Text, egal was im Backend gewählt wurde. */
.ce-textpic {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px;
}

/* Falls die Bilder unter dem Text stehen sollen, nutzen Sie stattdessen:
   flex-direction: column-reverse !important; */

.ce-textpic .ce-gallery {
  width: 100% !important;
  margin: 0 0 15px 0 !important; /* Bereinigt seitliche Abstände */
}

.ce-textpic .ce-bodytext {
  width: 100% !important;
}


/* --- DESKTOP-ANSICHT (Ab Tablet/Desktop-Breakpoint) --- */
@media (min-width: 768px) {
  /* Hier setzen wir Flexbox zurück, damit TYPO3s Standard-Klassen
     (wie ce-right, ce-left, ce-above) wieder wie gewohnt greifen. */
  .ce-textpic {
    display: block !important;
  }

  /* Optionale Optimierung: Falls Sie auch auf Desktop lieber ein
     modernes Flex-Layout für "Nebeneinander" (ce-right/ce-left) nutzen wollen: */
  .ce-textpic.ce-right {
    display: flex !important;
    flex-direction: row-reverse !important;
  }
  .ce-textpic.ce-left {
    display: flex !important;
    flex-direction: row !important;
  }
  .ce-textpic.ce-right .ce-gallery,
  .ce-textpic.ce-left .ce-gallery {
    width: 40% !important; /* Flexiblere Aufteilung auf Desktop */
  }
}
