/* Webdoktor-Reparatur: Handy-Ansicht + Cookie-Hinweis (Desktop bleibt 1:1) */
#wd-topbar, #wd-mnav { display: none; }
img { max-width: 100%; height: auto; }

/* Alter Joomla-Cookie-Hinweis komplett stilllegen - Ersatz kommt von webdoktor-fix.js */
#redim-cookiehint-top, #redim-cookiehint, #cookiehintinfo { display: none !important; }
#wd-cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100000;
  background: #f2f2f2; color: #333; box-shadow: 0 -3px 16px rgba(0,0,0,.25);
  padding: 14px 18px; font-family: sans-serif; font-size: 14px; line-height: 1.5;
  display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
#wd-cookie .wd-c-text { max-width: 640px; }
#wd-cookie button { border: 0; border-radius: 6px; padding: 10px 18px; font-size: 14px;
  font-weight: 600; cursor: pointer; }
#wd-cookie .wd-ja { background: #436f34; color: #fff; }
#wd-cookie .wd-nein { background: #d9d9d9; color: #333; }

@media screen and (max-width: 768px) {
  #wd-topbar { display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
    background: #fff; color: #2c3a26; align-items: center; justify-content: space-between;
    padding: 7px 14px; box-shadow: 0 2px 12px rgba(0,0,0,.25); font-family: sans-serif; }
  #wd-home { display: flex; align-items: center; }
  #wd-home img { height: 40px; width: auto; display: block; }
  #wd-burger { background: #4c7a3b; border: 0; color: #fff;
    font-size: 16px; line-height: 1; padding: 9px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; }
  #wd-mnav.open { display: block; position: fixed; top: 54px; left: 0; right: 0; z-index: 99998;
    background: #fff; box-shadow: 0 24px 44px rgba(0,0,0,.35);
    max-height: calc(100vh - 49px); overflow: auto; }
  #wd-mnav a { display: block; padding: 14px 18px; border-bottom: 1px solid #e6e6e6;
    color: #2c3a26; text-decoration: none; font-size: 16px; font-family: sans-serif; }
  #wd-mnav a:active { background: #eef3ea; }
  body { padding-top: 54px; }

  /* Alte, kaputte Mobil-Navigation und Störer ausblenden */
  #leftmenu .mobileMenuButton { display: none !important; }
  #leftmenu ul { display: none !important; }
  [id*="pweb"], [class*="pweb"], [class*="likebox"] { display: none !important; }

  /* Riesige Bilder/Slider zähmen */
  #hintergrundbild { max-height: 340px; overflow: hidden; margin-top: 0 !important; }
  #hintergrundbild .slider, #hintergrundbild .awb-slider { max-height: 340px; }

  /* Cookie-Leiste unter die Topbar schieben */
  #redim-cookiehint-top { top: 54px !important; }

  /* Unterseiten: Inhalt sauber umbrechen */
  #main, #content, .item-page { position: static !important; width: auto !important; padding: 12px 14px !important; }
  #main table, .item-page table { width: 100% !important; }
  h1, h2, h3 { word-wrap: break-word; }

  /* Bildergalerie (com_bagallery): Masonry-Chaos in sauberes Raster zwingen */
  .ba-gallery, .ba-gallery-grid, .ba-album, .ba-album-items {
    position: static !important; height: auto !important; width: 100% !important; }
  .ba-gallery-items {
    position: static !important; float: none !important; display: block !important;
    width: 100% !important; height: auto !important; margin: 0 0 16px !important;
    left: auto !important; top: auto !important; transform: none !important; }
  .ba-image { position: static !important; width: 100% !important; height: auto !important; overflow: visible !important; }
  .ba-image img { width: 100% !important; height: auto !important; border-radius: 8px;
    opacity: 1 !important; filter: none !important; transform: none !important; }
  .ba-image::before, .ba-image::after { display: none !important; }
  .ba-caption { position: static !important; opacity: 1 !important; background: none !important;
    transform: none !important; height: auto !important; padding: 0 !important; }
  .ba-caption-content { position: static !important; transform: none !important; opacity: 1 !important; }
  .ba-caption h3 { color: #2c3a26 !important; font-size: 15px !important; margin: 6px 0 0 !important;
    text-shadow: none !important; }
  .ba-caption, .ba-caption-content, .ba-caption h3 { display: block !important; visibility: visible !important; }
  .ba-gallery-items::before, .ba-gallery-items::after,
  .ba-image > a::before, .ba-image > a::after { display: none !important; }
  .ba-gallery-items, .ba-gallery-items * { opacity: 1 !important; filter: none !important; }
  .ba-image > a { position: static !important; display: block !important; background: none !important; }
  #left { position: static !important; width: auto !important; }
  #wrap, #content, #main { width: auto !important; max-width: 100%; overflow-x: hidden; }
  body { overflow-x: hidden; }

  /* Cookie-Leiste mobil kompakter */
  #redim-cookiehint-top, #redim-cookiehint { font-size: 13px; }
}
