/* Parafia Wiersze 1.2.31 — zabezpieczenie desktopu: mobilna wyszukiwarka nigdy nie jest widoczna poza mobile */
.pwi-mobile-search{display:none!important;}

@media (max-width:958px){
  .pwi-mobile-search.is-open{display:block!important;}
}

/* Parafia Wiersze 1.2.18 — większe logotypy po lewej w nagłówku mobilnym */
.pwi-mobile-header{display:none}
@media (max-width:958px){
  body.pwi-mobile-header-active .fixed-header-box,
  body.pwi-mobile-header-active header.main-header,
  body.pwi-mobile-header-active .main-header,
  body.pwi-mobile-header-active .header-wrapper,
  body.pwi-mobile-header-active #header-wrapper{
    display:none!important;
  }

  .pwi-mobile-header{
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    width:100%;
    min-height:76px;
    padding:7px clamp(14px, 3.5vw, 24px);
    box-sizing:border-box;
    background:#fff;
    border-bottom:0;
    position:relative;
    z-index:10020;
  }
  .pwi-mobile-header__left{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    flex:1 1 auto;
  }
  .pwi-mobile-header__parish,
  .pwi-mobile-header__arch{
    display:flex;
    align-items:center;
    flex:0 1 auto;
    min-width:0;
    text-decoration:none!important;
  }
  .pwi-mobile-header__parish img{
    display:block;
    width:auto;
    height:auto;
    max-width:184px;
    max-height:58px;
    object-fit:contain;
    object-position:left center;
  }
  .pwi-mobile-header__parish-fallback{
    color:#4E3425;
    font-size:16px;
    line-height:1.1;
    font-weight:700;
    white-space:nowrap;
  }
  .pwi-mobile-header__arch img{
    display:block;
    width:auto;
    height:55px;
    max-width:102px;
    object-fit:contain;
  }
  .pwi-mobile-header__actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:5px;
    flex:0 0 auto;
  }
  .pwi-mobile-header__icon{
    width:46px;
    height:46px;
    padding:0;
    border:0!important;
    border-radius:50%;
    background:transparent!important;
    color:#4E3425!important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-shadow:none!important;
    cursor:pointer;
  }
  .pwi-mobile-header__icon:hover,
  .pwi-mobile-header__icon:focus{
    background:#F8F3ED!important;
    color:#8D5A2F!important;
  }
  .pwi-mobile-header__icon svg{width:30px;height:30px;fill:currentColor;display:block}

  .pwi-mobile-search{
    position:fixed;
    inset:0;
    z-index:10050;
    background:rgba(255,255,255,.98);
    padding:18px;
    display:none;
  }
  .pwi-mobile-search.is-open{display:block}
  .pwi-mobile-search__close{
    float:right;
    border:0!important;
    background:transparent!important;
    color:#4E3425!important;
    font-size:34px;
    line-height:1;
    width:46px;
    height:46px;
    cursor:pointer;
  }
  .pwi-mobile-search form{
    clear:both;
    max-width:560px;
    margin:70px auto 0;
    display:flex;
    gap:8px;
  }
  .pwi-mobile-search input[type=search]{
    flex:1 1 auto;
    min-width:0;
    height:48px;
    padding:0 14px;
    border:1px solid #E7D8C9!important;
    border-radius:10px!important;
    background:#fff!important;
  }
  .pwi-mobile-search button[type=submit]{
    width:48px;
    height:48px;
    border:0!important;
    border-radius:10px!important;
    background:#8D5A2F!important;
    color:#fff!important;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .pwi-mobile-search button[type=submit] svg{width:21px;height:21px;fill:currentColor}
}

@media (max-width:420px){
  .pwi-mobile-header{padding-left:14px;padding-right:14px;gap:5px}
  .pwi-mobile-header__left{gap:5px}
  .pwi-mobile-header__parish img{max-width:150px;max-height:54px}
  .pwi-mobile-header__arch img{height:49px;max-width:92px}
  .pwi-mobile-header__actions{gap:2px}
  .pwi-mobile-header__icon{width:44px;height:44px}
  .pwi-mobile-header__icon svg{width:29px;height:29px}
}

