/* FAQ – akordeon (klik = rozwinięcie) */
.pkbsg-faq {
    margin: 2em 0;
}

.pkbsg-faq-item {
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
}

.pkbsg-faq-item summary {
    cursor: pointer;
    padding: 14px 44px 14px 18px;
    font-weight: 600;
    list-style: none;
    position: relative;
    outline: none;
}

.pkbsg-faq-item summary::-webkit-details-marker {
    display: none;
}

.pkbsg-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.pkbsg-faq-item[open] summary::after {
    content: "\2013";
}

.pkbsg-faq-item summary:hover {
    background: #f6f7f7;
}

.pkbsg-faq-a {
    padding: 0 18px 14px;
}

/* Obraz w treści – mniejszy, wyśrodkowany, przyjazny dla oka */
.pkbsg-article-figure {
    max-width: 680px;
    margin: 1.8em auto;
    text-align: center;
}

.pkbsg-article-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
    display: block;
}

.pkbsg-article-figure figcaption {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 0.5em;
    text-align: center;
}

/* Spis treści */
.pkbsg-toc {
    background: var(--pkbsg-soft, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    margin: 1.5em 0;
}

.pkbsg-toc-title {
    margin: 0 0 8px;
    font-weight: 700;
}

.pkbsg-toc ul {
    margin: 0;
    padding-left: 18px;
}

.pkbsg-toc li {
    margin-bottom: 4px;
}

.pkbsg-toc .pkbsg-toc-sub {
    margin-left: 16px;
    list-style: circle;
}

/* Listy linków */
.pkbsg-internal-links,
.pkbsg-external-links {
    margin: 1.5em 0;
}

/* Polecane artykuły */
.pkbsg-related {
    margin: 2em 0;
}

.pkbsg-related ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pkbsg-related li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.pkbsg-related li a {
    font-weight: 600;
}

.pkbsg-related-desc {
    display: block;
    font-size: 0.9em;
    color: #64748b;
    margin-top: 2px;
}

/* Tabele responsywne (przewijanie w poziomie na mobile) */
.pkbsg-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
}

.pkbsg-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.pkbsg-table-wrap th,
.pkbsg-table-wrap td {
    padding: 8px 10px;
    border: 1px solid #e2e4e7;
    text-align: left;
}

/* Płynne obrazy w treści */
.pkbsg-faq img,
.pkbsg-cta img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 600px) {
    .pkbsg-faq-item summary {
        padding: 12px 40px 12px 14px;
        font-size: 15px;
    }

    .pkbsg-faq-a {
        padding: 0 14px 12px;
    }

    .pkbsg-article-figure figcaption {
        font-size: 0.8em;
    }

    .pkbsg-table-wrap th,
    .pkbsg-table-wrap td {
        padding: 6px 8px;
        font-size: 14px;
    }
}

