/* rns/site-header – top bar, sticky glass header, pill nav, burger + mobile nav, scroll progress.
   Ported from design/prototype/assets/rns.css ("scroll progress + header" + scroll-driven part).
   Burger below 1321 px (the full nav needs ~1210 px; HANDOFF §4 – keep this breakpoint). */

.scrollbar{position:fixed;left:0;top:0;height:3px;width:100%;background:var(--teal);transform-origin:0 50%;transform:scaleX(0);z-index:120;display:none}
.topbar{background:var(--ink);color:var(--on-dark);font-size:.86rem}
.topbar .wrap{max-width:1400px;display:flex;justify-content:space-between;align-items:center;gap:24px;min-height:40px;flex-wrap:wrap}
.rns .topbar a{color:var(--white);text-decoration:none;display:inline-flex;align-items:center;gap:8px;padding:12px 0;margin:-12px 0}
.rns .topbar a:hover{color:var(--teal-l)}
.topbar svg{width:15px;height:15px}
.topbar .tb-r{display:flex;gap:26px;align-items:center}
/* 761–1099 px (burger, top bar shown): slightly smaller text and tighter gaps so claim, contact
   and the dark switch stay on one line from 1000 px (1024 px: 49 px to spare). Below 1000 px the
   bar wraps to two lines; the claim text comes verbatim from the settings. */
@media (max-width:1099px){.topbar{font-size:.8rem}.topbar .wrap{gap:16px}.topbar .tb-r{gap:18px}.rns .topbar a{gap:6px}.topbar svg{width:14px;height:14px}}

.hdr{position:sticky;top:0;z-index:100;background:var(--hdr-bg);backdrop-filter:saturate(1.6) blur(16px);-webkit-backdrop-filter:saturate(1.6) blur(16px);border-bottom:1px solid var(--hdr-line)}
.admin-bar .hdr{top:var(--wp-admin--admin-bar--height,32px)}
.hdr .wrap{display:flex;align-items:center;gap:20px;min-height:84px;max-width:1400px;flex-wrap:nowrap;transition:min-height .3s}
.logo{display:flex;align-items:center;gap:12px;text-decoration:none;margin-right:auto;flex:none;white-space:nowrap}
/* Brand kit logo: horizontal (min. 240 px wide), compact below 640 px (guidelines: compact
   under 240 px). Never rotated, recoloured or distorted. */
.rns-lockup{display:block;flex:none}
.logo .lg-h{height:52px;width:auto;aspect-ratio:3781/816}
.logo .lg-c{display:none;height:40px;width:auto;aspect-ratio:1669.2/642}
.nav{display:flex;gap:2px;align-items:center;flex:none;padding:5px;border-radius:999px;background:var(--nav-bg);border:1px solid var(--line)}
.rns .nav>a,.rns .nav .nav-top{font-family:var(--fh);font-weight:500;font-size:.93rem;color:var(--heading);text-decoration:none;padding:9px 15px;border-radius:999px;white-space:nowrap;line-height:1.2;transition:background .2s,color .2s}
.rns .nav>a:hover,.rns .nav .nav-top:hover,.rns .mega[open]>.nav-top:not(.on){background:var(--card);color:var(--accent-ink)}
.rns .nav>a.on,.rns .nav .nav-top.on{background:var(--nav-on);color:var(--white)}
.hdr .hdr-cta{flex:none;min-height:46px;padding:0 22px}
.burger{display:none;width:48px;height:48px;border:1px solid var(--line);background:var(--card);border-radius:50%;align-items:center;justify-content:center;cursor:pointer;color:var(--heading);flex:none}
.burger svg{width:22px;height:22px}
.burger .i-close,.burger[aria-expanded="true"] .i-open{display:none}
.burger[aria-expanded="true"] .i-close{display:block}

.mnav{display:none;border-top:1px solid var(--line);background:var(--bg);padding:8px var(--gutter-x) 24px;animation:drop .35s var(--ease);max-height:calc(100vh - 84px);max-height:calc(100dvh - 84px);overflow-y:auto}
.rns .mnav a{display:flex;justify-content:space-between;align-items:center;min-height:56px;border-bottom:1px solid var(--line);font-family:var(--fh);font-weight:500;font-size:1.15rem;color:var(--heading);text-decoration:none}
.mnav a svg{width:20px;height:20px;color:var(--teal)}
.rns .mnav a.on{color:var(--teal-d)}
.rns .mnav .btn{margin-top:18px;width:100%;color:var(--white);justify-content:center;border-bottom:0;min-height:52px;font-size:1rem}
.rns .mnav .mnav-close{justify-content:center;border-bottom:0;font-size:1rem;color:var(--accent-ink);text-decoration:underline}
.hdr[data-enhanced] .mnav-close{display:none}

