/* Keep the original desktop design; shrink its containers on smaller screens. */
body .container header.top .headermitte,
body .container article header,
body .container article #karte { max-width:100%; }
body .container article section { max-width:calc(100% - 40px); overflow-wrap:anywhere; }
body .container article header { background-position:center top; }
body .container article header h1 img { height:40px; width:auto; }
body .container article section img,
body .container article section video,
body .container article section iframe,
body .container article section .wp-caption { max-width:100%; }
body .container article section img { height:auto; }
body .container article .wp-block-column { min-width:0; }
body .container article section[class*="colnr-"]::after { content:""; display:table; clear:both; }
body .container article > a[name] { display:block; scroll-margin-top:110px; }
body.admin-bar .container article > a[name] { scroll-margin-top:142px; }
body.admin-bar .container header.top nav.menu.fixed.raus { top:32px; }

@media (max-width:1439px) {
  footer .rechts { float:none; width:1000px; max-width:calc(100% - 40px); margin:0 auto; }
  body .container header.top nav.menu.fixed a.fixedlogo { left:20px; width:250px; height:auto; }
  body .container header.top nav.menu.fixed a.fixedlogo img { width:100%; height:auto; }
  body .container header.top nav.menu.fixed ul { margin-right:20px; }
}
@media (max-width:1100px) {
  body .container header.top nav.menu.fixed a.fixedlogo { display:none; }
  body .container header.top nav.menu.fixed ul { float:none; margin-right:0; }
  /* Override the existing contact grid's inline gap. */
  body .container header.top .info ul { column-gap:24px !important; }
  body .container header.top .info ul li { font-size:22px; }
}
@media (max-width:900px) {
  body .container header.top { height:auto; min-height:620px; padding:10px 20px 42px; }
  body .container header.top nav.menu,
  body .container header.top nav.menu.fixed {
    position:relative; float:none; height:auto; top:auto; margin:0;
    background:transparent; box-shadow:none;
  }
  body .container header.top nav.menu ul,
  body .container header.top nav.menu.fixed ul {
    display:flex; flex-wrap:wrap; justify-content:center; gap:0 24px; float:none; margin:0;
  }
  body .container header.top nav.menu ul .menu-item { float:none; margin:0; text-align:center; }
  body .container header.top nav.menu ul .menu-item a { display:block; padding:0; min-height:44px; line-height:44px; }
  body .container header.top .headerlogo { position:static; height:auto; max-width:100%; margin:64px auto 72px; }
  body .container header.top .headerlogo h1 { font-size:clamp(30px,6.2vw,60px); letter-spacing:clamp(1px,.4vw,4px); }
  body .container header.top .headerlogo h2 { font-size:clamp(24px,4.7vw,45px); line-height:1.15; }
  body .container header.top .info { position:static; }
  body .container header.top .info ul { display:flex !important; flex-wrap:wrap; justify-content:center; gap:18px 28px; }
  body .container header.top .info ul li { line-height:1.4; }
  body .container article header { height:auto; min-height:117px; padding:25px 20px 32px; background-position:center bottom; }
  body .container article header h1 { line-height:1.4; overflow-wrap:anywhere; }
  body .container article header h1 img { margin-right:12px; vertical-align:middle; }
  body .container article > a[name],
  body.admin-bar .container article > a[name] { scroll-margin-top:16px; }
  body .container article #karte { height:440px; }
  footer { height:auto; min-height:50px; }
  footer .rechts { padding:12px 0; line-height:1.8; text-align:center; }
  footer a { display:inline-block; margin:0 12px; padding:8px 0; }
}
@media (max-width:781px) {
  body .container article { padding-bottom:60px; }
  body .container article section[class*="colnr-"] .dynamic-col { float:none; width:100%; margin-right:0; }
  body .container article .team .aerzte .wp-caption { margin:0 20px 30px; }
  /* Legacy team details open in flow on mobile instead of outside the viewport. */
  body .container article .team .wp-caption.teamanzeige { display:none; }
  body .container article .team .wp-caption.is-open .wp-caption-descr { display:block; width:100%; margin-top:24px; }
}
@media (max-width:540px) {
  body .container header.top nav.menu ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px; }
  body .container header.top nav.menu ul .menu-item a { font-size:14px; }
  body .container header.top .headerlogo { margin-top:44px; margin-bottom:48px; }
  body .container header.top .headerlogo img { max-width:100%; height:auto; }
  body .container header.top .info ul { flex-direction:column; align-items:center; gap:14px; }
  body .container header.top .info ul li { font-size:21px; max-width:100%; overflow-wrap:anywhere; }
  body .container article header h1 { font-size:22px; }
  body .container article #karte { height:340px; }
  body .container article blockquote { padding:15px 20px; }
  body .container article .alignleft,
  body .container article .alignright { float:none; margin-left:0; margin-right:0; }
}
@media (prefers-reduced-motion:reduce) {
  body .container header.top nav.menu.fixed { transition:none; }
}

/* Separate compact navigation: the original menu and page stay in place. */
.pertsch-mobile-nav { display:none; }
@media (max-width:1199px), (hover:none) and (pointer:coarse) {
  .pertsch-mobile-nav {
    display:block;
    position:fixed;
    top:var(--pertsch-menu-top, 0px);
    left:0;
    right:0;
    z-index:999;
    background:#fff;
    color:#3b3b3b;
    box-shadow:0 1px 5px #0003;
    font-family:"Dosis", sans-serif;
  }
  .pertsch-mobile-nav[hidden], .pertsch-mobile-nav [hidden] { display:none !important; }
  .pertsch-mobile-nav .pertsch-menu-toggle {
    display:block;
    box-sizing:border-box;
    width:100%;
    height:52px;
    margin:0;
    padding:0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
    border:0;
    border-radius:0;
    background:#fff;
    color:inherit;
    font:600 18px/1 "Dosis", sans-serif;
    text-align:right;
    cursor:pointer;
  }
  .pertsch-mobile-nav .pertsch-menu-toggle span { margin-right:8px; }
  .pertsch-mobile-nav #pertsch-mobile-links {
    max-height:calc(100vh - var(--pertsch-menu-top, 0px) - 52px);
    max-height:calc(100dvh - var(--pertsch-menu-top, 0px) - 52px);
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:4px max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    border-top:1px solid #e3edc6;
  }
  .pertsch-mobile-nav ul { list-style:none; padding:0; margin:0; }
  .pertsch-mobile-nav li { margin:0; }
  .pertsch-mobile-nav a {
    display:block;
    padding:14px 8px;
    color:#3b3b3b;
    font-size:16px;
    font-weight:600;
    line-height:1.4;
    text-decoration:none;
    text-transform:uppercase;
    overflow-wrap:anywhere;
  }
  .pertsch-mobile-nav a:hover { background:#f2f6e4; }
  .pertsch-mobile-nav a:focus-visible,
  .pertsch-mobile-nav button:focus-visible { outline:2px solid #5f7a14; outline-offset:-3px; }
  body .container article > a[name],
  body.admin-bar .container article > a[name] { scroll-margin-top:68px; }
}

