/* Blog „Wiedza z pokładu” 1:1 z Figmą (eksport-2210/blog): /blog, /blog/{dział}, /blog/{wpis}.
   Ładowany po content.css i plans.css (okruszki, nagłówek ze zdjęciem i mozaika galerii są wspólne z gotowymi planami).
   Kolor działu przychodzi w zmiennych sekcji: --from (kolor poprzedniego działu), --bg, --glow i --tag (BlogCategory::TONES). */

/* Nagłówek bloga */
.blog-head { display: flex; flex-direction: column; align-items: center; padding: 41px var(--gutter) 0; text-align: center; }
.blog-head h1 { margin: 16px 0 0; font-size: 56px; font-weight: 500; line-height: 1.2; color: var(--navy-600); }
.blog-head__lead { margin: 22px 0 0; font-size: var(--fs-body-1); line-height: 1.4; color: var(--navy-600); }

/* Menu działów i wyszukiwarka pod nagłówkiem */
.blog-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto; padding: 36px var(--gutter) 16px; }
.blog-bar__nav ul { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 0; list-style: none; }
.blog-bar__nav a { display: inline-block; padding: 4px 0; font-size: var(--fs-body-3); font-weight: 700; color: var(--navy-600); text-decoration: none; border-bottom: 2px solid transparent; }
.blog-bar__nav a:hover { border-bottom-color: var(--orange-500); }
.blog-search { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.blog-search label { font-size: var(--fs-body-3); font-weight: 700; color: var(--navy-600); }
.blog-search__field { position: relative; display: block; width: 228px; }
.blog-search input { width: 100%; height: 48px; padding: 0 44px 0 16px; border: 1px solid var(--gray-150); border-radius: var(--radius-full); background: var(--white); font: inherit; font-size: var(--fs-body-3); color: var(--navy-700); -webkit-appearance: none; appearance: none; }
.blog-search input::placeholder { color: var(--gray-500); opacity: 1; }
.blog-search input::-webkit-search-cancel-button { display: none; }
.blog-search input:focus { outline: 2px solid var(--primary-700); outline-offset: 0; border-color: var(--primary-700); }
.blog-search button { position: absolute; top: 50%; right: 12px; display: inline-flex; padding: 2px; border: 0; background: none; color: var(--gray-500); transform: translateY(-50%); cursor: pointer; }
.blog-search button:hover { color: var(--navy-600); }

/* Dział: tło z poświatą w rogach jak w Figmie; u góry przejście z koloru poprzedniego działu */
.blog-section {
    --from: var(--white); --bg: var(--orange-100); --glow: var(--orange-200); --tag: var(--orange-600);
    position: relative; padding: 96px var(--gutter) 90px; scroll-margin-top: var(--nav-h);
    background:
        radial-gradient(42% 38% at 100% 88%, var(--glow), transparent 70%),
        radial-gradient(34% 30% at 0% 12%, var(--glow), transparent 70%),
        linear-gradient(180deg, var(--from) 0, var(--bg) 220px, var(--bg) 100%);
}
/* Wspólne tło działów (index): przyklejone do ekranu, kolor ustawia skrypt podczas przewijania */
.blog-flow { position: relative; }
.blog-flow__bg { display: none; }
.blog-flow--live > .blog-flow__bg {
    --bg: #ffffff; --glow: #ffffff;
    display: block; position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; pointer-events: none;
    background:
        radial-gradient(42% 38% at 100% 88%, var(--glow), transparent 70%),
        radial-gradient(34% 30% at 0% 12%, var(--glow), transparent 70%),
        var(--bg);
}
.blog-flow--live > .blog-section { z-index: 0; background: transparent; }
/* Wejście z białego nagłówka i wyjście do białego FAQ bez ostrej krawędzi */
.blog-flow--live > .blog-section:first-of-type::before,
.blog-flow--live > .blog-section:last-of-type::after { content: ""; position: absolute; left: 0; right: 0; z-index: -1; height: 220px; pointer-events: none; }
.blog-flow--live > .blog-section:first-of-type::before { top: 0; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); }
.blog-flow--live > .blog-section:last-of-type::after { bottom: 0; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.blog-section__inner { max-width: 1080px; margin: 0 auto; }
.blog-section__title { margin: 0 0 48px; font-size: var(--fs-h1); font-weight: 500; line-height: 1.2; color: var(--navy-600); }
.blog-section__title a { color: inherit; text-decoration: none; }
.blog-section__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.blog-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-bottom: 48px; }
.blog-section__head .blog-section__title { margin: 0; font-size: 56px; }
.blog-section--category { padding-top: 100px; padding-bottom: 100px; }