/* === Ładniejszy układ wygenerowanego artykułu === */
.pkbsg-article {
    /* Kolor akcentu: nadpisywany kolorem z motywu (inline), z fallbackiem na zmienne motywu (Kadence + motywy blokowe). */
    --pkbsg-accent: var(--global-palette1, var(--wp--preset--color--theme-palette-1, var(--wp--preset--color--primary, var(--wp--preset--color--accent, var(--wp--preset--color--link, #2563eb)))));
    --pkbsg-soft: #f1f5f9;
    line-height: 1.75;
}

/* Płynne, responsywne rozmiary nagłówków — na desktopie zbliżone do motywu,
   a na mobile automatycznie mniejsze (clamp = min, płynnie, max). */
.pkbsg-article-title {
    margin: 0 0 0.6em;
    line-height: 1.2;
    font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.4rem);
}

.pkbsg-article h2 {
    margin: 1.8em 0 0.6em;
    padding-left: 14px;
    border-left: 4px solid var(--pkbsg-accent, #2563eb);
    line-height: 1.3;
    font-size: clamp(1.4rem, 1.05rem + 1.7vw, 1.95rem);
}

.pkbsg-article h3 {
    margin: 1.4em 0 0.5em;
    color: var(--pkbsg-accent, #2563eb);
    line-height: 1.35;
    font-size: clamp(1.2rem, 1rem + 1vw, 1.55rem);
}

.pkbsg-article h4 {
    margin: 1.2em 0 0.4em;
    line-height: 1.4;
    font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.25rem);
}

/* Na telefonach zmniejsz też odstępy nad nagłówkami (1.8em bywa za duże). */
@media (max-width: 600px) {
    .pkbsg-article h2 { margin-top: 1.3em; }
    .pkbsg-article h3 { margin-top: 1.1em; }
    .pkbsg-article h4 { margin-top: 1em; }
    .pkbsg-article { line-height: 1.7; }
}

.pkbsg-article p {
    margin: 0 0 1.1em;
}

.pkbsg-article ul,
.pkbsg-article ol {
    margin: 0 0 1.2em 1.4em;
}

.pkbsg-article li {
    margin-bottom: 0.4em;
}

/* Najważniejsze wnioski – wyróżniony blok */
.pkbsg-takeaways {
    background: var(--pkbsg-soft, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--pkbsg-accent, #2563eb);
    border-radius: 10px;
    padding: 6px 22px 18px;
    margin: 2em 0;
}

.pkbsg-takeaways h2 {
    border: 0;
    padding: 0;
    margin-top: 0.8em;
}

/* CTA – wyraźny box */
.pkbsg-cta {
    background: linear-gradient(135deg, var(--pkbsg-accent, #2563eb), #1e40af);
    color: #fff;
    border-radius: 12px;
    padding: 22px 26px;
    margin: 2em 0;
    text-align: center;
    font-size: 1.05em;
}

.pkbsg-cta p {
    margin: 0;
}

.pkbsg-cta a {
    color: #fff;
    text-decoration: underline;
}

/* Listy linków – delikatne tło */
.pkbsg-internal-links,
.pkbsg-external-links {
    background: var(--pkbsg-soft, #f1f5f9);
    border-radius: 10px;
    padding: 14px 20px;
}

.pkbsg-internal-links h3,
.pkbsg-external-links h3 {
    margin-top: 0;
}

/* TL;DR pod AI Overview */
.pkbsg-article .pkbsg-tldr {
    margin: 0 0 1.4em;
    padding: 14px 18px;
    background: var(--pkbsg-soft, #f1f5f9);
    border-left: 4px solid var(--pkbsg-accent, #2563eb);
    border-radius: 8px;
    font-size: 1.02em;
}
.pkbsg-article .pkbsg-tldr strong { color: var(--pkbsg-accent, #2563eb); }

/* Auto-linki wewnętrzne — delikatne podkreślenie */
.pkbsg-article a.pkbsg-auto-ilink {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* Sekcja lokalna „Obsługujemy w […]" */
.pkbsg-local {
    margin: 2em 0;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.pkbsg-local h2 { margin-top: 0; }
.pkbsg-local-map {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

/* Boks autora (E-E-A-T) */
.pkbsg-author {
    margin: 2em 0 0;
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.pkbsg-author h3 { margin: 0 0 10px; }
.pkbsg-author-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.pkbsg-author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex: 0 0 72px;
}
.pkbsg-author-meta { flex: 1 1 auto; }
.pkbsg-author-meta p { margin: 4px 0 0; color: #475569; }
@media (max-width: 600px) {
    .pkbsg-author-body { flex-direction: column; }
    .pkbsg-author-avatar { width: 64px; height: 64px; }
}

/* --- Sekcje spójne z motywem (Kadence-aware), minimalne style pomocnicze --- */
.pkbsg-section { margin: 2em 0; }
.pkbsg-section--light { padding: 18px 20px; background: #f8fafc; border-radius: 10px; }
.pkbsg-section--bg { padding: 22px 24px; background: var(--pkbsg-accent, #f1f5f9); color: #fff; border-radius: 10px; }
.pkbsg-section--border { padding: 18px 20px; border: 1px solid #e2e8f0; border-radius: 10px; }
.pkbsg-section--premium { padding: 22px 24px; border: 1px solid var(--pkbsg-accent, #2563eb); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
a.pkbsg-btn-cta { display: inline-block; }

/* Breadcrumbs (shortcode [pkbsg_breadcrumbs]) */
.pkbsg-breadcrumbs ol { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .9em; }
.pkbsg-breadcrumbs li { display: inline-flex; align-items: center; }
.pkbsg-breadcrumbs .pkbsg-bc-sep { margin: 0 4px; color: #94a3b8; }

/* Powiązane usługi (shortcode [pkbsg_services]) */
.pkbsg-services-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pkbsg-services-list li a { display: block; padding: 10px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; font-weight: 600; }
.pkbsg-services-list li a:hover { border-color: var(--pkbsg-accent, #2563eb); }

/* =========================================================================
   Generator realizacji / case study — sekcje premium
   ========================================================================= */
.pkbsg-cs {
    --pkbsg-accent: var(--global-palette1, var(--wp--preset--color--theme-palette-1, var(--wp--preset--color--primary, var(--wp--preset--color--accent, #1f6f54))));
    --pkbsg-cs-ink: #0f172a;
    --pkbsg-cs-muted: #5b6675;
    --pkbsg-cs-line: #e6e9ef;
    --pkbsg-cs-soft: #f6f8fb;
}
.pkbsg-cs-hero { margin: 0 0 1.4em; }
.pkbsg-cs-hero img { width: 100%; height: auto; display: block; border-radius: 16px; box-shadow: 0 18px 40px rgba(15,23,42,.14); }
.pkbsg-cs-lead { font-size: 1.18em; line-height: 1.65; color: var(--pkbsg-cs-ink); font-weight: 500; margin: 0 0 1.4em; }
.pkbsg-cs-body { line-height: 1.7; }

.pkbsg-cs-section { margin: 2em 0; }
.pkbsg-cs-section-title { font-size: 1.35em; margin: 0 0 .8em; position: relative; padding-left: 14px; }
.pkbsg-cs-section-title::before { content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 5px; border-radius: 4px; background: var(--pkbsg-accent); }

.pkbsg-cs-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pkbsg-cs-grid-scope { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.pkbsg-cs-tile {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px; background: #fff;
    border: 1px solid var(--pkbsg-cs-line); border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pkbsg-cs-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15,23,42,.1); border-color: var(--pkbsg-accent); }
.pkbsg-cs-tile-title { font-weight: 700; color: var(--pkbsg-cs-ink); font-size: 1.02em; }
.pkbsg-cs-tile-desc { color: var(--pkbsg-cs-muted); font-size: .92em; line-height: 1.55; }

/* Technologie — akcent na nazwie */
.pkbsg-cs-tile-tech .pkbsg-cs-tile-title { color: var(--pkbsg-accent); }
.pkbsg-cs-tile-tech .pkbsg-cs-tile-title::before { content: "▣ "; opacity: .65; }

/* Zakres prac — kompaktowe „badge" */
.pkbsg-cs-grid-scope .pkbsg-cs-tile { background: var(--pkbsg-cs-soft); padding: 12px 14px; }
.pkbsg-cs-tile-scope .pkbsg-cs-tile-title::before { content: "✓ "; color: var(--pkbsg-accent); font-weight: 800; }

/* Cechy projektu */
.pkbsg-cs-tile-feature { border-top: 3px solid var(--pkbsg-accent); }

.pkbsg-cs-figure { margin: 1.4em 0; }
.pkbsg-cs-figure img, .pkbsg-cs-img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--pkbsg-cs-line); }
.pkbsg-cs-figure figcaption { margin-top: .5em; font-size: .9em; color: var(--pkbsg-cs-muted); text-align: center; }
.pkbsg-cs-gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Baner CASE STUDY (zamiast zwykłego zdjęcia) */
.pkbsg-cs-banner { position: relative; border-radius: 18px; overflow: hidden; margin: 0 0 1.6em; background: linear-gradient(135deg, var(--pkbsg-accent), #0f172a); min-height: 220px; box-shadow: 0 18px 44px rgba(15,23,42,.18); }
.pkbsg-cs-banner-img { width: 100%; height: 100%; min-height: 220px; max-height: 460px; object-fit: cover; object-position: top center; display: block; }
.pkbsg-cs-banner-badge { position: absolute; top: 16px; left: 16px; z-index: 2; background: var(--pkbsg-accent); color: #fff; font-weight: 800; letter-spacing: .14em; font-size: .72em; padding: 7px 14px; border-radius: 999px; box-shadow: 0 6px 16px rgba(0,0,0,.28); text-transform: uppercase; }
.pkbsg-cs-banner-overlay { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 22px 20px; background: linear-gradient(to top, rgba(8,12,22,.92) 0%, rgba(8,12,22,.62) 55%, rgba(8,12,22,0) 100%); color: #fff; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pkbsg-cs-banner-kicker { font-size: .82em; opacity: .85; letter-spacing: .04em; }
.pkbsg-cs-banner-title { font-size: 1.5em; font-weight: 800; line-height: 1.2; margin: 0; color: #fff; }
.pkbsg-cs-banner-btn { display: inline-block; margin-top: 8px; background: #fff; color: #0f172a; font-weight: 700; text-decoration: none; padding: 10px 18px; border-radius: 10px; transition: transform .15s ease, background .15s ease, color .15s ease; }
.pkbsg-cs-banner-btn:hover { transform: translateY(-2px); background: var(--pkbsg-accent); color: #fff; }
.pkbsg-cs-banner-plain { padding: 36px 24px; min-height: 0; }
.pkbsg-cs-banner-plain .pkbsg-cs-banner-overlay { position: static; background: none; padding: 0; }
.pkbsg-cs-banner-plain .pkbsg-cs-banner-badge { position: static; display: inline-block; margin-bottom: 14px; }

/* CTA — zachęta i linki do mojej strony */
.pkbsg-cs-cta { margin: 2.4em 0 .6em; border-radius: 18px; padding: 30px 24px; background: linear-gradient(135deg, var(--pkbsg-accent), #0f172a); color: #fff; text-align: center; }
.pkbsg-cs-cta-title { font-size: 1.32em; font-weight: 800; margin: 0 0 6px; color: #fff; }
.pkbsg-cs-cta-text { margin: 0 auto 16px; max-width: 640px; opacity: .92; line-height: 1.6; }
.pkbsg-cs-cta-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pkbsg-cs-cta-btn { display: inline-block; text-decoration: none; padding: 11px 20px; border-radius: 10px; font-weight: 700; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.38); transition: background .15s ease, transform .15s ease; }
.pkbsg-cs-cta-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.24); color: #fff; }
.pkbsg-cs-cta-btn-primary { background: #fff; color: #0f172a; border-color: #fff; }
.pkbsg-cs-cta-btn-primary:hover { background: #f1f5f9; color: #0f172a; }

@media (max-width: 600px) {
    .pkbsg-cs-hero img { border-radius: 12px; }
    .pkbsg-cs-lead { font-size: 1.08em; }
    .pkbsg-cs-banner-title { font-size: 1.18em; }
    .pkbsg-cs-banner-overlay { padding: 18px 16px 14px; }
}