/* Parafia Wiersze 1.2.19 — usuwa pustą przestrzeń pod nagłówkiem na pojedynczym wpisie */
@media (max-width:958px){
  body.pwi-mobile-header-active.single-post #main-content{
    margin-top:0!important;
    padding-top:0!important;
  }
  body.pwi-mobile-header-active.single-post #main-content > .limit-wrapper,
  body.pwi-mobile-header-active.single-post #main-content .limit-wrapper,
  body.pwi-mobile-header-active.single-post #main-content .page-wrapper{
    margin-top:0!important;
    padding-top:0!important;
  }
  body.pwi-mobile-header-active.single-post .parish-single-page-wrapper{
    margin-top:0!important;
    padding-top:10px!important;
  }
}

/* Parafia Wiersze 1.2.20 — bez przeskoku i bez pustego pasa nad treścią */
@media (max-width:958px){
  /* Ukrywamy nagłówek Vamtam od razu z CSS, nie dopiero po uruchomieniu JS. */
  .fixed-header-box,
  header.main-header,
  .main-header,
  .header-wrapper,
  #header-wrapper{
    display:none!important;
  }

  /* Kasujemy spacing całego łańcucha wrapperów pojedynczego wpisu. */
  body.single-post .boxed-layout.parish-single-layout,
  body.single-post .parish-single-layout .pane-wrapper,
  body.single-post .parish-single-layout #main-content,
  body.single-post .parish-single-layout #main,
  body.single-post .parish-single-layout .limit-wrapper,
  body.single-post .parish-single-layout .row.page-wrapper,
  body.single-post .parish-single-page-wrapper,
  body.single-post .parish-single-content-grid{
    margin-top:0!important;
    padding-top:0!important;
  }

  body.single-post .parish-single-card{
    margin-top:0!important;
  }
}

/* =========================================================
   1.2.21 — MOBILE: zwarty nagłówek + pewna obecność na stronie głównej
   ========================================================= */
@media (max-width:958px){
  /* Nagłówek ma dokładnie kontrolowaną wysokość — bez pustego pasa nad ikonami. */
  .pwi-mobile-header{
    height:88px!important;
    min-height:88px!important;
    max-height:88px!important;
    margin:0!important;
    padding:7px clamp(14px,3.5vw,24px)!important;
    line-height:normal!important;
    overflow:hidden!important;
  }

  .pwi-mobile-header__left,
  .pwi-mobile-header__actions{
    height:74px!important;
    min-height:74px!important;
    margin:0!important;
    padding:0!important;
    align-items:center!important;
  }

  .pwi-mobile-header__parish,
  .pwi-mobile-header__arch{
    height:74px!important;
    margin:0!important;
    padding:0!important;
    align-items:center!important;
  }

  .pwi-mobile-header__parish img{
    width:auto!important;
    height:68px!important;
    max-width:82px!important;
    max-height:68px!important;
    margin:0!important;
    padding:0!important;
    object-fit:contain!important;
  }

  .pwi-mobile-header__arch img{
    width:auto!important;
    height:64px!important;
    max-width:118px!important;
    max-height:64px!important;
    margin:0!important;
    padding:0!important;
    object-fit:contain!important;
  }

  .pwi-mobile-header__icon{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
    margin:0!important;
    padding:0!important;
  }
  .pwi-mobile-header__icon svg{
    width:31px!important;
    height:31px!important;
  }

  /* Gdy nagłówek jest fallbackiem z wp_footer, JS przenosi go na początek body.
     Ta klasa gwarantuje brak dodatkowych marginesów po przeniesieniu. */
  body.pwi-mobile-header-active > .pwi-mobile-header:first-of-type{
    margin-top:0!important;
  }

  /* Single: treść zaczyna się od razu pod zwartym nagłówkiem. */
  body.single-post .parish-single-page-wrapper,
  body.single-post .parish-single-content-grid,
  body.single-post .parish-single-card{
    margin-top:0!important;
  }
}