/* Górny rząd działu: duży wpis 500 px i trzy mniejsze obok */
.blog-section__top { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 500px); justify-content: space-between; gap: 0 80px; }
.blog-list, .blog-grid { margin: 0; padding: 0; list-style: none; }
.blog-list > li { padding: 0 0 32px; border-bottom: 1px solid rgba(31, 41, 103, .07); }
.blog-list > li + li { padding-top: 32px; }
.blog-section__top + .blog-grid { margin-top: 32px; padding-top: 32px; border-top: 1px solid rgba(31, 41, 103, .07); }
.blog-section__top:has(.blog-card--big) + .blog-grid { border-top: 0; padding-top: 0; }
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 80px; }
.blog-grid > li { padding: 32px 0; border-bottom: 1px solid rgba(31, 41, 103, .07); }
.blog-grid > li:nth-child(-n+2) { padding-top: 0; }
.blog-grid > li:nth-last-child(-n+2):nth-child(odd), .blog-grid > li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Karta wpisu */
.blog-card { display: flex; align-items: flex-start; gap: 24px; }
.blog-card__photo { flex: none; display: block; width: 124px; height: 124px; overflow: hidden; border-radius: var(--radius-md); background: linear-gradient(160deg, var(--primary-200), var(--primary-600) 60%, var(--navy-600)); }
.blog-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.blog-card:hover .blog-card__photo img { transform: scale(1.03); }
.blog-card__body { min-width: 0; }
.blog-card__meta { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-small); line-height: 20px; color: var(--gray-500); }
.blog-card__tag { display: inline-flex; align-items: center; height: 20px; padding: 0 12px; border-radius: var(--radius-full); background: var(--white); color: var(--tag, var(--orange-600)); font-size: 10px; font-weight: 700; white-space: nowrap; }
.blog-card__title { margin: 0; font-size: var(--fs-h5); font-weight: 500; line-height: 24px; color: var(--navy-600); }
.blog-card__title a { color: inherit; text-decoration: none; }
.blog-card__title a:hover { text-decoration: underline; }
.blog-card__lead { margin: 8px 0 0; overflow: hidden; font-size: var(--fs-body-3); line-height: 20px; color: var(--gray-500); white-space: nowrap; text-overflow: ellipsis; }
.blog-card--big { flex-direction: column; gap: 24px; }
.blog-card--big .blog-card__photo { width: 100%; height: auto; aspect-ratio: 500 / 330; border-radius: var(--radius-lg); }
.blog-card--big .blog-card__meta { margin-bottom: 12px; }
.blog-card--big .blog-card__title { font-size: var(--fs-h3); line-height: 1.2; }
.blog-card--big .blog-card__lead { display: -webkit-box; margin-top: 12px; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }

.blog-more { margin: 62px 0 0; text-align: center; }
.blog-more a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-body-3); font-weight: 700; color: var(--navy-600); text-decoration: none; }
.blog-more a:hover { text-decoration: underline; }
.blog-empty, .blog-found { margin: 0 0 32px; font-size: var(--fs-body-2); color: var(--gray-500); }
.blog-empty--page { padding: 96px var(--gutter); text-align: center; }
.blog-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 32px; margin-top: 56px; font-size: var(--fs-body-3); color: var(--gray-500); }
.blog-pages a { font-weight: 700; color: var(--navy-600); }
.blog-faq .faq-list { padding: 120px 0; }

