/*
 * Zaplecza - custom styles for ketoprofen.zamienniki.pl
 */

/* Stopka */
footer .wp-block-group.alignfull.lemmony-mobile-text-center:first-child {
    padding-bottom: 0 !important;
}
footer, footer * {
    color: #25405A;
}

/* Breadcrumby */
.breadcrumps-section {
    height: auto;
    overflow: visible;
}
.wp-block-boldblocks-breadcrumb-block {
    margin-bottom: 16px;
    font-size: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.wp-block-boldblocks-breadcrumb-block::-webkit-scrollbar {
    display: none;
}
.wp-block-boldblocks-breadcrumb-block ol {
    flex-wrap: nowrap;
    white-space: nowrap;
    width: max-content;
}
.wp-block-boldblocks-breadcrumb-block a {
    display: inline-block;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
}

/* Blok Linkowanie */
.linkowanie .btn-more {
    font-size: 18px;
}

/* Blok Poradniki feed — nadpisanie stylów suplementów */
.guides-medium-image-section .poradniki-feed__title {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 16px;
}
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left {
    margin-bottom: 0 !important;
}
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-right {
    margin-bottom: 0 !important;
}
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left__image,
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left__image a,
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left__image img {
    border-radius: 16px !important;
    overflow: hidden;
}
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.guides-medium-image-section .additional-guides-item .additional-guides-item__column-left__image a {
    display: block;
}
@container guides-medium (max-width: 330px) {
    .additional-guides-item.item-border .additional-guides-item__column-left {
        margin-bottom: 8px !important;
    }
}

/* Przycisk "Zobacz więcej" (shortcode [zobacz]) */
.btn-zobacz-wrap {
    display: inline;
}
.btn-zobacz-punct {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}
.btn-zobacz {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 15px;
    font-size: 14px;
    color: #0E4466;
    background: none;
    border: 1px solid #88A7B6;
    border-radius: 16px;
    text-decoration: none;
    margin: 4px 0;
    font-weight: 600;
}
.btn-zobacz::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #0E4466;
}
.btn-zobacz:hover {
    background: #F4FAF8;
    color: #0E4466;
}

/* Odnośniki do bibliografii (sup) */
.post-content sup {
    background: #DEEBF4;
    color: #0E4466;
}
.post-content sup a {
    color: #0E4466;
    text-decoration: none;
}

/* FAQ — accordion */
.taxonomy-faq__question {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    margin-bottom: 0;
}
.taxonomy-faq__question::-webkit-details-marker {
    display: none;
}
.taxonomy-faq .taxonomy-faq__answer-wrap {
    overflow: hidden;
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}
.taxonomy-faq__answer {
    padding-top: 0;
}
.taxonomy-faq__item[open] .taxonomy-faq__answer {
    padding-top: 16px;
}

/* Dzieci leku — lista zamiast gridu */
.children-list .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr !important;
}

/* Sekcje w treści posta — każda jako osobna karta */
.post-content .wp-block-post-content > section,
.post-content .wp-block-post-content > div[style*="border-left"] {
    background: #fff;
    padding: 16px;
    border-radius: 24px;
    margin-bottom: 16px;
}

.post-content .wp-block-post-content > section > h3:first-child,
.post-content .wp-block-post-content > section > h2:first-child {
    margin-top: 0;
}

.post-content .wp-block-post-content > section h2 {
    font-size: 20px;
    line-height: 1.3;
}

/* Sekcja "Ważne" w treści posta */
.post-content div[style*="border-left"][style*="397BF6"] {
    font-size: 15px;
    line-height: 1.6;
    border-radius: 6px;
    background-color: #EEF3FF !important;
    border: 1px solid #C5D7FC;
    padding: 16px !important;
}

/* Ukrycie poziomego scrolla */
html, body {
    overflow-x: hidden;
}

/* Zamiana jasnoniebieskiego tła na jasnozielone */
.wp-block-group[style*="background-color:#f3f8ff"] {
    background-color: #F4FAF8 !important;
}

/* =========================
   Reset styli z styles1.css (suplementy)
   ========================= */

/* Wyłącz stary hamburger fixed po lewej */
.menu.wp-block-navigation .wp-block-navigation__responsive-container-open {
    position: static !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: auto !important;
}

