/* ==========================================================================
   MB Classics — blog (/blog/, /blog/<slug>/, /en/blog/, /o-mnie/, stare wpisy)
   Ładowany po jasny.css, tylko na stronach z tools/build_blog.py.
   ========================================================================== */

.preview-banner { background: #FFF4D6; color: var(--warn); border-bottom: 1px solid #F0D58A; text-align: center; font-weight: 600; font-size: 14px; padding: 8px var(--gutter); }

/* ---------- Nagłówek wpisu ---------- */
.post-head { padding-top: 40px; padding-bottom: 28px; max-width: 980px; margin-left: auto; margin-right: auto; }
.post-breadcrumb { margin-bottom: 22px; }
.post-breadcrumb [aria-current] { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.post-head h1 { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: 0; font-size: clamp(36px, 5vw, 64px); margin: 0 0 20px; }
.post-lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.5; color: var(--ink-2); max-width: 760px; margin: 0 0 24px; }
.post-byline { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink-3); }
.post-byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-byline p { margin: 0; line-height: 1.45; }
.post-byline-name { color: var(--ink); font-weight: 600; text-decoration: none; }

.post-hero { margin: 0 auto 8px; max-width: 1160px; }
.post-hero img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 16 / 9; object-fit: cover; background: var(--sand); }
.post-hero figcaption, .post-figure figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.post-hero figcaption a, .post-figure figcaption a { color: inherit; }

/* ---------- Układ: spis treści + treść ---------- */
.post-layout { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 56px; justify-content: center; padding-top: 32px; padding-bottom: 56px; }
.post-aside { position: relative; }
.post-toc { position: sticky; top: calc(var(--header-h) + 16px); font-size: 15px; }
.post-toc summary { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; list-style: none; margin-bottom: 12px; }
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.post-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.post-toc li a:hover { color: var(--violet); border-left-color: var(--violet); }

.post-body { font-size: 18px; line-height: 1.7; color: var(--ink-2); min-width: 0; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; letter-spacing: 0; line-height: 1.02; color: var(--ink); font-size: clamp(26px, 2.8vw, 36px); margin: 56px 0 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.post-body h3 { font-size: 21px; color: var(--ink); margin: 32px 0 10px; line-height: 1.25; scroll-margin-top: calc(var(--header-h) + 16px); }
.post-body p { margin: 0 0 1.1em; }
.post-body strong { color: var(--ink); }
.post-body a { color: var(--violet-dark); }
.post-body a:hover { color: var(--violet); }
.post-body a.btn-primary, .post-body a.btn-primary:hover { color: #FFFFFF; text-decoration: none; }
.post-body ul, .post-body ol { padding-left: 24px; margin: 0 0 1.2em; }
.post-body li { margin-bottom: .4em; }
.post-body li::marker { color: var(--violet); }
.post-body blockquote { margin: 32px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--violet); font-family: var(--font-head); font-size: 22px; line-height: 1.4; color: var(--ink); }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-figure { margin: 32px 0; }
.post-figure img { width: 100%; border-radius: var(--radius-card); background: var(--sand); }
.table-scroll { overflow-x: auto; margin: 24px 0 28px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card); }
.post-body table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.post-body th, .post-body td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.post-body th { font-family: var(--font-head); font-weight: 700; color: var(--ink); background: var(--sand-2); }
.post-body tr:last-child td { border-bottom: 0; }
.michal-todo { background: #FFE9A8; color: #5B3B00; padding: 1px 6px; border-radius: 4px; font-weight: 600; font-size: .92em; }

/* ---------- FAQ ---------- */
.post-faq { margin-top: 56px; }
.post-faq-item { border-top: 1px solid var(--line); }
.post-faq-item:last-child { border-bottom: 1px solid var(--line); }
.post-faq-item summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; }
.post-faq-item summary::-webkit-details-marker { display: none; }
.post-faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 26px; color: var(--violet); font-family: var(--font-head); }
.post-faq-item[open] summary::after { content: "−"; }
.post-faq-item summary h3 { margin: 0; font-size: 19px; display: inline; }
.post-faq-item > div { padding: 0 0 18px; }
.post-faq-item > div p:last-child { margin-bottom: 0; }

