/* ==========================================================================
   ELKO - blog: lista, karty wpisów, chipy kategorii, paginacja, wpis, wyniki wyszukiwania.
   ========================================================================== */

.elko-bchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.elko-bchip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--e-line); border-radius: var(--e-pill); background: #fff; color: var(--e-ink); font-size: 14px; font-weight: 500; text-decoration: none; transition: border-color .2s, background .2s, color .2s; }
.elko-bchip small { font-size: 12px; color: var(--e-muted); }
.elko-bchip:hover { border-color: var(--e-ink); color: var(--e-ink); }
.elko-bchip.is-on { background: var(--e-ink); border-color: var(--e-ink); color: #fff; }
.elko-bchip.is-on small { color: rgba(255, 255, 255, .7); }

/* siatka wpisów */
.elko-bgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .elko-bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 600px) { .elko-bgrid { grid-template-columns: 1fr; } }

/* karta wpisu (rozszerza .elko-card) */
.elko-pcard .ph img { aspect-ratio: 16 / 10; }
.elko-pcard .ph--empty { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--e-sand); }
.elko-pcard .ph__ico svg { width: 44px; height: 44px; color: var(--e-red); opacity: .7; }
.elko-pcard .b { gap: 10px; }
.elko-pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--e-muted); }
.elko-pcard h3 { font-size: 19px; line-height: 1.3; }
.elko-pcard .d { display: -webkit-box; -webkit-line-clamp: 3; font-size: 14.5px; }
.elko-pcard__time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--e-muted); }
.elko-pcard__time svg { width: 15px; height: 15px; }
@media (max-width: 767px) {
	.elko-pcard .b { padding: 16px 16px 18px; }
	.elko-pcard h3 { font-size: 17px; }
	.elko-pcard .d { display: -webkit-box; }
	.elko-pcard .go { width: 38px; height: 38px; }
}

/* duża karta (pierwszy wpis) */
.elko-pcard--big { flex-direction: row; margin-bottom: 24px; }
.elko-pcard--big .ph { flex: 0 0 54%; margin: 10px; }
.elko-pcard--big .ph img, .elko-pcard--big .ph--empty { aspect-ratio: 4 / 3; height: 100%; }
.elko-pcard--big .b { justify-content: center; padding: 36px 40px; gap: 14px; }
.elko-pcard--big h3 { font-size: 30px; line-height: 1.2; }
.elko-pcard--big .d { font-size: 16px; -webkit-line-clamp: 4; }
.elko-pcard--big .p { margin-top: 8px; }
@media (max-width: 900px) {
	.elko-pcard--big { flex-direction: column; }
	.elko-pcard--big .ph { flex: none; margin: 8px 8px 0; }
	.elko-pcard--big .b { padding: 20px 18px 22px; }
	.elko-pcard--big h3 { font-size: 22px; }
}

