/* =========================================================
   Podstrona artykułu bloga (blog/*.html)
   Układ: hero (tytuł + ilustracja), przyklejony panel boczny
   (autor, postęp czytania, spis treści, CTA, udostępnianie),
   treść artykułu, powiązane wpisy. Korzysta ze zmiennych i komponentów z styles.css.
   ========================================================= */

.page-article { background: var(--white); }
.page-article .header { background: var(--white); }

/* ---------- Hero ---------- */
.post-hero { padding: 56px 0 104px; }
.post-hero__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 80px;
  align-items: start;
}
.post-hero__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.post-hero .badge { padding: 10px 16px; font-size: var(--fs-15); line-height: var(--lh-snug); font-weight: var(--fw-regular); color: #454647; }
.post-hero__title { font-size: var(--fs-h3-xl); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); margin-bottom: 32px; }
.post-hero__lead { font-size: var(--fs-lead-sm); line-height: var(--lh-relaxed); color: var(--text); }
.post-hero__img { margin: 0; }
.post-hero__img.case__img { aspect-ratio: 600 / 418; margin-bottom: 0; }

/* ---------- Treść: panel boczny + artykuł ---------- */
.post-body {
  display: grid;
  grid-template-columns: minmax(0, 366px) minmax(0, 1fr);
  gap: 90px;
  align-items: start;
  padding-bottom: 128px;
}

.post-aside {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.post-author { display: flex; align-items: center; gap: 12px; }
.post-author__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--mint);
  display: grid;
  place-items: center;
  flex: none;
}
.post-author__avatar svg { width: 18px; height: 15px; }
.post-author__name { margin: 0; font-size: var(--fs-15); font-weight: var(--fw-medium); }
.post-author__time {
  margin: 0 0 0 auto;
  font-size: var(--fs-12);
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
}
/* postęp czytania – wypełnia się podczas przewijania artykułu */
.post-progress { height: 4px; margin-top: 16px; border-radius: 2px; background: var(--gray-bg); overflow: hidden; }
.post-progress__bar { display: block; height: 100%; width: 0; background: var(--violet); border-radius: inherit; }

.post-toc__title { margin: 0 0 12px; font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.post-toc__list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--fs-15);
  line-height: var(--lh-body);
  color: var(--dark-2);
}
.post-toc__list li::marker { color: var(--muted); }
.post-toc__list a { transition: color .2s; }
.post-toc__list a:hover { color: #000; text-decoration: underline; text-underline-offset: 3px; }
.post-toc__list a.is-active { font-weight: var(--fw-semibold); color: var(--text); }

.post-cta { display: flex; flex-direction: column; gap: 8px; }
.post-cta .btn { width: 100%; border-radius: 8px; }
.post-cta__note { margin: 0; font-size: var(--fs-13); line-height: var(--lh-snug); color: var(--muted); text-align: center; }

.post-share__title { margin: 0 0 12px; font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.post-share__links { display: flex; gap: 8px; }
.post-share__links a,
.post-share__links button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gray-bg);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  padding: 0;
  transition: border-color .2s, background .2s;
}
.post-share__links a:hover,
.post-share__links button:hover { border-color: var(--line); background: var(--bg); }
.post-share__links .icon { width: 18px; height: 18px; }
.post-share__links .icon--linkedin { --li-bg: var(--white); }
.post-share__links button.is-copied { background: var(--mint); border-color: var(--mint); }

/* ---------- Artykuł ---------- */
.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 40px;
  margin-bottom: 48px;
  border-bottom: 1px solid #d5d6d9;
  font-size: var(--fs-15);
  color: var(--muted);
}
.post-meta p { margin: 0; }
.post-meta strong { color: var(--text); font-weight: var(--fw-semibold); }

