/* ============================================
   BLOG - style współdzielone: strona główna bloga, strony pillar, szablon artykułu
   ============================================ */

/* ============================================
   HERO (jasny, wyśrodkowany - inny wzorzec niż podstrony usługowe)
   ============================================ */
.blog-hero { background: var(--surface); padding: 56px 0 48px; text-align: center; }
.blog-hero .breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.blog-hero .breadcrumb a { color: var(--text-light); }
.blog-hero .breadcrumb a:hover { color: var(--red); }
.blog-hero .breadcrumb strong { color: var(--text-muted); font-weight: 500; }
.blog-hero .breadcrumb span { margin: 0 6px; }
.blog-hero .section-label { text-align: center; }
.blog-hero h1 { margin-bottom: 16px; }
.blog-hero-desc {
  font-size: 18px; line-height: 1.6; color: var(--text-muted);
  max-width: 640px; margin: 0 auto;
}
.blog-hero-tag {
  display: inline-block; background: var(--red-tint); color: var(--red);
  font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

@media (max-width: 600px) { .blog-hero .breadcrumb { display: none; } }

/* ============================================
   PILLARY (3 karty tematyczne)
   ============================================ */
.pillars-section { padding: 64px 0; }
.pillars-intro { font-size: 17px; color: var(--text-muted); max-width: 640px; margin: 0 auto 40px; text-align: center; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pillar-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.pillar-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pillar-card-media { aspect-ratio: 16/10; }
.pillar-card-media .media-placeholder { position: relative; width: 100%; height: 100%; aspect-ratio: auto; }
.pillar-card-body { padding: 28px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.pillar-card-body h3 { font-size: 21px; margin-bottom: 10px; }
.pillar-card-body p { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; flex: 1; }

@media (max-width: 900px) { .pillar-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pillar-grid { grid-template-columns: 1fr; } }

/* ============================================
   FILTR KATEGORII (pigułki)
   ============================================ */
.blog-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.filter-pill {
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 9px 20px; transition: all 0.15s; white-space: nowrap;
}
.filter-pill:hover { border-color: var(--red); color: var(--red); }
.filter-pill.is-active { background: var(--red); border-color: var(--red); color: var(--white); }

/* ============================================
   GRID ARTYKUŁÓW
   ============================================ */
.articles-section { padding: 64px 0; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.article-card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-card-media { aspect-ratio: 16/10; }
.article-card-media .media-placeholder { position: relative; width: 100%; height: 100%; aspect-ratio: auto; }
.article-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.article-card-cat {
  display: inline-block; align-self: flex-start; background: var(--red-tint); color: var(--red);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-pill); margin-bottom: 12px;
}
.article-card-body h3 { font-size: 18px; line-height: 1.3; margin-bottom: 8px; }
.article-card-body p { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; flex: 1; }
.article-card-meta { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.article-card-meta span + span::before { content: '·'; margin: 0 6px; }
.article-card .arrow-link { font-size: 14px; }

@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .article-grid { grid-template-columns: 1fr; } }

.blog-load-more { text-align: center; margin-top: 48px; }

.blog-empty-state { text-align: center; padding: 48px 0; color: var(--text-light); font-size: 15px; display: none; }
.blog-empty-state.is-visible { display: block; }

/* ============================================
   CTA KOŃCOWE (sekcja czerwona, wzorzec sitewide .section-red)
   ============================================ */
#blog-cta { text-align: center; }
#blog-cta h2 { color: var(--white); margin-bottom: 12px; }
#blog-cta p { color: rgba(255,255,255,0.85); font-size: 17px; max-width: 560px; margin: 0 auto 32px; line-height: 1.6; }
#blog-cta .blog-cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
#blog-cta .btn-outline-white { color: var(--white); }

/* ============================================
   SZABLON ARTYKUŁU - nagłówek
   ============================================ */
.article-header { padding: 40px 0 0; }
.article-header .breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.article-header .breadcrumb a { color: var(--text-light); }
.article-header .breadcrumb a:hover { color: var(--red); }
.article-header .breadcrumb strong { color: var(--text-muted); font-weight: 500; }
.article-header .breadcrumb span { margin: 0 6px; }
.article-cat-tag {
  display: inline-block; background: var(--red-tint); color: var(--red);
  font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: var(--radius-pill); margin-bottom: 20px;
}
.article-header h1 { max-width: 860px; margin-bottom: 16px; }
.article-lead { font-size: 19px; line-height: 1.6; color: var(--text-muted); max-width: 760px; margin-bottom: 28px; }

.article-author-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.article-author-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text-light); flex-shrink: 0; overflow: hidden;
}
.article-author-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.article-author-avatar svg { width: 22px; height: 22px; }
.article-author-info { font-size: 14px; line-height: 1.4; }
.article-author-name { font-weight: 600; color: var(--dark); }
.article-author-sub { color: var(--text-light); }

.article-featured-media { aspect-ratio: 16/8; border-radius: var(--radius-media); overflow: hidden; margin-bottom: 48px; }
.article-featured-media .media-placeholder { width: 100%; height: 100%; aspect-ratio: auto; }

/* Realne zdjęcia w kafelkach i nagłówku wpisu - wypełniają kadr bez zniekształceń */
.article-card-media img,
.pillar-card-media img,
.article-featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 600px) {
  .article-header .breadcrumb { display: none; }
  .article-featured-media { aspect-ratio: 4/3; }

  /* Globalna reguła "h1, h2, h3 -> center" jest pomyślana pod krótkie
     nagłówki sekcji na landingach. W artykule daje rozjazd: nagłówki lądują
     na środku, a akapity i listy zostają przy lewej. Tekst ciągły czyta się
     źle wyśrodkowany (każdy wiersz zaczyna się gdzie indziej), więc
     ujednolicamy w drugą stronę - wszystko do lewej, tak jak na desktopie. */
  .article-header h1,
  .article-prose h2,
  .article-prose h3,
  .article-prose h4 { text-align: left; }
}

