/* Edukacja PRO — przyklejony nagłówek Astry na telefonie.
   Działa tylko w widoku mobilnym Astry (.ast-header-break-point).
   Wysokość nagłówka mierzy skrypt i wpisuje do --wcep-nagl-h; 70px to
   wartość na pierwsze wyświetlenie, zanim skrypt ruszy. */

.wcep-nagl-fix.ast-header-break-point #masthead{
  /* #masthead trzyma miejsce po nagłówku, który wychodzi z obiegu strony. */
  min-height:var(--wcep-nagl-h,70px);
}

.wcep-nagl-fix.ast-header-break-point #ast-mobile-header{
  position:fixed;
  top:var(--wcep-nagl-top,0px);
  left:0;right:0;
  width:100%;
  z-index:990; /* pod menu wysuwanym, koszykiem bocznym i banerem cookies */
  background:#fff;
  box-shadow:0 0 0 rgba(6,59,76,0);
  transform:translateY(0);
  transition:
    box-shadow .25s ease,
    transform .3s cubic-bezier(.2,.7,.2,1),
    background-color .25s ease;
  will-change:transform;
}

/* Marginesy rzędów nagłówka (Astra daje np. margin-bottom:1em pod głównym
   paskiem) w zwykłym układzie były odstępem nad treścią. W przyklejonym
   nagłówku zostawałyby w jego środku i dokładały puste pole na dole. */
.wcep-nagl-fix.ast-header-break-point #masthead #ast-mobile-header .main-header-bar,
.wcep-nagl-fix.ast-header-break-point #masthead #ast-mobile-header .ast-primary-header-bar,
.wcep-nagl-fix.ast-header-break-point #masthead #ast-mobile-header .ast-above-header-bar,
.wcep-nagl-fix.ast-header-break-point #masthead #ast-mobile-header .ast-below-header-bar,
.wcep-nagl-fix.ast-header-break-point #masthead #ast-mobile-header .ast-main-header-wrap{
  margin-top:0;
  margin-bottom:0;
}

/* Po przewinięciu: cień i lekko przezroczyste tło z rozmyciem. */
.wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header{
  box-shadow:0 6px 20px rgba(6,59,76,.10);
}
@supports ((-webkit-backdrop-filter:blur(8px)) or (backdrop-filter:blur(8px))){
  .wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header,
  .wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header .main-header-bar,
  .wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header .ast-above-header-bar,
  .wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header .ast-below-header-bar{
    background-color:rgba(255,255,255,.92);
  }
  .wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header{
    -webkit-backdrop-filter:saturate(1.4) blur(8px);
    backdrop-filter:saturate(1.4) blur(8px);
  }
}

/* Po przewinięciu logo lekko się zmniejsza. Tylko transformacją: wysokość
   nagłówka zostaje ta sama, więc treść pod nim nigdy nie podskakuje. */
.wcep-nagl-fix.ast-header-break-point #ast-mobile-header .site-branding img,
.wcep-nagl-fix.ast-header-break-point #ast-mobile-header .custom-logo-link img{
  transform-origin:left center;
  transition:transform .3s ease;
}
.wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header .site-branding img,
.wcep-nagl-fix.ast-header-break-point.wcep-nagl-przewiniety #ast-mobile-header .custom-logo-link img{
  transform:scale(.86);
}

/* Tryb „chowaj przy przewijaniu w dół”. */
.wcep-nagl-fix.ast-header-break-point.wcep-nagl-schowany #ast-mobile-header{
  transform:translateY(calc(-100% - var(--wcep-nagl-top,0px) - 8px));
  box-shadow:none;
}

/* Menu typu „lista pod nagłówkiem” (dropdown) przewija się wewnątrz
   nagłówka, żeby długie menu nie uciekało poza ekran. */
.wcep-nagl-fix.ast-header-break-point.ast-main-header-nav-open #ast-mobile-header[data-type="dropdown"]{
  max-height:calc(100vh - var(--wcep-nagl-top,0px));
  max-height:calc(100dvh - var(--wcep-nagl-top,0px));
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
/* Przy otwartym menu nagłówek się nie chowa. */
.wcep-nagl-fix.ast-header-break-point.ast-main-header-nav-open #ast-mobile-header{
  transform:none;
}

/* Kotwice (#sekcja) nie lądują pod nagłówkiem. */
html.wcep-nagl-kotwice{scroll-padding-top:calc(var(--wcep-nagl-h,70px) + var(--wcep-nagl-top,0px) + 12px)}

@media (prefers-reduced-motion:reduce){
  .wcep-nagl-fix.ast-header-break-point #ast-mobile-header,
  .wcep-nagl-fix.ast-header-break-point #ast-mobile-header *{transition:none !important}
}