.post-content { font-size: var(--fs-body-lg); line-height: var(--lh-relaxed); }
.post-content p { margin: 0 0 16px; }
.post-content h2 {
  font-size: var(--fs-h2-sm);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  margin: 80px 0 40px;
  scroll-margin-top: 104px;
}
.post-content h3 { font-size: var(--fs-title); line-height: var(--lh-title); margin: 40px 0 16px; letter-spacing: var(--ls-heading); }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: #000; }
.post-content ul,
.post-content ol { margin: 0 0 16px; padding-left: 24px; }
.post-content li { margin-bottom: 8px; }
.post-content li::marker { color: var(--muted); }
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gray-bg);
}
.post-content pre {
  margin: 24px 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--gray);
  border-radius: 4px;
  background: var(--bg);
  overflow-x: auto;
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
}
.post-content pre code { padding: 0; background: none; font-size: inherit; }
.post-note { font-style: italic; color: var(--muted); }

/* tabela */
.post-table { margin: 0 0 24px; overflow-x: auto; }
.post-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-16); line-height: var(--lh-body); min-width: 560px; }
.post-table th,
.post-table td { padding: 12px 14px; border: 1px solid var(--text); text-align: left; vertical-align: top; }
.post-table th { font-weight: var(--fw-semibold); }
.post-table figcaption { margin-top: 8px; font-size: var(--fs-14); color: var(--muted); }

/* ciemny blok CTA w treści – z miętową „falą” jak na stronie głównej */
.post-banner {
  position: relative;
  overflow: hidden;
  margin: 64px 0;
  padding: 96px 64px;
  background: var(--dark);
  color: var(--white);
}
.post-banner .wave { right: 0; bottom: 0; width: 70%; height: 160px; opacity: .55; }
.post-banner__inner { position: relative; z-index: 1; max-width: 560px; }
.post-banner__title { font-size: var(--fs-h3-lg); line-height: var(--lh-heading); margin: 0 0 16px; color: var(--white); letter-spacing: var(--ls-heading); }
.post-content .post-banner p { color: #c9cbce; margin-bottom: 32px; }
.post-content .post-banner .btn { text-decoration: none; }

/* FAQ w artykule */
.post-faq { margin: 64px 0; border-top: 1px solid var(--gray); }
.post-faq__item { border-bottom: 1px solid var(--gray); }
.post-faq__item summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 8px;
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-18);
  line-height: var(--lh-snug);
}
.post-faq__item summary::-webkit-details-marker { display: none; }
.post-faq__num { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-faq__item summary .icon { margin-left: auto; width: 18px; height: 18px; transition: transform .25s; }
.post-faq__item[open] summary .icon { transform: rotate(45deg); }
.post-faq__item summary:hover { color: #000; }
.post-faq__item summary:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.post-faq__a { padding: 0 8px 24px 44px; font-size: var(--fs-body-lg); line-height: var(--lh-relaxed); color: #3b3d40; }

/* ---------- Powiązane wpisy ---------- */
.post-related { background: var(--bg); padding: 128px 0; }
.post-related .h2 { margin-bottom: 56px; }
.post-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.post-related .case h3 { margin-bottom: 12px; }
.post-related__meta { margin: 0; font-size: var(--fs-14); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .post-faq__item summary .icon { transition: none; }
}

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
  .post-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .post-hero__img { max-width: 720px; }
  .post-body { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .post-aside { position: static; max-width: 560px; }
  .post-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .post-hero { padding: 32px 0 64px; }
  .post-hero__title { margin-bottom: 24px; }
  .post-body { padding-bottom: 80px; }
  .post-meta { flex-direction: column; gap: 4px; padding-bottom: 24px; margin-bottom: 32px; }
  .post-content h2 { margin: 56px 0 24px; }
  .post-banner { margin: 48px calc(var(--gutter) * -1); padding: 48px 24px 120px; }
  .post-faq__item summary { font-size: var(--fs-18); padding: 20px 0; }
  .post-faq__a { padding: 0 0 20px 0; }
  .post-related { padding: 80px 0; }
  .post-related .h2 { margin-bottom: 40px; }
  .post-related__grid { grid-template-columns: 1fr; gap: 40px; }
}