/* paginacja */
.elko-bpager { margin-top: 48px; }
.elko-bpager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.elko-bpager li > .page-numbers { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--e-line); border-radius: var(--e-r-s); background: #fff; color: var(--e-ink); font-size: 15px; font-weight: 500; text-decoration: none; transition: border-color .2s, background .2s; }
.elko-bpager a.page-numbers:hover { border-color: var(--e-ink); color: var(--e-ink); }
.elko-bpager li > .page-numbers.current { background: var(--e-red); border-color: var(--e-red); color: #fff; }
.elko-bpager li > .page-numbers.dots { border-color: transparent; background: none; }
.elko-bpager svg { width: 18px; height: 18px; }
.elko-bpager svg.prev { transform: rotate(180deg); }
.elko-bempty { margin: 40px 0; color: var(--e-muted); }

/* wpis */
.elko-phead--post .elko-phead__title { max-width: 24ch; }
.elko-phead--post { padding-bottom: 40px; }
.elko-article { padding-bottom: 64px; }
.elko-article__img { margin: 40px 0 0; border-radius: var(--e-r-xl); overflow: hidden; background: var(--e-photo); border: 1px solid var(--e-line); }
.elko-article__img img { width: 100%; max-height: 560px; aspect-ratio: 16 / 9; object-fit: cover; }
.elko-article__body { max-width: 760px; margin: 48px auto 0; }
.elko-article__body > :first-child { margin-top: 0; }
.elko-article__tags { display: flex; flex-wrap: wrap; gap: 8px; max-width: 760px; margin: 40px auto 0; padding: 24px 0 0; border-top: 1px solid var(--e-line); list-style: none; }
.elko-article .elko-prose h2 { font-size: 28px; }
.elko-article .elko-prose img { height: auto; }
.elko-article .elko-prose .wp-block-table, .elko-article .elko-prose figure.wp-block-table { overflow-x: auto; }
.elko-article .elko-prose th { background: var(--e-cream); font-weight: 600; color: var(--e-ink); }
.elko-article .elko-prose .wp-block-image img { border-radius: var(--e-r); }
@media (max-width: 767px) {
	.elko-article__img { margin-top: 24px; border-radius: var(--e-r-l); }
	.elko-article__body { margin-top: 32px; }
	.elko-article { padding-bottom: 40px; }
}

/* wyniki wyszukiwania */
.elko-sres .elko-sform { margin-bottom: 8px; }
.elko-sres__sec { margin-top: 56px; }
.elko-srows { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.elko-srow { position: relative; display: flex; gap: 20px; align-items: center; padding: 12px; border: 1px solid var(--e-line); border-radius: var(--e-r-l); background: #fff; transition: border-color .3s; }
.elko-srow:hover { border-color: var(--e-line-2); }
.elko-srow__img { flex: 0 0 160px; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: var(--e-r-m); overflow: hidden; background: var(--e-sand); }
.elko-srow__img img { width: 100%; height: 100%; object-fit: cover; }
.elko-srow__img svg { width: 36px; height: 36px; color: var(--e-red); opacity: .7; }
.elko-srow__b { min-width: 0; padding-right: 8px; }
.elko-srow__b h3 { margin: 8px 0 6px; font-size: 19px; }
.elko-srow__b h3 a { color: var(--e-ink); }
.elko-srow__b h3 a::after { content: ""; position: absolute; inset: 0; }
.elko-srow__b p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--e-muted); }
.elko-nores { margin-top: 48px; }
.elko-nores p { max-width: 60ch; margin-top: 12px; color: var(--e-muted); }
@media (max-width: 600px) {
	.elko-srow { flex-direction: column; align-items: stretch; gap: 12px; }
	.elko-srow__img { flex: none; }
	.elko-srow__b { padding: 0 6px 8px; }
}

/* ==========================================================================
   Wpis - etap 3 (układ i mechanika wg bloga important.is, barwy ELKO)
   ========================================================================== */

/* pasek postępu czytania */
.elko-readbar { position: fixed; top: 0; left: 0; right: 0; z-index: 400; height: 3px; pointer-events: none; }
.elko-readbar i { display: block; height: 100%; width: 0; background: var(--e-red); }

/* nagłówek: kolumna czytania, kategoria wersalikami, kropki rozdzielające */
.elko-phead--post .elko-wrap > * { max-width: 760px; margin-inline: auto; }
.elko-phead--post .elko-phead__title { max-width: 760px; }
.elko-phead--post .elko-phead__meta { gap: 6px 12px; font-size: 14px; }
.elko-phead__cat { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--e-red); }
.elko-phead__cat:hover { color: var(--e-red-d); }
.elko-phead__meta .dot { color: var(--e-faint); font-size: 11px; }
.elko-article__img { max-width: 960px; margin-inline: auto; }

/* nagłówki w treści: czerwona kropka przed H2 (jak na wzorze) */
.elko-article .elko-prose h2 { position: relative; }
.elko-article .elko-prose h2::before { content: ""; position: absolute; left: -22px; top: .52em; width: 8px; height: 8px; border-radius: 50%; background: var(--e-red); }
@media (max-width: 900px) { .elko-article .elko-prose h2::before { display: none; } }