/* ---------- CTA i autor ---------- */
.post-cta { margin: 56px 0 32px; padding: clamp(24px, 4vw, 40px); background: var(--dark); color: var(--dark-text); border-radius: var(--radius-lg); }
.post-cta h2 { color: #FFFFFF; margin: 0 0 10px; font-size: clamp(24px, 2.6vw, 32px); }
.post-cta p { color: var(--dark-muted); margin: 0 0 22px; max-width: 560px; }
.post-author { display: flex; gap: 20px; align-items: flex-start; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); font-size: 16px; line-height: 1.55; }
.post-author img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-author p { margin: 0 0 8px; }
.post-author-name { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.post-author-name a { color: var(--ink); text-decoration: none; }
.post-author-links { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 !important; font-weight: 600; }
.post-author-links a { color: var(--violet-dark); text-decoration: none; }

/* ---------- Karty wpisów ---------- */
.post-related { padding-top: 24px; padding-bottom: 80px; }
.post-related h2 { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; font-size: clamp(28px, 3.2vw, 40px); margin: 0 0 24px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease; }
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card-img { display: block; aspect-ratio: 16 / 10; background: var(--sand); overflow: hidden; }
.post-card-img picture, .post-card-img img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.post-card-meta { margin: 0; font-size: 13px; color: var(--ink-3); }
.post-card-meta a { font-family: var(--font-head); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: var(--violet); text-decoration: none; }
.post-card-title { font-size: 21px; line-height: 1.2; margin: 0; }
.post-card-title a { text-decoration: none; color: var(--ink); }
.post-card-title a:hover { color: var(--violet); }
.post-card-excerpt { margin: 0; color: var(--ink-2); font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card--featured { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); margin-bottom: 32px; }
.post-card--featured .post-card-img { aspect-ratio: auto; min-height: 320px; }
.post-card--featured .post-card-body { padding: clamp(22px, 3vw, 40px); justify-content: center; }
.post-card--featured .post-card-title { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; font-size: clamp(26px, 3vw, 38px); line-height: 1.02; }

/* ---------- Lista /blog/ ---------- */
.post-list-head { padding-top: 48px; padding-bottom: 32px; }
.post-list-head h1 { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; line-height: 1; font-size: clamp(40px, 5.6vw, 76px); margin: 12px 0 12px; }
.post-list-head > p { color: var(--ink-2); font-size: 19px; max-width: 760px; margin: 0 0 24px; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.post-cats .pill { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 15px; text-decoration: none; color: var(--ink-2); background: var(--card); }
.post-cats .pill span { color: var(--ink-3); font-size: 13px; }
.post-cats .pill.is-active { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.post-cats .pill.is-active span { color: var(--dark-label); }
.post-list .post-grid { padding-bottom: 80px; }

/* ---------- /o-mnie/ ---------- */
.author-page { padding-top: 48px; }
.author-split { align-items: start; padding-bottom: 56px; }
.author-page h1 { font-stretch: var(--stretch); font-weight: 800; text-transform: uppercase; line-height: 1; font-size: clamp(40px, 5.6vw, 76px); margin: 18px 0 8px; }
.author-page .lead { margin-bottom: 24px; }
.author-links { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Telefon / tablet ---------- */
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .post-toc { position: static; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 32px; }
  .post-toc summary { margin-bottom: 0; }
  .post-toc[open] summary { margin-bottom: 12px; }
}
@media (max-width: 760px) {
  .post-head { padding-top: 24px; }
  .post-body { font-size: 17px; }
  .post-hero img { aspect-ratio: 4 / 3; border-radius: var(--radius-card); }
  .post-card--featured { grid-template-columns: 1fr; }
  .post-card--featured .post-card-img { min-height: 0; aspect-ratio: 16 / 10; }
  .post-author { flex-direction: column; }
}