/* Wyłącz ukrywanie kolumny z menu */
.wp-block-columns > .wp-block-column:first-child:has(.menu) {
    flex-basis: auto !important;
    min-width: auto !important;
    width: auto !important;
    overflow: visible !important;
}


/* Wyłącz stare style headera z suplementów */
.header .wp-block-site-logo {
    margin-left: 0 !important;
}

.header .custom-logo-link img {
    max-width: none !important;
}

/* Logo z lewej, menu wycentrowane względem całej strony */
.zaplecza-header-nav {
    width: 100%;
}

.zaplecza-header-row {
    position: relative;
    flex-wrap: nowrap !important;
}
.zaplecza-header-row img {
    max-height: 52px;
}

/* Dynamiczna nawigacja główna */
.zaplecza-header-row .zaplecza-main-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.zaplecza-main-nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.zaplecza-main-nav a {
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #0E4466;
    text-decoration: none;
}
.zaplecza-main-nav a:hover {
    color: #1DA477;
}

.zaplecza-header-row nav.wp-block-navigation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
}

/* Przycisk Leki.pl w headerze */
.zaplecza-header-btn {
    margin-left: auto;
}

.zaplecza-header-btn .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 83px;
    height: 34px;
    padding: 8px 16px !important;
    background-color: #1DA477 !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    border-radius: 16px !important;
    text-decoration: none;
}

.zaplecza-header-btn .wp-block-button__link::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("../images/icons/arrow-up-circle.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.zaplecza-header-btn .wp-block-button__link:hover {
    background-color: #178d66 !important;
    color: #ffffff !important;
}

/* =========================
   Reużywalne klasy (utility)
   ========================= */

/* Karta z ikoną w lewym górnym rogu */
.ui-card-icon {
    position: relative;
    padding-top: 56px !important;
}

.ui-card-icon::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 16px;
    width: 52px;
    height: 38px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.ui-card-icon--hand::before {
    background-image: url("../images/icons/hand.svg");
}

/* Tytuł i excerpt w ui-card */
.ui-card .wp-block-post-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.ui-card.post-content h2 {
    font-size: 20px;
}
.ui-card.post-content h4 {
    font-size: 16px;
    margin: 16px 0;
}

/* Padding na kontent (bez obrazków) */
.content-pad-16 .wp-block-post-title,
.content-pad-16 .wp-block-post-excerpt,
.content-pad-16 .wp-block-read-more,
.content-pad-16 .wp-block-post-author,
.content-pad-16 .wp-block-heading {
    padding-left: 16px;
    padding-right: 16px;
}

.content-pad-16 .wp-block-separator {
    margin-left: 16px;
    margin-right: 16px;
}

.content-pad-16 {
    padding-bottom: 16px;
}

.content-pad-16.ui-card-icon::before {
    left: 32px;
}

.ui-card .wp-block-columns {
    margin-bottom: 0;
}

/* Kolumny z równą wysokością kart */
.equal-height > .wp-block-column {
    display: flex;
    flex-direction: column;
}

.equal-height > .wp-block-column > .ui-card {
    flex: 1;
}

/* Blok post-author — avatar + tekst wycentrowane w pionie */
.wp-block-post-author {
    display: flex;
    align-items: center;
}

.wp-block-post-author__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.wp-block-post-author__name {
    margin: 0;
    line-height: 1.2;
}

.wp-block-post-author__date {
    font-size: 14px;
    color: #6B8C8B;
    margin: 0;
    line-height: 1.2;
}

/* Nagłówek z ikoną po lewej */
.heading-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    margin-bottom: 24px;
}

.heading-icon::before {
    content: "";
    display: inline-block;
    width: 60px;
    height: 60px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.heading-icon--article::before {
    background-image: url("../images/icons/article.svg");
}

.heading-icon--drugs::before {
    background-image: url("../images/icons/drugs.png");
}

.heading-icon--diseases::before {
    background-image: url("../images/icons/diseases.svg");
}

/* Link-przycisk z okrągłą ikoną po lewej */
.btn-link-icon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0E4466 !important;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
}

.btn-link-icon:hover {
    color: #1DA477 !important;
}

