/* ==========================================================================
   CODE-DE-Lab – Ergänzungen zu output.css
   Nur NEUE/erweiterte Komponenten: Dropdown-Menü, Filter, Karten-Grid,
   Overlay, Cookie-Banner. Nutzt die Variablen aus output.css
   (--primary-base #02203e, --accent-base #ff8225, --details-* Blau).
   ========================================================================== */

/* --- A11y-Helfer (BITV) --- */
.visually-hidden, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: .5rem; z-index: 1000;
  background: var(--primary-base); color: #fff; padding: .5rem .9rem; border-radius: 6px;
}
:focus-visible { outline: 3px solid var(--details-dark); outline-offset: 2px; }

/* --- Dropdown-Mega-Menü (neu, an navbar angelehnt) --- */
#navigation-buttons .has-dropdown { position: relative; }
#navigation-buttons .dropdown-toggle {
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4em; padding: 0;
  text-transform: uppercase; font-size: 17px; color: rgb(234, 234, 234); /* wie die übrigen Menüpunkte */
}
#navigation-buttons .dropdown-toggle:hover { color: var(--details-light); }
#navigation-buttons .dropdown a { text-transform: none; font-size: 1rem; white-space: nowrap; }
#navigation-buttons .dropdown {
  list-style: none; margin: 0; padding: .5rem; position: absolute; left: 0; top: 100%;
  min-width: 230px; background: #fff; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(2,32,62,.15); display: none; z-index: 300;
}
#navigation-buttons .has-dropdown.is-open .dropdown { display: block; }
#navigation-buttons .dropdown li { margin: 0; }
#navigation-buttons .dropdown a { display: block; padding: .5rem .7rem; border-radius: 6px; color: var(--primary-base); text-decoration: none; }
#navigation-buttons .dropdown a:hover { background: #eef3f9; }

/* Mobil = Off-Canvas-Menü der Altseite (Breakpoint 1200px): Dropdowns als Akkordeon */
@media (max-width: 1200px) {
  #navigation-buttons .dropdown { position: static; box-shadow: none; background: transparent; padding: .25rem 0 .5rem 1rem; min-width: 0; border-radius: 0; }
  #navigation-buttons .dropdown a { color: #fff; opacity: .85; padding: .45rem .5rem; }
  #navigation-buttons .dropdown a:hover, #navigation-buttons .dropdown a:focus-visible { background: rgba(255,255,255,.08); opacity: 1; }
  #navigation-buttons .dropdown-toggle { text-align: left; }
}
/* Desktop: Brücke, damit das Menü beim Hover nicht zwischen Button und Box zuklappt */
@media (min-width: 1201px) {
  #navigation-buttons .dropdown { margin-top: .6rem; }
  #navigation-buttons .dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -.8rem; height: .8rem; }
}

/* --- Inhalts-Grundlagen (falls output.css nicht greift) --- */
.page, .entry { padding-block: .5rem 2rem; }
.lead { font-size: 1.15rem; opacity: .85; }
.breadcrumb a { text-decoration: none; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; margin-block: 1rem; }