/* tabele: ciemny nagłówek, paski, zaokrąglenie (przewijane poziomo na telefonie) */
.elko-article .elko-prose table { border: 1px solid var(--e-line); border-radius: var(--e-r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.elko-article .elko-prose figure.wp-block-table { border-radius: var(--e-r); }
.elko-article .elko-prose thead th, .elko-article .elko-prose tr:first-child th { background: var(--e-ink); color: #fff; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
.elko-article .elko-prose tbody tr:nth-child(even) td, .elko-article .elko-prose tbody tr:nth-child(even) th { background: var(--e-soft); }
.elko-article .elko-prose td:first-child { font-weight: 600; color: var(--e-ink); }
.elko-article .elko-prose td, .elko-article .elko-prose th { border-bottom: 1px solid var(--e-line); }
.elko-article .elko-prose tr:last-child td { border-bottom: 0; }

/* CTA w treści */
.elko-icta { margin: 2em 0; }
.elko-icta--1 { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; border-radius: var(--e-r-l); background: var(--e-ink); color: #fff; }
.elko-icta--1 strong { display: block; font-size: 22px; line-height: 1.25; font-weight: 600; color: #fff; }
.elko-icta--1 p { margin: 6px 0 0; font-size: 15px; color: rgba(255, 255, 255, .72); }
.elko-icta--1 .elko-btn { flex: none; color: #fff; text-decoration: none; }
.elko-icta--2 { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--e-line); border-radius: var(--e-r-l); background: var(--e-cream); }
.elko-icta--2 .ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--e-red); color: #fff; }
.elko-icta--2 .ico svg { width: 18px; height: 18px; }
.elko-icta--2 p { flex: 1; margin: 0; font-size: 15px; line-height: 1.45; color: var(--e-ink); }
.elko-icta--2 .elko-link { text-decoration: none; }
@media (max-width: 767px) {
	.elko-icta--1 { flex-direction: column; align-items: stretch; padding: 22px 20px; gap: 18px; }
	.elko-icta--1 strong { font-size: 19px; }
	.elko-icta--2 { flex-wrap: wrap; }
	.elko-icta--2 p { flex-basis: calc(100% - 56px); }
	.elko-icta--2 .elko-link { margin-left: 54px; }
}

/* spis treści na telefonie (blok nad treścią) */
.elko-mtoc { display: none; max-width: 760px; margin: 32px auto 0; border: 1px solid var(--e-line); border-radius: var(--e-r-l); background: var(--e-cream); }
.elko-mtoc > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--e-red); }
.elko-mtoc > summary::-webkit-details-marker { display: none; }
.elko-mtoc > summary::after { content: "+"; font-size: 20px; line-height: 1; letter-spacing: 0; }
.elko-mtoc[open] > summary::after { content: "\2212"; }
.elko-mtoc ol { margin: 0; padding: 0 18px 14px; list-style: none; display: grid; gap: 2px; }
.elko-mtoc li.sub { padding-left: 14px; }
.elko-mtoc a { display: block; padding: 8px 0; font-size: 15px; line-height: 1.4; color: var(--e-text); text-decoration: none; border-top: 1px solid var(--e-line); }
.elko-mtoc a.is-on { color: var(--e-red); font-weight: 600; }
@media (max-width: 767px) { .elko-mtoc:not([hidden]) { display: block; } .elko-mtoc + .elko-article__body { margin-top: 24px; } }

/* zapis e-mail na końcu wpisu */
.elko-article__news { padding-top: 24px; }

/* nagłówki do kotwic nie chowają się pod przyklejonym nagłówkiem */
.elko-article .elko-prose :is(h2, h3)[id] { scroll-margin-top: calc(var(--e-header-h) + 24px); }

/* ---------- pływające okienka ---------- */
.elko-fbar { position: fixed; z-index: 700; left: 0; right: 0; bottom: 16px; display: flex; align-items: flex-end; justify-content: center; gap: 12px; max-width: 1000px; margin-inline: auto; padding-inline: 16px; pointer-events: none; opacity: 0; transform: translateY(16px); transition: opacity .25s var(--e-ease), transform .3s var(--e-ease); }
.elko-fbar[hidden] { display: none; }
.elko-fbar.is-on { opacity: 1; transform: none; }
.elko-fbar:not(.is-on) > * { visibility: hidden; }
.elko-fbar__cta, .elko-fbar__toc { position: relative; pointer-events: auto; display: flex; align-items: center; min-height: 60px; border: 1px solid var(--e-line); border-radius: var(--e-pill); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 8px 28px rgba(24, 24, 27, .16); }
.elko-fbar__cta[hidden], .elko-fbar__toc[hidden] { display: none; }
.elko-fbar__cta { flex: 0 0 auto; gap: 14px; padding: 8px 40px 8px 10px; }
.elko-fbar__toc { flex: 1 1 0; min-width: 0; }
.elko-fbar__tel { display: flex; align-items: center; gap: 10px; color: var(--e-ink); text-decoration: none; }
.elko-fbar__tel .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--e-red); color: #fff; flex: none; }
.elko-fbar__tel .ico svg { width: 18px; height: 18px; }
.elko-fbar__tel .txt { display: flex; flex-direction: column; line-height: 1.25; }
.elko-fbar__tel b { font-size: 13px; font-weight: 600; }
.elko-fbar__tel small { font-size: 12px; color: var(--e-muted); }
.elko-fbar__shop { flex: none; min-height: 38px; border-radius: var(--e-pill); }
.elko-fbar__toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; align-self: stretch; padding: 0 44px 0 24px; border: 0; border-radius: var(--e-pill); background: transparent; text-align: left; cursor: pointer; }
.elko-fbar__toggle:hover { background: var(--e-red-soft); }
.elko-fbar__toggle .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.elko-fbar__toggle small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--e-muted); }
.elko-fbar__toggle b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--e-ink); }
.elko-fbar__toggle > svg { width: 18px; height: 18px; color: var(--e-muted); transition: transform .25s; }
.elko-fbar__toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.elko-fbar__x { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--e-muted); cursor: pointer; }
.elko-fbar__x:hover { background: var(--e-soft); color: var(--e-ink); }
.elko-fbar__x svg { width: 14px; height: 14px; }
.elko-fbar__toc > .elko-fbar__x { right: 12px; }
.elko-fbar__toggle > svg { margin-right: 0; }