.btn-link-icon::before {
    content: "";
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #F4F4F4;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Warianty ikon do użycia razem z .btn-link-icon */
.icon-arrow-right::before {
    background-image: url("../images/icons/arrow-long-right.png");
}

/* Label */
.zaplecza-label {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}

/* Wycentrowanie w pionie */
.v-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Padding pionowy na sekcjach */
.section-pad-y {
    padding-top: 48px;
    padding-bottom: 16px;
}

/* Padding boczny 16px */
.pad-x-16 {
    padding-left: 16px;
    padding-right: 16px;
}

/* Margin 16px */
.margin-16 {
    margin: 16px;
}

.margin-b-16 {
    margin-bottom: 16px;
}

.margin-t-16 {
    margin-top: 16px;
}

/* Font size 16px */
.font-16 {
    font-size: 16px;
}

/* Border radius na sekcjach */
.section-rounded {
    border-radius: 16px;
}

/* Margin pionowy 24px */
.margin-y-24 {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
}

/* Białe tło */
.white-background {
    background-color: #ffffff;
}

/* Gapy na kolumnach */
.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

/* Flex: elementy rozłożone z wyrównaniem w pionie */
.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Karty w AQL — jednakowa wysokość */
.wp-block-post-template > li {
    display: flex;
    flex-direction: column;
}

.wp-block-post-template > li > .zaplecza-article-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Karty w karuzeli — jednakowa wysokość */
.swiper-slide {
    height: auto;
}

.swiper-slide > .zaplecza-article-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}


.swiper-slide .zaplecza-article-card > *:last-child {
    padding-bottom: 16px;
}

.swiper-wrapper {
    align-items: stretch;
}

/* Strzałki karuzeli */
.scb-carousel-wrapper .swiper-button-prev,
.scb-carousel-wrapper .swiper-button-next {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    background-image: url("../images/icons/arrow-carousel-zaplecza.svg");
    border: none;
    border-radius: 0;
    opacity: 1;
    padding: 0;
    color: transparent;
}

.scb-carousel-wrapper .swiper-button-prev::after,
.scb-carousel-wrapper .swiper-button-next::after {
    content: "";
    display: none;
}

.scb-carousel-wrapper .swiper-button-prev {
    background-image: url("../images/icons/arrow-carousel-zaplecza-left.svg");
    transform: translateX(-50%) rotate(0deg);
}

/* Pierwsza litera wielka (reszta nietknięta) */
.first-letter-upper::first-letter {
    text-transform: uppercase;
}

/* Nawigacja substancji - poziome menu */
.substance-nav {
    display: flex;
    justify-content: flex-start;
    position: relative;
    padding-top: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    overflow: visible;
}

.substance-nav::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #DEEBF4;
}

.substance-nav__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.substance-nav__list::-webkit-scrollbar {
    display: none;
}

/* Dropdown przeniesiony do .substance-nav przez JS */
.substance-nav > .substance-nav__subnav--floating {
    position: absolute;
    z-index: 100;
}

.substance-nav__item {
    flex-shrink: 0;
}

.substance-nav__link {
    color: #0E4466;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    display: block;
    padding: 8px 0;
    -webkit-tap-highlight-color: transparent;
}

.substance-nav__link:hover {
    color: #1DA477;
}

.substance-nav__link--no-href {
    cursor: default;
}

/* Podstrony w nawigacji substancji */
.substance-nav__item.has-subnav {
    position: relative;
}

.substance-nav__subnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 12px 0;
    padding-top: 20px;
    background: #ffffff;
    border: 1px solid #DEEBF4;
    border-radius: 8px;
    min-width: 200px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.substance-nav__item.has-subnav::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
}

.substance-nav__item.has-subnav:hover .substance-nav__subnav {
    display: block;
}

.substance-nav__subitem {
    padding: 0;
}

.substance-nav__sublink {
    display: block;
    padding: 6px 16px;
    color: #0E4466;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.substance-nav__sublink:hover {
    color: #1DA477;
    background: #F4FAF8;
}

/* Strzałki nawigacji substancji - tylko desktop */
@media (min-width: 769px) {
    .substance-nav__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        background-color: #F4FAF8;
        border: 1px solid #DEEBF4;
        border-radius: 50%;
        cursor: pointer;
        opacity: 0.6;
        transition: opacity 0.2s;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 16px 16px;
    }

    .substance-nav__arrow:hover {
        opacity: 1;
    }

    .substance-nav__arrow--left {
        left: -40px;
        background-image: url("../images/icons/chevron-left.svg");
    }

    .substance-nav__arrow--right {
        right: -40px;
        background-image: url("../images/icons/chevron-right.svg");
    }
}