/* --- Filterleiste (ID 4) --- */
.portfolio-search input {
  width: 100%; max-width: 420px; padding: .6rem .8rem; border: 1px solid #cdd8e5;
  border-radius: 8px; font: inherit; margin-bottom: 1rem;
}
.filterbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.filter {
  background: #fff; border: 1px solid #cdd8e5; border-radius: 999px;
  padding: .45rem 1rem; cursor: pointer; font: inherit; color: var(--primary-base);
}
.filter.is-active { background: var(--accent-base); color: #02203e; border-color: var(--accent-base); font-weight: 600; } /* Orange statt Navy – hebt sich vom dunklen Seitenhintergrund ab */
.filter-empty { opacity: .7; }

/* --- Karten-Grid (Portfolio/Projects) --- */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { border: 1px solid #e2e9f1; border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 10px 28px rgba(2,32,62,.12); }
.card__link { display: block; text-decoration: none; color: var(--primary-base); }
.card img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.card__cat { display: inline-block; margin: .8rem .8rem 0; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: #fff; background: var(--details-darker); padding: .15rem .5rem; border-radius: 4px; }
.card__title { margin: .5rem .8rem; font-size: 1.02rem; }
.card__meta { display: block; margin: 0 .8rem .8rem; opacity: .7; font-size: .82rem; }
.card[hidden] { display: none; }

/* --- Overlay (ID 3) --- */
.overlay { position: fixed; inset: 0; background: rgba(2,32,62,.6); display: flex; align-items: center; justify-content: center; z-index: 800; padding: 1rem; }
.overlay[hidden] { display: none !important; }
.overlay__panel { background: #fff; border-radius: 12px; max-width: 860px; width: 100%; max-height: 88vh; overflow: auto; position: relative; padding: 2rem; }
.overlay__close { position: absolute; top: .6rem; right: .8rem; font-size: 1.7rem; background: none; border: 0; cursor: pointer; line-height: 1; }

/* --- Embed / Karte (nach Consent) --- */
.embed__frame, .map__frame { position: relative; background: #eef3f9; border-radius: 8px; overflow: hidden; min-height: var(--embed-h, 480px); }
.embed__placeholder, .map__placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .8rem; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; }
.embed iframe, .map__canvas { width: 100%; height: var(--embed-h, 480px); border: 0; }

/* --- Help-Grid --- */
.help-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 1.5rem; }
.help-card { border: 1px solid #e2e9f1; border-radius: 12px; padding: 1.2rem; text-decoration: none; color: var(--primary-base); background: #fff; }
.help-card:hover { box-shadow: 0 10px 28px rgba(2,32,62,.12); }

/* --- News --- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { border-bottom: 1px solid #e2e9f1; padding: 1rem 0; }
.news-item time { opacity: .6; font-size: .85rem; }
.news-item h2 { margin: .2rem 0; font-size: 1.2rem; }
.news-item a { text-decoration: none; }
.news-teaser { padding: .5rem 0; border-bottom: 1px solid #e2e9f1; }
.news-teaser a { text-decoration: none; color: var(--primary-base); }
.news-teaser time { opacity: .6; font-size: .85rem; }

/* --- Cookie-Banner (ID 7) --- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--primary-base); color: #fff; z-index: 900; }
.cookie-banner .container, .cookie-banner__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; }
.cookie-banner p { margin: 0; max-width: 62ch; }
.cookie-banner__actions { display: flex; gap: .6rem; }
.btn { display: inline-block; background: var(--details-dark); color: #fff; border: 0; padding: .6rem 1.1rem; border-radius: 6px; cursor: pointer; font: inherit; text-decoration: none; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid #fff; }

/* --- Inline-SVG-Icons (Ersatz für FontAwesome) --- */
.icon { display: inline-block; vertical-align: -0.15em; }
#navbar-login { display: inline-flex; align-items: center; gap: .4em; }

/* Mobile-Toggle: Menü-/Schließen-Icon via aria-expanded umschalten */
.mobile-menu-toggle { background: none; border: 0; cursor: pointer; color: inherit; }
.mobile-menu-toggle .icon-close { display: none; }
.mobile-menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.mobile-menu-toggle[aria-expanded="true"] .icon-close { display: inline-block; }

/* Dropdown-Caret (CSS statt Icon-Font) */
#navigation-buttons .dropdown-toggle::after {
  content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .45em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s;
}
#navigation-buttons .has-dropdown.is-open .dropdown-toggle::after { transform: rotate(-135deg) translateY(-1px); }

/* Relaunch-Import: Remote-Bilder & Hero */
.entry__hero{max-width:100%;height:auto;border-radius:6px;margin:0 0 1.25rem;display:block}
/* News-Liste: Bild als feste rechte Spalte (kein Float mehr -> nichts verrutscht), vertikal zentriert */
.news-item:has(.news-item__thumb) { display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 2rem; align-items: center; padding: 1.25rem 0; }
.news-item:has(.news-item__thumb) > :not(.news-item__thumb) { grid-column: 1; }
.news-item__thumb { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 220px; aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 6px; display: block; }
@media (max-width: 700px) {
  .news-item:has(.news-item__thumb) { grid-template-columns: 1fr; }
  .news-item__thumb { grid-column: 1; grid-row: auto; width: 100%; max-width: 360px; margin-top: .75rem; }
}

/* --- Blocks: Text mit Bild & Button --- */
.eyebrow { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin: 0 0 .3rem; }
.twb-cta { margin-top: 1.2rem; }
.twb-grid { display: flex; gap: 2.5rem; align-items: center; flex-wrap: wrap; }
.twb-grid .spacing { flex: 1 1 320px; }
.twb-image { flex: 1 1 320px; }
.twb-image img { width: 100%; height: auto; border-radius: 12px; display: block; }
.twb--left .twb-grid { flex-direction: row-reverse; }
@media (max-width: 800px) { .twb-grid, .twb--left .twb-grid { flex-direction: column; } }

/* --- Blocks: Karten-Raster --- */
.cards-block .card p { margin: .4rem 0 0; font-size: .95rem; }

/* --- Layout-Feld (Spalten-Baukasten) --- */
.layout-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; align-items: start; }
.layout-col { min-width: 0; }
.layout-col > * { margin-top: 0; }
@media (max-width: 800px) {
  .layout-row { grid-template-columns: 1fr; }
  .layout-col { grid-column: 1 / -1 !important; }
}

/* --- Footer: Förderer-/Partner-Logos (Min · Min · DLR · CF · UB, lt. Revamp-Mockup) --- */
.wrapper-footer-upper .footer-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; padding: 1.5rem 8px; }
.wrapper-footer-upper .footer-logos img { display: block; width: auto; object-fit: contain; max-width: 100%; }
.wrapper-footer-upper .footer-logos .logo-min { height: 80px; }
.wrapper-footer-upper .footer-logos .logo-dlr { height: 54px; }
.wrapper-footer-upper .footer-logos .logo-cf  { height: 40px; }
.wrapper-footer-upper .footer-logos .logo-ub  { height: 34px; }
@media (max-width: 1200px) {
  .wrapper-footer-upper .footer-logos { flex-direction: row; justify-content: center; gap: 1.5rem 2rem; }
}
@media (max-width: 600px) {
  .wrapper-footer-upper .footer-logos .logo-min { height: 64px; }
  .wrapper-footer-upper .footer-logos .logo-dlr { height: 44px; }
  .wrapper-footer-upper .footer-logos .logo-cf  { height: 32px; }
  .wrapper-footer-upper .footer-logos .logo-ub  { height: 28px; }
}
.wrapper-footer-bottom .img img { height: 4em; width: auto; }

/* --- Startseite: News & Events | Newsletter nebeneinander (lt. DLR-Mockup) --- */
.layout-section:has(.news-teaser-block) { background: #fff; color: rgba(0,0,0,.87); }
.layout-col > .news-teaser-block { padding: 0; }
.layout-col > .news-teaser-block > .container { width: auto; }
.news-teaser-more { margin-top: 1rem; }
.news-teaser-more a { color: var(--primary-base); font-weight: 600; text-decoration: none; }
.layout-section:has(.news-teaser-block) .layout-col:has(.newsletter) {
  background: var(--primary-base); color: #fff; border-radius: 10px; padding: 2rem;
}
.layout-col .newsletter.center { grid-template-columns: 1fr; gap: .8rem; padding: 1rem 0; }
.layout-col .newsletter.center .title { justify-content: flex-start; font-size: 1.3rem; }
.layout-col .newsletter.center a { max-width: 260px; }

/* --- Layoutfixes Feedback 28.09. --- */
/* Portfolio-Karten: Trennlinie zwischen Bild und Label (Logos mit weißem/transparentem Hintergrund) */
.card img { border-bottom: 1px solid #e2e9f1; background: #f5f7fa; }
/* Hilfe-Karten: lange Titel umbrechen statt aus der Karte laufen */
.help-card { min-width: 0; }
.help-card h2 { overflow-wrap: break-word; hyphens: auto; }
/* Unterseiten: erster Abschnitt mit genug Abstand zum fixierten Header (Seitentitel lag darunter) */
main > section.pad-4:first-child { padding-top: 10.5rem; }
@media (max-width: 1200px) { main > section.pad-4:first-child { padding-top: 9rem; } }
@media (max-width: 600px)  { main > section.pad-4:first-child { padding-top: 7rem; } }

/* --- Mobile Layoutfixes (Feedback 28.09.): nichts darf breiter als der Bildschirm werden --- */
/* Lange URLs/Wörter im Inhalt umbrechen statt überlaufen */
main { overflow-wrap: break-word; }
main a { overflow-wrap: anywhere; }
/* Tabellen und Code horizontal scrollbar statt die Seite zu verbreitern */
main table:not(.cdl-paths-table) { display: block; max-width: 100%; overflow-x: auto; }
main pre { max-width: 100%; overflow-x: auto; }
main img, main video { max-width: 100%; height: auto; }
main iframe { max-width: 100%; }
@media (max-width: 700px) {
  main h1, main h2, main h3, main h4, .top-banner__title { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
  /* Startseite: Hero-Titel (Anhang 8) */
  .hero { padding-inline: 16px; }
  .hero h1 { font-size: clamp(26px, 8vw, 44px); max-width: 100%; }
  /* Unterseiten-Banner, z. B. „Über CODE-DE-Lab“ (Anhang 7) */
  .top-banner__title { font-size: clamp(22px, 6.5vw, 32px); }
}
/* Post-Migrations-Anleitung (eigenes HTML, .cdl-*): Grid-/Flex-Spalten dürfen schrumpfen */
main main { max-width: 100%; }
.cdl-layout > *, .cdl-step > *, .cdl-steps > * { min-width: 0; } /* Grid-/Flex-Spalten dürfen schmaler als ihr Inhalt werden */
@media (max-width: 1200px) { .prose .cdl-wrap { max-width: 100%; } } /* eingebettetes CSS setzt 50 % – auf Tablet/Handy zu schmal */
@media (max-width: 600px) {
  .prose .cdl-wrap { padding: 1rem 0; }
  .cdl-wrap .cdl-paths-table, .cdl-wrap .cdl-paths-table tbody, .cdl-wrap .cdl-paths-table thead, .cdl-wrap .cdl-paths-table tr { display: block; width: 100%; margin-left: 0; }
  .cdl-wrap .cdl-paths-table th, .cdl-wrap .cdl-paths-table td { display: block; width: 100%; }
}
.cdl-wrap .cdl-code, .cdl-wrap pre { max-width: 100%; overflow-x: auto; }
@media (max-width: 700px) {
  .cdl-wrap .cdl-table td:first-child { white-space: normal; }
  /* Listenpunkte sind Flex-Container -> jedes <em>/<code> würde eine eigene Spalte; mobil als Fließtext */
  .cdl-wrap .cdl-substeps li, .cdl-wrap .cdl-checklist li { display: block; }
  .cdl-wrap .cdl-substeps li::before, .cdl-wrap .cdl-checklist li::before { display: inline-block; margin-right: .5rem; }
}
/* Sicherheitsnetz: kein seitliches Verschieben / kein blauer Streifen rechts */
html, body { overflow-x: clip; }

/* --- Feedback 12.10.: Förderer-Logos direkt unter „gefördert durch“ --- */
.text-with-button:has(.funding-logos) .spacing { max-width: 820px; }
.funding-logos img { display: block; width: 100%; max-width: 520px; height: auto; background: #fff; padding: 14px 18px; border-radius: 6px; margin-top: .6rem; box-sizing: border-box; }

/* --- Feedback 12.10.: Hauptmenü vertikal zentriert, Menüpunkte einzeilig --- */
@media (min-width: 1201px) {
  #navigation-buttons { align-items: center; flex-wrap: nowrap; }
  #navigation-buttons > li > a, #navigation-buttons .dropdown-toggle { white-space: nowrap; line-height: 1.2; }
}
@media (min-width: 1201px) and (max-width: 1440px) {
  .navbar .nav-container .navigation nav ul#navigation-buttons { gap: 16px; margin-inline: 1rem 0; }
  #navigation-buttons > li > a, #navigation-buttons .dropdown-toggle { font-size: 15px; }
}