/* Wpis */
.blog-preview { margin: 0; padding: 12px var(--gutter); background: var(--orange-200); color: var(--orange-text); font-size: var(--fs-body-3); font-weight: 700; text-align: center; }
.blog-hero { min-height: 427px; }
.blog-hero .plan-hero__pill { text-decoration: none; }
.blog-hero h1 { max-width: 720px; }
.blog-article { max-width: calc(768px + 2 * 24px); margin: 0 auto; padding: 120px 24px 0; }
.blog-body { color: var(--navy-600); font-size: var(--fs-body-2); line-height: 1.375; }
.blog-body > :first-child { margin-top: 0; }
.blog-body p, .blog-body ul, .blog-body ol { margin: 0 0 22px; }
.blog-body__lead { font-size: var(--fs-body-1); font-weight: 700; line-height: 1.2; }
.blog-body p.blog-body__lead { margin-bottom: 24px; }
.blog-body * + .blog-body__lead { margin-top: 56px; }
.blog-body h2 { margin: 40px 0 24px; font-size: var(--fs-h2); font-weight: 500; line-height: 1.1; scroll-margin-top: calc(var(--nav-h) + 16px); }
.blog-body h3 { margin: 40px 0 16px; font-size: var(--fs-h5); font-weight: 700; line-height: 1.2; }
.blog-body ul { padding: 0 0 0 21px; list-style: none; }
.blog-body ul li { position: relative; }
.blog-body ul li + li, .blog-body ol li + li { margin-top: 8px; }
.blog-body ul li::before { content: ""; position: absolute; left: -17px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary-500); }
.blog-body ol { padding-left: 22px; }
.blog-body ol li::marker { color: var(--primary-600); font-weight: 700; }
.blog-body a { color: var(--navy-600); text-decoration: underline; text-decoration-thickness: 1px; }
.blog-body a:hover { color: var(--primary-700); }
.blog-body blockquote { margin: 40px 0; padding: 0 0 0 20px; border-left: 2px solid var(--primary-500); }
.blog-body blockquote p { margin: 0; font-size: var(--fs-body-1); font-style: italic; font-weight: 500; line-height: 1.2; }
.blog-figure { margin: 64px 0; }
.blog-figure a { display: block; overflow: hidden; border-radius: var(--radius-lg); }
.blog-figure img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.blog-figure figcaption { margin-top: 8px; padding-left: 8px; border-left: 2px solid var(--primary-500); font-size: var(--fs-small); font-weight: 700; line-height: 16px; color: var(--navy-600); }
.blog-gallery { margin: 56px 0; }
.blog-gallery .plan-gallery__item { cursor: zoom-in; }

.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 0; list-style: none; }
.blog-tags a { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: var(--radius-full); background: var(--primary-100); color: var(--primary-600); font-size: var(--fs-body-3); font-weight: 700; text-decoration: none; }
.blog-tags a:hover { background: #dff5fa; }
.blog-social { margin-top: 64px; padding-bottom: 48px; border-bottom: 1px solid var(--gray-150); text-align: center; }
.blog-social p { margin: 0 0 16px; font-size: var(--fs-small); font-weight: 700; color: var(--navy-600); }
.blog-social ul { display: flex; justify-content: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.blog-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-100); }
.blog-social a:hover { background: #dff5fa; }

.blog-related { padding: 100px var(--gutter) 114px; }
.blog-related h2 { margin: 0 0 48px; font-size: var(--fs-h1); font-weight: 500; line-height: 1.2; color: var(--navy-600); }
.blog-related .blog-card__tag { background: var(--orange-100); color: var(--orange-600); }

.blog-lightbox { max-width: min(1400px, 94vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; overflow: visible; }
.blog-lightbox::backdrop { background: rgba(15, 18, 45, .85); }
.blog-lightbox img { display: block; max-width: 100%; max-height: 90vh; margin: 0 auto; border-radius: var(--radius-md); }
.blog-lightbox__close { position: absolute; top: -44px; right: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--white); color: var(--navy-600); font-size: 24px; line-height: 1; cursor: pointer; }

@media (max-width: 1199px) {
    .blog-section__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; }
    .blog-grid { gap: 0 48px; }
}