.elko-fbar__panel { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); max-height: 0; overflow: hidden; border-radius: var(--e-r-l); background: #fff; border: 1px solid transparent; box-shadow: none; visibility: hidden; transition: max-height .3s var(--e-ease), border-color .3s, visibility .3s; }
.elko-fbar__toc.is-open .elko-fbar__panel { max-height: min(55vh, 420px); border-color: var(--e-line); box-shadow: 0 -8px 28px rgba(24, 24, 27, .14); visibility: visible; }
.elko-fbar__panel ol { margin: 0; padding: 14px 14px 12px; list-style: none; overflow-y: auto; max-height: min(55vh, 420px); display: grid; gap: 2px; }
.elko-fbar__panel li.sub { padding-left: 16px; }
.elko-fbar__panel a { display: block; padding: 9px 12px; border-radius: var(--e-r-s); font-size: 14px; line-height: 1.4; color: var(--e-text); text-decoration: none; }
.elko-fbar__panel a:hover { background: var(--e-soft); color: var(--e-ink); }
.elko-fbar__panel a.is-on { background: var(--e-red-soft); color: var(--e-red); font-weight: 600; }

/* toast z produktem (desktop) */
.elko-ftoast { position: fixed; z-index: 690; right: 24px; bottom: 96px; display: none; align-items: center; gap: 14px; width: 340px; padding: 12px 38px 12px 12px; border: 1px solid var(--e-line); border-radius: var(--e-r-l); background: #fff; box-shadow: 0 12px 36px rgba(24, 24, 27, .2); opacity: 0; transform: translateY(14px); transition: opacity .3s var(--e-ease), transform .35s var(--e-ease); }
.elko-ftoast.is-on { opacity: 1; transform: none; }
.elko-ftoast__img { flex: none; width: 64px; height: 64px; border-radius: var(--e-r-m); overflow: hidden; background: var(--e-photo); }
.elko-ftoast__img img { width: 100%; height: 100%; object-fit: cover; }
.elko-ftoast__b { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.elko-ftoast__b small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--e-red); }
.elko-ftoast__b > a { font-size: 14px; font-weight: 600; color: var(--e-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.elko-ftoast__b > span { font-size: 13px; color: var(--e-muted); }
.elko-ftoast__b > span b { font-size: 15px; color: var(--e-ink); }
@media (min-width: 1100px) { .elko-ftoast:not([hidden]) { display: flex; } }

/* telefon: okienko z telefonem zwija się do kółka, spis treści zajmuje resztę; nad paskami zakupu */
@media (max-width: 767px) {
	.elko-fbar { bottom: calc(12px + env(safe-area-inset-bottom)); gap: 8px; padding-inline: 12px; }
	.elko-fbar__cta { padding: 6px; }
	.elko-fbar__cta .txt, .elko-fbar__shop { display: none; }
	.elko-fbar__cta .elko-fbar__x { top: -6px; right: -6px; transform: none; width: 22px; height: 22px; background: #fff; border: 1px solid var(--e-line); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
	.elko-fbar__toggle { padding-left: 18px; }
	.elko-fbar__panel { bottom: calc(100% + 8px); }
	body:has(.elko-sticky:not([hidden])) .elko-fbar, body:has(.elko-co-bar) .elko-fbar { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ograniczony ruch: bez przejść i animacji, bez płynnego przewijania */
@media (prefers-reduced-motion: reduce) {
	html:has(.elko-readbar) { scroll-behavior: auto; }
	.elko-fbar, .elko-fbar *, .elko-ftoast, .elko-readbar i { transition: none; animation: none; }
}