/* ============================================
   SZABLON ARTYKUŁU - layout: spis treści + treść
   ============================================ */
.article-layout { display: grid; grid-template-columns: 250px 1fr; gap: 56px; align-items: start; padding-bottom: 64px; }

.article-toc {
  position: sticky; top: 100px;
  background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--red);
  border-radius: var(--radius-card); padding: 22px 22px;
}
.article-toc-label { font-family: var(--font-head); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-bottom: 14px; }
.article-toc ol { list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: toc; }
.article-toc a {
  font-size: 14px; color: var(--text-muted); line-height: 1.4; display: block;
  transition: color 0.15s;
}
.article-toc a:hover, .article-toc a.is-active { color: var(--red); }

/* Linie tematyczne (pillary) pod spisem treści */
.article-toc-pillars { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.article-toc-pillar {
  display: block; font-size: 14px; color: var(--text-muted); line-height: 1.4;
  padding: 8px 12px; border-radius: 8px; background: var(--bg-tint, #F7F7F7);
  margin-bottom: 8px; transition: background 0.15s, color 0.15s;
}
.article-toc-pillar:last-child { margin-bottom: 0; }
.article-toc-pillar:hover { background: var(--red-tint); color: var(--red); }
.article-toc-pillar.is-current { background: var(--red-tint); color: var(--red); font-weight: 600; }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
  .article-toc { position: static; }
  .article-toc-pillars { display: flex; flex-wrap: wrap; gap: 8px; }
  .article-toc-pillars .article-toc-label { flex-basis: 100%; margin-bottom: 6px; }
  .article-toc-pillar { margin-bottom: 0; }
}

/* ============================================
   TREŚĆ ARTYKUŁU (prose)
   ============================================ */
.article-prose { max-width: 760px; }
.article-prose h2 { margin-top: 48px; margin-bottom: 16px; scroll-margin-top: 100px; }
.article-prose h2:first-child { margin-top: 0; }
.article-prose h3 { margin-top: 32px; margin-bottom: 12px; scroll-margin-top: 100px; }
.article-prose p { font-size: 17px; line-height: 1.75; color: var(--text-muted); margin-bottom: 20px; }
.article-prose ol { margin: 0 0 20px 22px; }
.article-prose li { font-size: 17px; line-height: 1.7; color: var(--text-muted); margin-bottom: 8px; }

.article-prose ul {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.article-prose ul li {
  position: relative; padding-left: 30px; margin-bottom: 0;
}
.article-prose ul li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A81916' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.article-prose a:not(.btn):not(.arrow-link) { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.article-prose strong { color: var(--dark); font-weight: 600; }

.article-internal-link {
  display: block; background: var(--surface); border-left: 3px solid var(--red);
  border-radius: var(--radius-card); padding: 16px 20px; margin: 24px 0;
  font-size: 15px; color: var(--text-muted);
}
.article-internal-link strong { color: var(--dark); }
.article-internal-link .arrow-link { margin-top: 4px; }

.article-summary {
  background: var(--red-tint); border-radius: var(--radius-card); padding: 24px 28px; margin: 40px 0;
}
.article-summary-label {
  font-family: var(--font-head); font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--red); margin-bottom: 10px;
}
.article-summary p { color: var(--text-muted); margin-bottom: 0; font-size: 16px; line-height: 1.65; }

.article-inline-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap;
  background: var(--dark); border-radius: var(--radius-card); padding: 28px 32px; margin: 40px 0;
}
.article-inline-cta-text h3 { color: var(--white); font-size: 19px; margin: 0; line-height: 1.3; white-space: nowrap; }
.article-inline-cta .btn { flex-shrink: 0; }
.article-inline-cta-arrow { color: var(--white); font-weight: 700; margin-left: 6px; display: inline-block; transition: transform 0.15s; }
.article-inline-cta:hover .article-inline-cta-arrow { transform: translateX(4px); }

@media (max-width: 480px) {
  .article-inline-cta-text h3 { white-space: normal; font-size: 17px; }
}

/* ============================================
   BOX AUTORA
   ============================================ */
.article-author-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius-card); padding: 26px 28px; margin: 48px 0 0;
  max-width: 760px;
}
.article-author-box-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: var(--white);
  border: 1px solid var(--border); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--text-light);
}
.article-author-box-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.article-author-box-avatar svg { width: 30px; height: 30px; }
.article-author-box-name { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.article-author-box-quote { font-size: 14px; font-style: italic; color: var(--text-muted); margin-bottom: 8px; }
.article-author-box .arrow-link { font-size: 14px; }

/* ============================================
   PRZECZYTAJ TEŻ
   ============================================ */
.related-section { padding: 56px 0 72px; border-top: 1px solid var(--border); }
.related-section h2 { margin-bottom: 28px; }
