/*! NBC Mobile v7.006 · M6 Release Core Contract — QA correction
    One mobile source of truth for global rhythm, type, header, controls and materials.
    Page-family composition migrates in M2–M5. */

@media (max-width: 760px){
  html{
    --m7-bg:#06130d;
    --m7-bg-soft:#0a1a12;
    --m7-bg-raised:#0d2117;
    --m7-paper:#f3f1e9;
    --m7-paper-soft:#ebe8de;
    --m7-ink:#0a1710;
    --m7-text:#f3f5ef;
    --m7-muted:#aeb8b0;
    --m7-muted-strong:#c7cec7;
    --m7-accent:#8dd6a2;
    --m7-accent-strong:#a6e8b7;
    --m7-line:rgba(226,240,230,.16);
    --m7-line-paper:rgba(8,31,19,.16);
    --m7-gutter:clamp(18px,5.15vw,24px);
    --m7-section:clamp(62px,16vw,72px);
    --m7-section-tight:clamp(46px,12vw,54px);
    --m7-section-feature:clamp(78px,20vw,88px);
    --m7-radius:18px;
    --m7-header-h:64px;
    --m7-inline-start:max(var(--m7-gutter),env(safe-area-inset-left,0px));
    --m7-inline-end:max(var(--m7-gutter),env(safe-area-inset-right,0px));

    /* Bridge the historic mobile variable vocabulary into the v7 source of truth. */
    --m-gutter:var(--m7-gutter);
    --nbc-mobile-gutter:var(--m7-gutter);
    --nbc-page-gutter:var(--m7-gutter);
    --nbc-gutter:var(--m7-gutter);
    --layout-gutter:var(--m7-gutter);
    --m-header-h:var(--m7-header-h);
    --nbc-mobile-header:var(--m7-header-h);
    --m-section:var(--m7-section);
    --nbc-mobile-section:var(--m7-section);
    --nbc-mobile-section-standard:var(--m7-section);
    --nbc-layout-section:var(--m7-section);
    --space-section:var(--m7-section);
    --section-space:var(--m7-section);
    --m-section-tight:var(--m7-section-tight);
    --nbc-mobile-section-tight:var(--m7-section-tight);
    --nbc-mobile-section-compact:var(--m7-section-tight);
    --nbc-layout-section-compact:var(--m7-section-tight);
    --space-section-compact:var(--m7-section-tight);
    --section-space-tight:var(--m7-section-tight);
    --m-section-loose:var(--m7-section-feature);
    --nbc-mobile-section-feature:var(--m7-section-feature);
    --m-surface:var(--m7-bg-soft);
    --m-surface-deep:var(--m7-bg);
    --m-paper:var(--m7-paper);
    --m-paper-ink:var(--m7-ink);
    --m-radius:var(--m7-radius);
    --m7-ease:cubic-bezier(.22,.72,.18,1);
    scroll-padding-top:calc(var(--m7-header-h) + env(safe-area-inset-top,0px) + 14px);
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }

  body[data-mobile-art="v7"]{
    min-width:0;
    overflow-x:clip;
    background:var(--m7-bg);
    font-size:17px;
    line-height:1.6;
    font-kerning:normal;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
  }

  body[data-mobile-art="v7"] main,
  body[data-mobile-art="v7"] main > *,
  body[data-mobile-art="v7"] section,
  body[data-mobile-art="v7"] article,
  body[data-mobile-art="v7"] aside,
  body[data-mobile-art="v7"] figure{
    min-width:0;
  }

  body[data-mobile-art="v7"] .wrap,
  body[data-mobile-art="v7"] .p7-wrap{
    width:100%;
    max-width:none;
    margin-inline:auto;
    padding-left:var(--m7-inline-start);
    padding-right:var(--m7-inline-end);
  }

  body[data-mobile-art="v7"] :where(h1,h2,h3,h4,p,li,blockquote,figcaption){
    overflow-wrap:break-word;
  }

  body[data-mobile-art="v7"] :where(h1,h2,h3){
    margin-top:0;
    text-wrap:balance;
    letter-spacing:-.035em;
  }

  body[data-mobile-art="v7"] :where(h1,.hero h1,.service-hero h1,.ep-hero h1,.case2-hero h1,.ac-founder-hero h1,.local-hero h1){
    font-size:clamp(2.45rem,11.1vw,3rem);
    line-height:.98;
    letter-spacing:-.052em;
  }

  body[data-mobile-art="v7"] :where(h2,.p7-title){
    font-size:clamp(2.05rem,9.2vw,2.45rem);
    line-height:1.02;
  }

  body[data-mobile-art="v7"] :where(h3){
    font-size:clamp(1.38rem,6.25vw,1.65rem);
    line-height:1.12;
    letter-spacing:-.028em;
  }

  body[data-mobile-art="v7"] :where(p,li){
    hanging-punctuation:first last;
  }

  body[data-mobile-art="v7"] :where(.lead,.hero-lead,.service-hero__lead,.ep-hero__lead,.ac-founder-hero__lead,.local-hero__lead){
    font-size:clamp(1.04rem,4.5vw,1.18rem);
    line-height:1.55;
  }

  body[data-mobile-art="v7"] :where(.eyebrow,.mono,[class*="kicker"],[class*="eyebrow"],[class*="__number"]){
    writing-mode:horizontal-tb;
    text-orientation:mixed;
    max-width:100%;
    min-width:0;
    letter-spacing:.15em;
  }

  body[data-mobile-art="v7"] img,
  body[data-mobile-art="v7"] video,
  body[data-mobile-art="v7"] canvas,
  body[data-mobile-art="v7"] svg{
    max-width:100%;
  }

  /* Tactile contract */
  body[data-mobile-art="v7"] :where(a.btn,button,.button,.lm-btn,a.nav-cta,.nbc-mobile-header-cta,[role="button"],[role="tab"]){
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }

  body[data-mobile-art="v7"] :where(a.btn,.btn-solid,.btn-outline,.button,.lm-btn){
    min-height:54px;
    padding:14px 20px;
    border-radius:16px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    font-size:.94rem;
    line-height:1.1;
    font-weight:700;
  }

  body[data-mobile-art="v7"] :where(button,[role="button"],[role="tab"],summary){
    min-height:44px;
  }

  body[data-mobile-art="v7"] :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]),
    select,textarea
  ){
    min-height:50px;
    font-size:16px;
  }

  body[data-mobile-art="v7"] textarea{min-height:132px;}

  /* Material contract — ownership is local, never inherited through a nested surface.
     v7 intentionally exposes tokens instead of recoloring an entire descendant tree. */
  body[data-mobile-art="v7"] [data-nbc-material="deep"],
  body[data-mobile-art="v7"] [data-surface="dark"]{
    --m7-surface-bg:var(--m7-bg);
    --m7-surface-text:var(--m7-text);
    --m7-surface-muted:var(--m7-muted);
    color:var(--m7-surface-text);
  }

  body[data-mobile-art="v7"] [data-nbc-material="evidence"],
  body[data-mobile-art="v7"] [data-surface="paper"]{
    --m7-surface-bg:var(--m7-paper);
    --m7-surface-text:var(--m7-ink);
    --m7-surface-muted:#526057;
    color:var(--m7-surface-text);
  }

  body[data-mobile-art="v7"] [data-nbc-material="instrument"],
  body[data-mobile-art="v7"] [data-surface="instrument"]{
    --m7-surface-bg:var(--m7-bg-raised);
    --m7-surface-text:var(--m7-text);
    --m7-surface-muted:var(--m7-muted-strong);
    color:var(--m7-surface-text);
  }

  /* Global mobile header — quiet in hero, contextual after first screen. */
  body[data-mobile-art="v7"] .site-header{
    position:fixed;
    z-index:1000;
    inset:0 0 auto 0;
    height:calc(var(--m7-header-h) + env(safe-area-inset-top,0px));
    padding-top:env(safe-area-inset-top,0px);
    background:linear-gradient(180deg,rgba(4,15,10,.94),rgba(4,15,10,.82));
    border-bottom:1px solid rgba(224,240,229,.10);
    backdrop-filter:blur(18px) saturate(118%);
    -webkit-backdrop-filter:blur(18px) saturate(118%);
    transition:transform .34s var(--m7-ease),background .28s ease,border-color .28s ease;
  }

  body[data-mobile-art="v7"][data-v7-header-visibility="hidden"]:not(.menu-open) .site-header{
    transform:translate3d(0,-105%,0);
  }

  body[data-mobile-art="v7"] .site-header > .wrap.nav,
  body[data-mobile-art="v7"] .site-header .nav{
    height:var(--m7-header-h);
    min-height:var(--m7-header-h);
    width:100%;
    max-width:none;
    padding-left:var(--m7-inline-start);
    padding-right:var(--m7-inline-end);
    margin:0;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
  }

  body[data-mobile-art="v7"] .site-header .brand{
    grid-column:1;
    display:flex;
    align-items:center;
    width:96px;
    min-width:0;
    transition:width .28s var(--m7-ease),opacity .2s ease;
  }

  body[data-mobile-art="v7"] .site-header .brand-logo{
    display:block;
    width:100%;
    height:auto;
    max-height:46px;
    object-fit:contain;
    object-position:left center;
  }

  body[data-mobile-art="v7"] .site-header nav{
    grid-column:3;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    min-width:0;
  }

  body[data-mobile-art="v7"] .site-header .burger{
    width:44px;
    height:44px;
    min-width:44px;
    min-height:44px;
    margin:0;
    border:1px solid rgba(229,241,232,.20);
    border-radius:14px;
    background:rgba(255,255,255,.025);
    color:transparent;
    font-size:0;
    position:relative;
    display:grid;
    place-items:center;
    transition:background .2s ease,border-color .2s ease,transform .2s ease;
  }

  body[data-mobile-art="v7"] .site-header .burger::before,
  body[data-mobile-art="v7"] .site-header .burger::after{
    content:"";
    position:absolute;
    left:13px;
    width:18px;
    height:1.5px;
    border-radius:2px;
    background:var(--m7-text);
    transition:transform .25s var(--m7-ease),top .25s var(--m7-ease);
  }
  body[data-mobile-art="v7"] .site-header .burger::before{top:17px;box-shadow:0 5px 0 var(--m7-text);}
  body[data-mobile-art="v7"] .site-header .burger::after{top:27px;}
  body[data-mobile-art="v7"].menu-open .site-header .burger::before{top:21px;box-shadow:none;transform:rotate(45deg);}
  body[data-mobile-art="v7"].menu-open .site-header .burger::after{top:21px;transform:rotate(-45deg);}

  body[data-mobile-art="v7"] .site-header .nbc-mobile-context{
    grid-column:2;
    justify-self:start;
    min-width:0;
    max-width:100%;
    display:flex;
    align-items:center;
    opacity:0;
    transform:translateY(3px);
    pointer-events:none;
    transition:opacity .22s ease,transform .28s var(--m7-ease);
  }
  body[data-mobile-art="v7"] .site-header .nbc-mobile-context b{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:10px;
    line-height:1;
    letter-spacing:.15em;
    text-transform:uppercase;
    color:var(--m7-muted-strong);
    font-weight:500;
  }
  body[data-mobile-art="v7"] .site-header .nbc-mobile-context span{display:none;}

  body[data-mobile-art="v7"] .site-header .nbc-mobile-header-cta{
    display:none;
    min-height:44px;
    align-items:center;
    justify-content:center;
    padding:0 11px;
    border:0;
    color:var(--m7-accent-strong);
    background:transparent;
    font-size:12px;
    line-height:1;
    font-weight:700;
    letter-spacing:-.01em;
    text-decoration:none;
  }

  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .brand{
    width:62px;
  }
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header > .wrap.nav,
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nav{
    grid-template-columns:62px minmax(0,1fr) auto auto;
    gap:8px;
  }
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header nav{grid-column:4;}
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nbc-mobile-context{
    opacity:1;
    transform:none;
  }
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nbc-mobile-header-cta{
    grid-column:3;
    display:inline-flex;
  }

  /* Full-screen navigation: fewer chrome elements, strong information scent. */
  body[data-mobile-art="v7"] .site-header nav #menu.open{
    position:fixed;
    z-index:-1;
    inset:0;
    width:100vw;
    max-width:none;
    height:100dvh;
    margin:0;
    padding-top:calc(var(--m7-header-h) + env(safe-area-inset-top,0px) + 34px);
    padding-right:var(--m7-inline-end);
    padding-bottom:calc(26px + env(safe-area-inset-bottom,0px));
    padding-left:var(--m7-inline-start);
    overflow-y:auto;
    overscroll-behavior:contain;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    background:
      radial-gradient(75% 40% at 82% 10%,rgba(78,171,105,.10),transparent 72%),
      #06130d;
    border:0;
    border-radius:0;
    box-shadow:none;
  }

  body[data-mobile-art="v7"] .site-header nav #menu.open > li{
    width:100%;
    margin:0;
    padding:0;
    border-bottom:1px solid var(--m7-line);
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open > li > a,
  body[data-mobile-art="v7"] .site-header nav #menu.open .nav-summary{
    width:100%;
    min-height:58px;
    padding:14px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    text-align:left;
    color:var(--m7-text);
    font-size:clamp(1.38rem,6.4vw,1.7rem);
    line-height:1.05;
    letter-spacing:-.035em;
    font-weight:700;
    text-decoration:none;
    background:none;
    border:0;
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open .nav-sub{
    position:static;
    width:100%;
    padding:0 0 14px;
    margin:0;
    background:none;
    border:0;
    box-shadow:none;
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open .nav-sub a{
    min-height:44px;
    padding:8px 0 8px 14px;
    display:flex;
    align-items:center;
    color:var(--m7-muted-strong);
    font-size:15px;
    line-height:1.3;
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open .nav-cta{
    margin-top:18px;
    min-height:54px;
    border-radius:16px;
    background:var(--m7-paper);
    color:var(--m7-ink);
    justify-content:center;
    font-size:15px;
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open > .nbc-premium-menu-intro{
    display:none;
  }

  body[data-mobile-art="v7"].menu-open{
    overflow:hidden;
  }

  /* Focus is part of premium, not an afterthought. */
  body[data-mobile-art="v7"] :focus-visible{
    outline:2px solid var(--m7-accent-strong);
    outline-offset:3px;
  }

  /* Footer becomes a calm ledger rather than a dense desktop footer. */
  body[data-mobile-art="v7"] .site-footer{
    padding-bottom:calc(24px + env(safe-area-inset-bottom,0px));
  }
  body[data-mobile-art="v7"] .site-footer .wrap{padding-left:var(--m7-inline-start);padding-right:var(--m7-inline-end);}
  body[data-mobile-art="v7"] .site-footer .footer-main{
    display:block;
  }
  body[data-mobile-art="v7"] .site-footer .footer-navigation-row{
    display:grid;
    grid-template-columns:1fr;
    gap:0;
    margin-top:32px;
    border-top:1px solid var(--m7-line);
  }
  body[data-mobile-art="v7"] .site-footer .footer-navigation-row a{
    min-height:48px;
    padding:12px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid var(--m7-line);
  }
  body[data-mobile-art="v7"] .site-footer .footer-meta{
    margin-top:28px;
    display:grid;
    gap:8px;
    font-size:12px;
    line-height:1.45;
  }
}

@media (max-width:350px){
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nbc-mobile-context{display:none;}
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header > .wrap.nav,
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nav{
    grid-template-columns:58px minmax(0,1fr) auto auto;
  }
}

@media (prefers-reduced-motion:reduce){
  body[data-mobile-art="v7"] *,
  body[data-mobile-art="v7"] *::before,
  body[data-mobile-art="v7"] *::after{
    scroll-behavior:auto!important;
  }
  body[data-mobile-art="v7"] .site-header,
  body[data-mobile-art="v7"] .site-header *,
  body[data-mobile-art="v7"] :where(a.btn,button,.button,.lm-btn){
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}

/* M1 legacy-bridge: explicit v7 header ownership wins over historical mobile states. */
@media (max-width:760px){
  body[data-mobile-art="v7"] :where(a.btn,.btn-solid,.btn-outline,.button,.lm-btn){
    min-height:54px!important;
  }
  body[data-mobile-art="v7"] .site-header .nav > .nbc-mobile-context{
    position:static!important;
    left:auto!important;
    top:auto!important;
    max-width:100%!important;
    transform:translateY(3px)!important;
    visibility:hidden!important;
    opacity:0!important;
  }
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nav > .nbc-mobile-context{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    transform:none!important;
  }
  body[data-mobile-art="v7"] .site-header .nav > .nbc-mobile-header-cta{
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    transform:translateY(2px)!important;
  }
  body[data-mobile-art="v7"][data-v7-header-state="context"] .site-header .nav > .nbc-mobile-header-cta{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    transform:none!important;
    min-height:44px!important;
    padding:0 10px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--m7-accent-strong)!important;
    border-bottom:1px solid rgba(166,232,183,.32)!important;
  }
  body[data-mobile-art="v7"].menu-open .site-header .nav > :is(.nbc-mobile-context,.nbc-mobile-header-cta){
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
  body[data-mobile-art="v7"] .site-header nav #menu.open > .nbc-premium-menu-intro{
    display:none!important;
  }
}

/* M6 release correction — enforce the v7 header hide/reveal contract over legacy !important transforms. */
@media (max-width:760px){
  body[data-mobile-art="v7"][data-v7-header-visibility="hidden"]:not(.menu-open) .site-header{
    transform:translate3d(0,-105%,0)!important;
  }
  body[data-mobile-art="v7"][data-v7-header-visibility="visible"] .site-header,
  body[data-mobile-art="v7"].menu-open .site-header{
    transform:translate3d(0,0,0)!important;
  }
}

/* M6 visual release correction — premium display typography must never fall back
   to arbitrary mid-word wrapping. German discretionary/automatic hyphenation
   and authored <wbr>/soft-hyphen opportunities remain available. */
@media (max-width:760px){
  body[data-mobile-art="v7"] main h1{
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  body[data-mobile-art="v7"][data-m7a-active="about"] .nbc-about-hero-copy h1,
  body[data-mobile-art="v7"][data-m7a-active="regional"] .authority-hero h1,
  body[data-mobile-art="v7"][data-m7a-active="contact"] .ac-intake-hero h1{
    max-width:100%!important;
  }
}
@media (max-width:430px){
  body[data-mobile-art="v7"][data-m7a-active="about"] .nbc-about-hero-copy h1,
  body[data-mobile-art="v7"][data-m7a-active="regional"] .authority-hero h1,
  body[data-mobile-art="v7"][data-m7a-active="contact"] .ac-intake-hero h1,
  body#nbc-page[data-mobile-art="v7"][data-m7a-active="goettingen"] .local-hero h1{
    font-size:clamp(35px,10.8vw,46px)!important;
  }
}

/* M6 narrow-width copy polish — preserve authored German compound breakpoints
   instead of legacy arbitrary emergency wrapping in the About lead. */
@media (max-width:430px){
  body[data-mobile-art="v7"][data-m7a-active="about"] .nbc-about-hero-lead{
    overflow-wrap:normal!important;
    word-break:normal!important;
    -webkit-hyphens:manual!important;
    hyphens:manual!important;
  }
}
