/* Optimierte und refaktorierte CSS-Datei gemäß aktuellen Standards */

/* ----------------------------------------
   PDF-Anhänge Accordion
   ---------------------------------------- */
.pdf-attachments-accordion {
  margin-block-start: 0;
}

.pdf-attachments-accordion summary {
  cursor: pointer;
  font-weight: bold;
}

/* ----------------------------------------
   Readmore-Button
   ---------------------------------------- */
.readmore-wrapper {
  margin-bottom: 1.5em;
}

.readmore-toggle {
  background: #000;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  cursor: pointer;
  margin-top: 0.5em;
}

/* ----------------------------------------
   Globale Layout-Anpassungen für WP-Blöcke
   ---------------------------------------- */
.wp-site-blocks {
  max-width: 88vw !important;
  margin: auto !important;
}

.wp-block-group {
  padding-block: 10px !important;
  margin-top: 0 !important;
}

.wp-block-post-content  p{
	text-align: justify;
}

/* Aktuelles Menüelement unterstreichen */
.wp-block-navigation-item.current-menu-item a {
  text-decoration: underline;
}

/* ----------------------------------------
   Mobile (≤782 px): Keine Burger-Navigation, immer horizontale Desktop-Navigation
   ---------------------------------------- */
@media (max-width: 782px) {
  /* 1. Burger-öffnen & Schließen ausblenden */
  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close {
    display: none !important;
  }

  /* 2. Responsive-Container („Modal“) immer anzeigen */
  .wp-block-navigation__responsive-container {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* 2a. Dialog-Wrapper & Content befreien (kein Overlay-Styling) */
  .wp-block-navigation__responsive-close,
  .wp-block-navigation__responsive-dialog,
  .wp-block-navigation__responsive-container-content {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  /* 3. UL immer sichtbar und horizontal ausrichten */
  ul.wp-block-navigation__container.is-responsive {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* 4. Listeneinträge anpassen */
  .wp-block-navigation-item {
    margin: 0 !important;
  }

  .wp-block-navigation-item__content {
    display: inline-block !important;
  }

  /* ===== Mobile Search Overlay ===== */
  /* 1) Originalen Such-Block ausblenden */
  .mobile-search-bar {
    display: none !important;
  }

  /* 2) Toggle-Button (Lupe) */
  #mobile-search-toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000; /* ↓ deutlich unter Overlay */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  /* 3) Overlay */
  #mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10000; /* ↑ über dem Toggle */
    justify-content: center;
    align-items: center;
  }

  #mobile-search-overlay.active {
    display: flex;
  }

  /* 4) Close-Button (X) */
  #mobile-search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10001; /* ganz oben */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  /* 5) Suchformular im Overlay */
  #mobile-search-overlay .search-form {
    width: 90%;
    max-width: 400px;
  }
}

/* ----------------------------------------
   Suchbutton-Styling
   ---------------------------------------- */
.wp-block-search__button.has-small-font-size.has-icon.wp-element-button {
  padding: 0.6rem;
}

/* ----------------------------------------
   Readmore-Full-Absatz
   ---------------------------------------- */
.readmore-full p {
  margin-block: 0 !important;
}

/* ----------------------------------------
   Sekundäre Navigation (Untermenüs)
   ---------------------------------------- */
/* 1. Untermenüs initial verstecken */
#secnavhid {
  display: none; /* standardmäßig ausgeblendet */
  padding: 0 !important;
}

/* 2. Pfeil-Icon hinter dem „Alle“-Link (collapsed-Zustand = ▼) */
.toggleSecNav::after {
  content: " ▼"; /* Pfeil nach unten im collapsed-Zustand */
  font-size: 0.8em; /* Pfeil etwas kleiner */
  margin-left: 4px; /* Kleines Lückchen vor dem Pfeil */
}

/* 3. Wenn aufgeklappt (Klasse „.expanded“), SecNav einblenden und Pfeil nach oben */
.toggleSecNav.expanded::after {
  content: " ▲"; /* Pfeil nach oben im expanded-Zustand */
}

/* Sobald .toggleSecNav die Klasse „expanded“ hat, blenden wir #secnavhid ein */
.toggleSecNav.expanded + #secnavhid,
.toggleSecNav.expanded ~ #secnavhid {
  display: block;
}

/* Zusätzliche Anpassung: Kein Abstand im Navigations-Gap */
#navgap0 {
  gap: 0;
  padding: 0 !important;
}

/* ----------------------------------------
   Beiträge & PDF Details: Gleicher margin-Start
   ---------------------------------------- */
li.wp-block-post .wp-block-post-content,
.pdf-attachments-accordion details,
li.wp-block-post .taxonomy-category.wp-block-post-terms,
.ctt-wrapper,
.wp-singular.post-template-default.single.single-post
  .entry-content.alignfull.wp-block-post-content.is-layout-flow.wp-block-post-content-is-layout-flow {
  margin-block-start: 0.3rem;
}

/* ----------------------------------------
   CTT-Textinhalt: Nur eine Zeile anzeigen
   ---------------------------------------- */
.ctt-text-content {
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* nur eine Zeile anzeigen */
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5em; /* Beispiel-Zeilenhöhe */
  max-height: 1.5em; /* entspricht einer Zeile */
  transition: max-height 0.25s ease;
}

/* Zustand, wenn der Text vollständig gezeigt werden soll */
.ctt-text-content.ctt-expanded {
  -webkit-line-clamp: none; /* keine Begrenzung */
  max-height: none; /* beliebige Höhe */
}

/* Fokus-Entfernung für Toggle-Button */
.ctt-toggle-button:focus {
  outline: none;
}

/* ----------------------------------------
   Buttons: Einheitliche Padding- und Schriftgröße
   ---------------------------------------- */
:root :where(.wp-element-button, .wp-block-button__link) {
  padding: 0.2rem 1rem;
  font-size: 0.9em;
  font-weight: bold;
  line-height: 1rem;
}

.no-mar-start {
	margin-block-start: 0;
}