/* =========================
   Mobile (max 768px)
   ========================= */
@media (max-width: 768px) {

    /* Header mobile - hamburger z prawej, bez przycisku Leki.pl */
    .zaplecza-header-btn {
        display: none !important;
    }

    .zaplecza-header-row nav.wp-block-navigation {
        position: static !important;
        transform: none !important;
        left: auto !important;
    }

    .zaplecza-header-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    /* Nadpisanie starych styli z suplementów */
    .menu.wp-block-navigation .wp-block-navigation__responsive-container-open {
        position: static !important;
        left: auto !important;
    }

    .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none !important;
    }

    /* Hamburger - przyczepiony do prawej */
    .zaplecza-header-row .wp-block-navigation__responsive-container-open {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px !important;
        height: 40px !important;
        border: none !important;
        border-radius: 0 !important;
        background: none !important;
        padding: 0 !important;
        margin-left: auto;
        position: static !important;
        box-shadow: none !important;
    }

    .zaplecza-header-row .wp-block-navigation__responsive-container-open svg {
        width: 28px !important;
        height: 28px !important;
        color: #0E4466;
    }

    /* Nawigacja substancji mobile */
    .substance-nav__arrow {
        display: none;
    }

    .substance-nav__list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .substance-nav__list::-webkit-scrollbar {
        display: none;
    }

}

/* Kontener z marginesami bocznymi 24px */
.pad-x-24 {
    padding-left: 24px;
    padding-right: 24px;
}

/* Tytuł artykułu — 20px */
.zaplecza-article-title,
.zaplecza-article-title a {
    font-size: 20px !important;
    line-height: 1.4;
}

.zaplecza-article-title {
    margin-bottom: 8px;
}

.zaplecza-article-title a {
    color: #0E4466;
    text-decoration: none;
}

.zaplecza-article-title a:hover {
    color: #1DA477;
}

/* Obrazek artykułu — border radius 16px (klasa na figure) */
.zaplecza-article-image img {
    border-radius: 16px;
}

.zaplecza-article-image {
    margin-bottom: 0;
}

.image-label-wrapper {
    margin-bottom: 0;
}

.image-label-wrapper .wp-block-image {
    margin-bottom: 0;
}

/* Obrazek z rozmyciem na krawędziach (fade) */
figure.img-fade,
.wp-block-post-featured-image.img-fade {
    position: relative !important;
    overflow: hidden;
}

figure.img-fade::after,
.wp-block-post-featured-image.img-fade::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(255, 255, 255, 0.95) 70%,
        rgba(255, 255, 255, 1) 80%
    );
    pointer-events: none;
    z-index: 1;
}

/* Link "Więcej →" z zieloną strzałką */
.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0E4466;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
}

.btn-more:hover {
    color: #178d66;
}