@media (max-width: 899px) {
    .blog-section__top { grid-template-columns: minmax(0, 1fr); }
    .blog-section__top > .blog-card--big { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid rgba(31, 41, 103, .07); }
    .blog-grid { grid-template-columns: minmax(0, 1fr); }
    .blog-grid > li:nth-child(2) { padding-top: 32px; }
    .blog-grid > li:nth-last-child(-n+2):nth-child(odd):not(:last-child) { padding-bottom: 32px; border-bottom: 1px solid rgba(31, 41, 103, .07); }
}

/* Telefon (Figma figma-blog-mobile, figma-blog-wpis-mobile): wszystkie wpisy jako duże karty, menu działów w jednym wierszu */
@media (max-width: 767px) {
    /* Figma Blog - mobile (7089:123215): marginesy boczne 24 px, odstępy 40 / 16 / 24 / 32 / 32 / 16 */
    .blog-head { padding: 40px 24px 0; }
    .blog-head h1 { font-size: 40px; line-height: 40px; }
    .blog-head__lead { margin-top: 24px; font-size: 20px; line-height: 28px; }
    .blog-bar { gap: 32px; padding: 32px 24px 16px; }
    .blog-bar__nav { width: 100%; }
    .blog-bar__nav ul { justify-content: space-between; gap: 8px 16px; }
    .blog-search { width: 100%; margin-left: 0; }
    .blog-search__field { flex: 1; width: auto; }
    .blog-section { padding: 40px 24px 56px; }
    .blog-section__title, .blog-section__head .blog-section__title { margin-bottom: 48px; font-size: 32px; line-height: 1; }
    .blog-section__head { margin-bottom: 32px; }
    .blog-section__head .blog-section__title { margin-bottom: 0; }
    .blog-section .blog-card { flex-direction: column; gap: 24px; }
    .blog-section .blog-card__photo { width: 100%; height: auto; aspect-ratio: 422 / 258; border-radius: var(--radius-md); }
    .blog-section .blog-card__title, .blog-card--big .blog-card__title { font-size: 18px; font-weight: 600; line-height: 1.2; }
    .blog-section .blog-card__meta, .blog-section .blog-card--big .blog-card__meta { margin-bottom: 8px; }
    .blog-section .blog-card__lead, .blog-section .blog-card--big .blog-card__lead { margin-top: 8px; line-height: 1.4; }
    .blog-section .blog-card__lead { display: -webkit-box; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
    .blog-more { margin-top: 40px; }
    /* FAQ pod blogiem (Figma FAQ mobile 7089:121972): 24 px po bokach, 80 px u góry i u dołu, 16 px między pytaniem a odpowiedzią */
    .blog-faq { padding: 0 24px; }
    .blog-faq .faq-list { padding: 80px 0; }
    .blog-faq .faq-list__title { line-height: 40px; }
    .blog-faq .faq-item__q { min-height: 0; padding: 24px 0; }
    .blog-faq .faq-item__a { margin-top: -8px; }
    .blog-hero { min-height: 427px; }
    .blog-hero h1 { font-size: 40px; line-height: 1.05; }
    .blog-article { padding-top: 64px; }
    .blog-body h2 { font-size: 36px; line-height: 1.05; }
    .blog-figure, .blog-gallery { margin: 40px 0; }
    .blog-figure a { border-radius: var(--radius-md); }
    .blog-related { padding: 64px var(--gutter); }
    .blog-related h2 { font-size: var(--fs-h3); margin-bottom: 24px; }
}