/* Without JS the burger is a link to #rns-mnav (:target); header.js swaps in the real button. */
.burger-js{display:none!important}
@media (max-width:1320px){
  .nav{display:none}
  .burger-nojs{display:inline-flex}
  .hdr[data-enhanced] .burger-nojs{display:none}
  .hdr[data-enhanced] .burger-js{display:inline-flex!important}
  .mnav:target,.hdr[data-enhanced] .mnav.is-open{display:block}
  .hdr[data-enhanced] .mnav:target:not(.is-open){display:none}
}
@media (min-width:1320.02px){.mnav{display:none!important}}
/* Full menu labels (Baureinigung, Industriereinigung, Sonderreinigung) need about 920 px of nav;
   on desktop (the header content is capped at 1400 px) the bar is compacted so it stays on one
   line without overlapping logo or buttons (measured 0.12.4: 790 px nav, 23 px to the logo at 1321 px). Same row height. */
@media (min-width:1320.02px){
  .hdr .wrap{gap:16px}
  .nav{gap:0;padding:4px}
  /* Item padding grows with the free space: 10 px at 1321–1360 px, up to 15 px from about 1410 px
     (the header content stops growing at 1400 px; the dark switch sits in the top bar since
     0.12.4). min-width:1320.02px instead of 1321px leaves no fractional-pixel gap to the burger
     breakpoint (zoomed browsers). */
  .rns .nav>a,.rns .nav .nav-top{padding:9px clamp(10px, calc(10px + (100vw - 1360px) / 10), 15px);font-size:.86rem}
  .mega>summary{gap:3px}
  .nav-top .chev{width:14px;height:14px}
  .hdr .hdr-cta{min-height:44px;padding:0 16px;font-size:.88rem;gap:6px}
  .hdr .hdr-cta svg{width:14px;height:14px}
}
@media (max-width:640px){.hdr .hdr-cta{display:none}.hdr .logo .lg-h{display:none}.hdr .logo .lg-c{display:block}}
@media (max-width:760px){.topbar{display:none}}

/* Scroll progress line + header elevation (progressive enhancement, HANDOFF §9). */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scrollbar{display:block;animation:grow linear both;animation-timeline:scroll(root)}
    @keyframes grow{to{transform:scaleX(1)}}
    .hdr{animation:hdr linear both;animation-timeline:scroll(root);animation-range:0 160px}
    @keyframes hdr{to{box-shadow:0 10px 30px -18px rgba(15,30,54,.45);background:var(--hdr-bg-2)}}
  }
}

/* Dark version switch (inc/theme-toggle.php, assets/js/header.js). Shown only with JS. */
.theme-toggle{display:inline-flex;width:44px;height:44px;border:1px solid var(--line);background:var(--card);border-radius:50%;align-items:center;justify-content:center;cursor:pointer;color:var(--heading);flex:none;padding:0;transition:border-color .2s,color .2s}
.theme-toggle:hover{border-color:var(--teal);color:var(--accent-ink)}
.theme-toggle svg{width:20px;height:20px}
.theme-toggle .i-sun,[data-theme="dark"] .theme-toggle .i-moon{display:none}
[data-theme="dark"] .theme-toggle .i-sun{display:block}
html:not(.rns-js) .theme-toggle{display:none}
/* Logo on the dark page: the kit's inverse colours (rns-logo-white.svg). */
[data-theme="dark"] .hdr .rns-lockup .lg-wm,[data-theme="dark"] .hdr .rns-lockup .mk-r{fill:var(--white)}
[data-theme="dark"] .hdr .rns-lockup .lg-sub{fill:var(--logo-inv-sub)}
[data-theme="dark"] .hdr .rns-lockup .mk-l{fill:var(--logo-inv-blue)}
[data-theme="dark"] .hdr .rns-lockup .mk-t{fill:var(--logo-inv-teal)}

/* "Leistungen" mega menu: <details class="mega"> in the pill nav. The panel spans the sticky
   header (its containing block): one column per service page (icon, title, card text) with the
   services as links to their sections. Works without JS; header.js adds outside click / Esc / hover. */
.mega>summary{list-style:none;display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none}
.mega>summary::-webkit-details-marker,.mnav-group>summary::-webkit-details-marker{display:none}
.nav-top .chev{width:16px;height:16px;transition:transform .25s var(--ease)}
.mega[open]>.nav-top .chev,.mnav-group[open]>summary .chev{transform:rotate(180deg)}
.mega-panel{position:absolute;left:0;right:0;top:100%;background:var(--bg);border-top:1px solid var(--line);border-bottom:1px solid var(--line);box-shadow:0 24px 40px -24px rgba(15,30,54,.35);animation:drop .3s var(--ease);max-height:calc(100vh - 84px);max-height:calc(100dvh - 84px);overflow-y:auto}
.mega-in{max-width:1400px;margin:0 auto;padding:22px var(--gutter-x) 24px}
/* Three service menus (0.12.1): one row per panel, one column per service page + the contact box;
   the panel is as wide as it needs (about 300 px per column), centred under the header. */