.btn-more::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("../images/icons/arrow-right-more.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Obrazek z etykietą (image-label) */
.image-label-wrapper {
    position: relative;
}

.image-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.image-label--orange {
    color: #A44D1D;
    background-color: #FEF5F0;
}

.image-label--green {
    color: #15934E;
    background-color: #F0FAF4;
}

.image-label--blue {
    color: #117DFF;
    background-color: #EFF5FF;
}

.image-label--pink {
    color: #910477;
    background-color: #FEF0FB;
}

/* Karta artykułu w AQL — padding, border, odstępy (klasa na Group) */
.zaplecza-article-card {
    padding: 16px;
    border: 1px solid #00000014;
    border-radius: 16px;
}

.zaplecza-article-card > * + * {
    margin-top: 16px;
}

.zaplecza-article-card > *:not(.wp-block-image):not(.wp-block-post-featured-image):not(.image-label-wrapper):not(.zaplecza-article-image):not(.wp-block-separator) {
    padding-left: 16px;
    padding-right: 16px;
}

.zaplecza-article-card > .wp-block-separator {
    margin-left: 16px;
    margin-right: 16px;
}

.zaplecza-article-card {
    padding-bottom: 16px;
}

.content-pad-16 {
    padding-bottom: 16px;
}

/* Obrazek hero w sekcji substancji */
.img-hero-substance img {
    max-width: 100%;
    height: 474px;
    object-fit: cover;
    border-radius: 16px;
}

/* Moduły dodatkowe — style jak taxonomy-faq */
.moduly-dodatkowe {
    font-size: 15px;
}

/* Tytuły sekcji FAQ i Moduły — zerowanie marginesów */
h3.taxonomy-faq__title,
h3.moduly-dodatkowe__title {
    margin: 0 0 16px 0 !important;
    font-size: 20px;
}

.moduly-dodatkowe .modul {
    padding: 16px;
    margin-bottom: 16px;
}

.moduly-dodatkowe .modul:last-child {
    margin-bottom: 0;
}

.moduly-dodatkowe .modul h3 {
    margin-top: 0 !important;
    margin-bottom: 16px;
    font-size: 15px;
}

.moduly-dodatkowe .modul > p {
    margin: 0;
}

/* Sidebar — sekcje w prawej kolumnie */
.sidebar-section {
    margin-bottom: 0;
}

.sidebar-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.sidebar-section .wp-block-post-template {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section .wp-block-post-title,
.sidebar-section .zaplecza-article-title,
.sidebar-section .zaplecza-article-title a,
.sidebar-section h4 {
    font-size: 16px !important;
    line-height: 1.4;
    margin: 0;
}

.sidebar-section .item-border {
    padding: 8px 12px;
}

.sidebar-section .wp-block-post-template {
    gap: 0 !important;
}

.sidebar-section .wp-block-post-template > li {
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
}

.sidebar-section .wp-block-post-template > li:last-child {
    margin-bottom: 0 !important;
}

.sidebar-section .wp-block-post-template > li > .item-border {
    margin: 0;
}

.sidebar-section .item-border,
.sidebar-section .item-border h4,
.sidebar-section .item-border div {
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}


/* Kolumny szablonu - gap 0 */
.zaplecza-main-columns {
    gap: 16px;
}

/* Layout 2 kolumnowy — treść + sidebar 437px */
.two-col-layout {
    gap: 24px;
}

.two-col-layout > .wp-block-column:last-child {
    flex: 0 0 437px;
    max-width: 437px;
}

@media (max-width: 768px) {
    .two-col-layout > .wp-block-column:last-child {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Główna treść */
.zaplecza-main-content {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Odstęp między headerem a contentem */
:root .wp-site-blocks > header.site-header + .wp-block-group.is-layout-constrained:first-child,
:root .wp-site-blocks > header.site-header + .wp-block-group {
    margin-top: 74px !important;
    margin-block-start: 74px !important;
}

@media (max-width: 1150px) {
    .wp-site-blocks > header.site-header + .wp-block-group.zaplecza-main-content {
        margin-top: 82px !important;
    }
}

.zaplecza-main-content .wp-block-columns {
    margin-bottom: 16px;
}

.zaplecza-main-content .main-description {
    margin-bottom: 16px;
}


/* Pierwsza grupa po headerze - margin-top równy wysokości headera */
.wp-site-blocks > header.site-header + .wp-block-group {
    margin-top: 50px !important;
}

@media (max-width: 1150px) {
    .wp-site-blocks > header.site-header + .wp-block-group {
        margin-top: 50px !important;
    }
}

/* =========================
   Mobile — marginesy i paddingi (na końcu pliku!)
   ========================= */
@media (max-width: 768px) {
    .zaplecza-main-content {
        padding-left: 8px;
        padding-right: 8px;
    }

    .pad-x-24 {
        padding-left: 8px;
        padding-right: 8px;
    }

    .zaplecza-article-card > *:not(.wp-block-image):not(.wp-block-post-featured-image):not(.image-label-wrapper):not(.zaplecza-article-image):not(.wp-block-separator) {
        padding-left: 12px;
        padding-right: 12px;
    }

    .zaplecza-article-card > .wp-block-separator {
        margin-left: 12px;
        margin-right: 12px;
    }

    .content-pad-16 .wp-block-post-title,
    .content-pad-16 .wp-block-post-excerpt,
    .content-pad-16 .wp-block-read-more,
    .content-pad-16 .wp-block-post-author,
    .content-pad-16 .wp-block-heading {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-pad-16 .wp-block-separator {
        margin-left: 12px;
        margin-right: 12px;
    }

    /* Global padding na mobile — zmniejszenie */
    .has-global-padding {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Sekcje z tłem na pełną szerokość mobile */
    .wp-block-group.has-background {
        margin-left: -8px;
        margin-right: -8px;
        padding-left: 8px;
        padding-right: 8px;
    }
}
