/* ============================================================
   blog-article.css v2 — ObszarEnergii.pl
   Style dla podstron artykułów blogowych
   v2: naprawiony overflow przycisku CTA w sidebarze
   ============================================================ */

/* ── Nagłówek artykułu ── */
.article-header {
  background: var(--deep);
  color: var(--white);
  padding: clamp(36px, 5vw, 56px) var(--outer);
}
.article-header-inner {
  max-width: 800px;
}
.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: #6b83a6;
  margin-bottom: 12px;
}
.article-breadcrumb a { color: #6b83a6; transition: color 0.18s; }
.article-breadcrumb a:hover { color: #93c5fd; }
.article-breadcrumb span { color: #4a5f7a; }

.article-header .blog-tag { color: #93c5fd; margin-bottom: 10px; }

.article-header h1 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.12;
  margin-bottom: 14px;
}

.article-lead {
  color: rgba(255,255,255,0.74);
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  line-height: 1.72;
  max-width: 680px;
  margin-bottom: 18px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: #6b83a6;
}

/* ── Układ artykuł + sidebar ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: clamp(28px, 4vw, 56px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) var(--outer);
  align-items: start;
}

/* ── Treść artykułu ── */
.article-body {
  min-width: 0; /* Fix: flex/grid overflow */
}

.article-body h2 {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: var(--deep);
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-light);
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-size: clamp(1.0rem, 1.3vw, 1.2rem);
  color: var(--deep);
  margin: 24px 0 10px;
}

.article-body p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.78;
  margin-bottom: 14px;
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin: 10px 0 18px;
  color: var(--muted);
}
.article-body li {
  font-size: 0.93rem;
  line-height: 1.72;
  margin-bottom: 8px;
}
.article-body li strong { color: var(--ink); }

.article-body a {
  color: var(--blue);
  border-bottom: 1px solid #bfdbfe;
  transition: border-color 0.18s;
}
.article-body a:hover { border-color: var(--blue); }

/* Highlight box */
.article-highlight {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
}
.article-highlight p { color: var(--deep); font-size: 0.93rem; line-height: 1.65; }

/* Przykład z praktyki */
.article-example {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}
.article-example-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px !important;
}
.article-example p { font-size: 0.9rem !important; color: var(--muted) !important; }

/* Powiązane linki na końcu */
.article-related {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 36px;
}
.article-related-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px !important;
}
.article-related ul { padding-left: 16px; margin: 0; }
.article-related li { margin-bottom: 6px; }
.article-related a { color: var(--blue); font-size: 0.86rem; border-bottom: none; }
.article-related a:hover { text-decoration: underline; }

/* ── Sidebar ── */
.article-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* CTA w sidebarze — v2: naprawiony overflow przycisku */
.sidebar-cta {
  background: var(--deep);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.sidebar-cta .kicker { color: #93c5fd; }
.sidebar-cta h3 { color: var(--white); font-size: 1.05rem; margin: 8px 0; line-height: 1.25; }
.sidebar-cta p { color: #a8b9d4; font-size: 0.82rem; line-height: 1.65; }
.sidebar-cta .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
  padding: 12px 12px;
  font-size: 0.78rem;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  box-sizing: border-box;
  gap: 4px;
}

/* Spis treści */
.sidebar-toc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.sidebar-toc-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: block;
}
.sidebar-toc nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-toc nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 10px;
  transition: border-color 0.18s, color 0.18s;
}
.sidebar-toc nav a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

/* Powiązane linki w sidebarze */
.sidebar-links {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.sidebar-links-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: block;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s;
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: var(--blue); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .article-header h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .article-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}