.mega-in{max-width:min(1400px,calc(var(--mega-cols,4) * 310px + 2 * var(--gutter-x)))}
.mega-cols{display:grid;grid-template-columns:repeat(var(--mega-cols,4),minmax(0,1fr));gap:14px}
.mega-col{padding:16px 16px 10px;border:1px solid var(--line);border-radius:var(--r-l);background:var(--card);display:flex;flex-direction:column}
.rns .mega-head{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--heading);padding:6px;margin:-6px -6px 6px;border-radius:var(--r);transition:background .2s}
.rns .mega-head:hover{background:var(--surface);color:var(--heading)}
.mega-head .hexi{flex:none;width:38px;height:42px}
.mega-head .hexi svg.ic{width:18px;height:18px}
.mega-head b{display:block;font-family:var(--fh);font-weight:600;font-size:.98rem;line-height:1.25}
.mega-head small{display:inline-block;margin-top:3px;padding:1px 8px;border:1px dashed var(--line-dash);border-radius:999px;color:var(--muted);font-size:.74rem;line-height:1.5}
.rns .mega-head.on b{color:var(--accent-ink)}
.mega-col.is-request{border-style:dashed;border-color:var(--line-dash)}
.mega-list{list-style:none;margin:0;padding:4px 0 0;border-top:1px solid var(--line)}
.rns .mega-list a{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;margin:0 -12px;border-radius:var(--r);font-size:.9rem;line-height:1.25;color:var(--heading);text-decoration:none;transition:background .2s,color .2s}
.mega-list a::before{content:"";width:5px;height:5px;flex:none;border-radius:50%;background:var(--teal);transition:transform .2s}
.rns .mega-list a:hover{background:var(--surface);color:var(--accent-ink)}
.mega-list a:hover::before{transform:scale(1.4)}
.mega-more{justify-content:center;gap:10px;background:var(--surface);border-color:transparent}
.mega-more b{font-family:var(--fh);font-weight:600;font-size:.98rem;color:var(--heading);line-height:1.3}
.mega-more>span{font-size:.88rem;color:var(--muted);line-height:1.45}
.rns .mega-more .mega-tel{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-family:var(--fh);font-weight:500;color:var(--heading);text-decoration:none}
.rns .mega-more .mega-tel:hover{color:var(--accent-ink)}
.mega-more .mega-tel svg{width:16px;height:16px}
.mega-more .btn{min-height:44px;padding:0 18px;justify-content:center}

/* Mobile nav: "Leistungen" as an accordion (sections, then their services). */
.mnav-group{border-bottom:1px solid var(--line)}
.mnav-group>summary{list-style:none;display:flex;justify-content:space-between;align-items:center;min-height:56px;cursor:pointer;font-family:var(--fh);font-weight:500;font-size:1.15rem;color:var(--heading)}
.mnav-group>summary.on{color:var(--teal-d)}
.mnav-group>summary .chev{width:20px;height:20px;color:var(--teal);transition:transform .25s var(--ease)}
.mnav-sec{margin:0 0 14px;padding-left:14px;border-left:2px solid var(--line)}
.rns .mnav .mnav-head{min-height:48px;border-bottom:0;font-size:1.02rem;font-weight:600}
.mnav-head small{margin-left:8px;padding:1px 8px;border:1px dashed var(--line-dash);border-radius:999px;font-family:var(--fb);font-weight:400;font-size:.74rem;color:var(--muted)}
.mnav-sec ul{list-style:none;margin:0;padding:0}
.rns .mnav .mnav-sec li a{min-height:44px;border-bottom:0;font-family:var(--fb);font-weight:400;font-size:.98rem}
[data-theme="dark"] .mnav-group>summary.on{color:var(--teal-l)}
/* The "auf Anfrage" line (plain text, never a link): the .addon look, compact. */

/* Dark version switch in the top bar (0.12.4): frees the header row for the full menu labels.
   Small round button on the ink bar; the hit area is 44 px (::before), like the top bar links.
   The header switch is hidden while the top bar is shown (from 761 px); below that, or when the
   top bar is switched off (RNS → Einstellungen), the header switch stays. */
.topbar .tb-toggle{position:relative;width:30px;height:30px;border-color:rgba(255,255,255,.28);background:transparent;color:var(--white)}
.topbar .tb-toggle::before{content:"";position:absolute;inset:-7px}
.topbar .tb-toggle:hover{border-color:var(--teal-l);color:var(--teal-l)}
.topbar .tb-toggle svg{width:16px;height:16px}
.topbar .tb-toggle:focus-visible{outline:3px solid var(--teal-l);outline-offset:3px}
@media (min-width:761px){.rns-site-header:has(.topbar) .hdr .theme-toggle{display:none}}
/* Mega menu hover: light spot + running border, shared with the service cards (components.css). */
.mega-col{transition:box-shadow .3s,transform .3s var(--ease)}
.mega-col:hover{box-shadow:0 14px 30px -18px color-mix(in srgb,var(--ring-2) 55%,transparent)}