@media (max-width:420px){
  .pwi-mobile-header{
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .pwi-mobile-header__left,
  .pwi-mobile-header__actions,
  .pwi-mobile-header__parish,
  .pwi-mobile-header__arch{
    height:70px!important;
    min-height:70px!important;
  }
  .pwi-mobile-header__parish img{
    height:64px!important;
    max-height:64px!important;
    max-width:76px!important;
  }
  .pwi-mobile-header__arch img{
    height:59px!important;
    max-height:59px!important;
    max-width:108px!important;
  }
}

/* =========================================================
   1.2.22 — MOBILE SINGLE: usuwa odstęp NAD naszym nagłówkiem
   Vamtam na pojedynczych wpisach potrafi dodać do BODY offset
   równy wysokości starego sticky headera. Ponieważ używamy własnego
   nagłówka mobilnego, ten offset musi być wyzerowany.
   ========================================================= */
@media (max-width:958px){
  html{
    margin-top:0!important;
    padding-top:0!important;
  }
  body.single-post.pwi-mobile-header-active,
  body.single-post{
    margin-top:0!important;
    padding-top:0!important;
  }
  body.single-post > .pwi-mobile-header:first-of-type{
    margin-top:0!important;
    top:0!important;
  }
}

/* =========================================================
   1.2.24 — MOBILE SINGLE: korekta podciągnięcia nagłówka
   Na pojedynczych wpisach motyw nadrzędny pozostawia rezerwę wysokości
   starego nagłówka mimo jego ukrycia. Zerowanie margin/padding nie usuwa
   tej rezerwy, dlatego podciągamy wyłącznie nasz mobilny nagłówek o jej
   wysokość i kompensujemy przepływ dokumentu.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header{
    margin-top:-64px!important;
    margin-bottom:-8px!important;
  }
}
@media (max-width:420px){
  body.single-post .pwi-mobile-header{
    margin-top:-60px!important;
  }
}

/* =========================================================
   1.2.26 — MOBILE SINGLE: korekta odstępu między nagłówkiem a tytułem
   Nie przesuwamy już samego nagłówka. Zmniejszamy wyłącznie górny
   padding karty wpisu. Względem 1.2.25 obniżamy tytuł o 3 px, aby uzyskać docelowy odstęp ok. 19 px.
   Strona główna pozostaje bez zmian.
   ========================================================= */
@media (max-width:958px){
  body.single-post .parish-single-card{
    padding-top:9px!important;
  }
}

/* =========================================================
   1.2.28 — MOBILE SINGLE: obniżenie całego rzędu nagłówka o 5 px
   Tylko pojedyncze wpisy. Nie zmienia strony głównej ani odstępu tytułu.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header__left,
  body.single-post .pwi-mobile-header__actions{
    transform:translateY(0px)!important;
  }
}

/* =========================================================
   1.2.33 — MOBILE SINGLE: faktyczne obniżenie całego nagłówka o 5 px
   Poprzednia 1.2.32 nie zawierała aktywnej reguły CSS. Tutaj zmieniamy
   rzeczywisty ujemny margin-top nagłówka tylko na pojedynczych wpisach.
   Strona główna pozostaje bez zmian.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header{
    margin-top:-59px!important;
  }
}
@media (max-width:420px){
  body.single-post .pwi-mobile-header{
    margin-top:-55px!important;
  }
}


/* =========================================================
   1.2.34 — MOBILE SINGLE: delikatne obniżenie całego nagłówka o 1 px
   Zamiast korekty 5 px z 1.2.33 stosujemy 1 px.
   Strona główna i zabezpieczenie wyszukiwarki desktopowej bez zmian.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header{
    margin-top:-63px!important;
  }
}
@media (max-width:420px){
  body.single-post .pwi-mobile-header{
    margin-top:-59px!important;
  }
}

/* =========================================================
   1.2.35 — MOBILE SINGLE: docelowe obniżenie całego nagłówka o 12 px
   Zmieniamy wyłącznie rzeczywisty ujemny margin-top nagłówka we wpisach.
   Strona główna i zabezpieczenie wyszukiwarki desktopowej bez zmian.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header{
    margin-top:-52px!important;
  }
}
@media (max-width:420px){
  body.single-post .pwi-mobile-header{
    margin-top:-48px!important;
  }
}


/* =========================================================
   1.2.36 — MOBILE SINGLE: 18 px + pełna widoczność + krawędzie
   Zachowuje obniżenie rzędu o 18 px, usuwa przycinanie dolnej części
   logotypów/ikon i rozciąga układ od lewej do prawej krawędzi.
   Tylko pojedyncze wpisy mobilne — strona główna bez zmian.
   ========================================================= */
@media (max-width:958px){
  body.single-post .pwi-mobile-header{
    overflow:visible!important;
    padding-left:0!important;
    padding-right:0!important;
  }
}
@media (max-width:420px){
  body.single-post .pwi-mobile-header{
    height:102px!important;
    min-height:102px!important;
    max-height:102px!important;
    overflow:visible!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  body.single-post .pwi-mobile-header__left{
    justify-content:flex-start!important;
  }
  body.single-post .pwi-mobile-header__actions{
    justify-content:flex-end!important;
  }
}
/* =========================================================
   1.2.40 — MOBILE SINGLE: geometria nagłówka jak na stronie głównej
   Po przywróceniu stabilnej bazy 1.2.39 pozostawiamy sam układ nagłówka
   bez zmian, a wyrównujemy wyłącznie jego odstęp/gabaryt góra–dół do HOME.
   Nadpisanie z ID wygrywa z późnym CSS wtyczki dla single-post.
   ========================================================= */
@media (max-width:958px){
  html body.single-post #pwi-mobile-header.pwi-mobile-header{
    height:88px!important;
    min-height:88px!important;
    max-height:88px!important;
    margin-top:0!important;
    margin-bottom:0!important;
    padding:7px clamp(14px,3.5vw,24px)!important;
    overflow:hidden!important;
  }
  html body.single-post #pwi-mobile-header .pwi-mobile-header__left,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__actions,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__parish,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__arch{
    height:74px!important;
    min-height:74px!important;
  }
}
@media (max-width:420px){
  html body.single-post #pwi-mobile-header.pwi-mobile-header{
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
  html body.single-post #pwi-mobile-header .pwi-mobile-header__left,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__actions,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__parish,
  html body.single-post #pwi-mobile-header .pwi-mobile-header__arch{
    height:70px!important;
    min-height:70px!important;
  }
}

/* =========================================================
   1.2.41 — MOBILE SINGLE: pełna szerokość nagłówka jak na HOME
   Na pojedynczym wpisie Vamtam może ograniczać #pwi-mobile-header
   szerokością nadrzędnego wrappera. Wyciągamy wyłącznie mobilny nagłówek
   do szerokości viewportu, zachowując geometrię i padding z 1.2.40.
   Strona główna i desktop pozostają bez zmian.
   ========================================================= */
@media (max-width:958px){
  html body.single-post #pwi-mobile-header.pwi-mobile-header{
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    box-sizing:border-box!important;
  }
}


/* =========================================================
   1.2.55 — MOBILE: Facebook i wyszukiwarka bliżej prawej krawędzi
   Przesuwamy wyłącznie grupę ikon akcji o 10 px w prawo.
   Logotypy, wysokość nagłówka i pozostała geometria bez zmian.
   ========================================================= */
@media (max-width:958px){
  html body #pwi-mobile-header .pwi-mobile-header__actions{
    transform:translateX(10px)!important;
  }
}
