/* ============================================================
   ARTYKUŁY BAZY WIEDZY — article.css v2
   Używa zmiennych z css/style.css (:root)
   ============================================================ */

/* ── HERO ──────────────────────────────────────────────────── */
.art-hero {
  background: linear-gradient(135deg, #0f766e 0%, #0b5a54 100%);
  color: #fff;
  padding: 52px 0 44px;
}
.art-hero .container { position: relative; }
.art-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  color: #fff;
}
.art-hero h1 span {
  display: block;
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 4px;
}
.art-hero-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85) !important;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* Breadcrumb */
.art-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.8;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.art-breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.art-breadcrumb a:hover { text-decoration: underline; }
.art-breadcrumb span { opacity: 0.6; }

/* Key facts strip */
.art-key-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .art-key-facts { grid-template-columns: repeat(4, 1fr); } }
.art-key-fact {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fact-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.fact-lbl {
  font-size: 0.77rem;
  opacity: 0.8;
  line-height: 1.3;
}

/* ── LAYOUT: TREŚĆ + SIDEBAR ───────────────────────────────── */
.art-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px 60px;
  margin-top: 40px;
}
@media (min-width: 960px) {
  .art-layout {
    grid-template-columns: 1fr 288px;
    align-items: start;
  }
}

/* ── ARTICLE BODY ──────────────────────────────────────────── */
.art-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #1e293b;
  min-width: 0; /* ważne przy grid! */
}
.art-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 2.5rem 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  scroll-margin-top: 90px;
}
.art-body h2:first-child { margin-top: 0; }
.art-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f766e;
  margin: 1.8rem 0 0.6rem;
}
.art-body p { margin: 0 0 1rem; }
.art-body ul, .art-body ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
.art-body li { margin-bottom: 0.4rem; line-height: 1.6; }
.art-body strong { color: #0f172a; font-weight: 700; }
.art-body a { color: #0f766e; }
.art-body a:hover { text-decoration: underline; }

/* ── SIDEBAR ───────────────────────────────────────────────── */
.art-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}
.art-sidebar-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.art-sidebar-card h3 {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin: 0 0 12px;
}
.art-sidebar-card nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.art-sidebar-card nav a {
  font-size: 0.84rem;
  color: #334155;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
  display: block;
}
.art-sidebar-card nav a:hover {
  background: #f0fdfa;
  color: #0f766e;
}
.art-sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.art-sidebar-links a {
  font-size: 0.86rem;
  color: #334155;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.art-sidebar-links a::before {
  content: '→';
  color: #0d9488;
  font-weight: 700;
  flex-shrink: 0;
}
.art-sidebar-links a:hover { color: #0f766e; }
.art-sidebar-cta {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  border-radius: 14px;
  padding: 20px;
}
.art-sidebar-cta h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
}
.art-sidebar-cta p {
  font-size: 0.86rem;
  margin: 0 0 14px;
  opacity: 0.9;
  color: #ffffff !important;
}
.art-sidebar-cta-btn {
  display: block;
  background: #fff;
  color: #0b4f4a !important;
  font-weight: 800;
  font-size: 0.88rem;
  text-align: center;
  padding: 11px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.art-sidebar-cta-btn:hover {
  transform: translateY(-2px);
  background: #f0fdfa;
  color: #0b4f4a !important;
}

/* ── CALLOUT BOXES ─────────────────────────────────────────── */
.art-callout {
  padding: 14px 18px;
  border-radius: 10px;
  margin: 1.4rem 0;
  font-size: 0.92rem;
  line-height: 1.65;
  border-left: 4px solid;
}
.art-callout strong { display: block; margin-bottom: 4px; }
.art-callout ul { margin: 6px 0 0; }
.art-callout--info    { background: #eff6ff; border-color: #3b82f6; }
.art-callout--info strong { color: #1d4ed8; }
.art-callout--warn    { background: #fffbeb; border-color: #f59e0b; }
.art-callout--warn strong { color: #92400e; }
.art-callout--danger  { background: #fff1f2; border-color: #f43f5e; }
.art-callout--danger strong { color: #be123c; }
.art-callout--tip     { background: #f0fdf9; border-color: #10b981; }
.art-callout--tip strong { color: #065f46; }

/* ── FORMULA / KOD ─────────────────────────────────────────── */
.art-formula {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  margin: 1.2rem 0;
  overflow-x: auto;
}
.art-formula code { background: none; padding: 0; color: inherit; }

/* ── TABELE ────────────────────────────────────────────────── */
.art-table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0 0.4rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.art-table thead tr {
  background: #0f766e;
  color: #fff;
}
.art-table th {
  padding: 11px 14px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.art-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  line-height: 1.4;
}
.art-table tbody tr:last-child td { border-bottom: none; }
.art-table tbody tr:nth-child(even) { background: #f8fafc; }
.art-table tbody tr:hover td { background: #f0fdfa; }
.art-table tbody tr.hl td {
  background: #ecfdf5 !important;
  font-weight: 700;
}
.art-table-note {
  font-size: 0.78rem;
  color: #64748b;
  font-style: italic;
  margin: 4px 0 1rem;
}

/* ── WYKRES (Chart.js) ─────────────────────────────────────── */
.art-chart-box {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin: 1.4rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.art-chart-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.art-chart-btn, .art-chart-btn2 {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.art-chart-btn:hover, .art-chart-btn2:hover {
  border-color: #0d9488;
  color: #0d9488;
}
.art-chart-btn.active, .art-chart-btn2.active {
  background: #ccfbf1;
  border-color: #0d9488;
  color: #0f766e;
}
.art-chart-canvas-wrap {
  height: 300px;
  position: relative;
}
.art-chart-note {
  font-size: 0.79rem;
  color: #64748b;
  text-align: center;
  margin-top: 8px;
}

/* ── COMPARE CARDS ─────────────────────────────────────────── */
.art-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 1.4rem 0;
}
@media (max-width: 560px) { .art-compare { grid-template-columns: 1fr; } }
.art-compare-card {
  border-radius: 12px;
  padding: 16px 18px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
}
.art-compare-card h4 {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #0f172a;
}
.art-compare-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}
.art-compare-card li {
  padding: 3px 0;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.45;
}
.art-compare-card li::before { content: '•'; color: #94a3b8; flex-shrink: 0; }
.art-compare-card p { font-size: 0.85rem; margin: 8px 0 0; line-height: 1.5; }
.art-compare-card--left  { background: #fef2f2; border-color: #fca5a5; }
.art-compare-card--left h4 { color: #dc2626; }
.art-compare-card--right { background: #f0fdf4; border-color: #6ee7b7; }
.art-compare-card--right h4 { color: #15803d; }

/* ── KEY FACTS GRID (in article) ───────────────────────────── */
.art-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 1.4rem 0;
}
@media (min-width: 560px) { .art-facts-grid { grid-template-columns: repeat(4, 1fr); } }
.art-fact-card {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}
.art-fact-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f766e;
  display: block;
  line-height: 1;
}
.art-fact-lbl {
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.3;
  margin-top: 5px;
  display: block;
}

/* ── CHECKLIST ─────────────────────────────────────────────── */
.art-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px 22px;
  margin: 1.2rem 0;
  border: 1.5px solid #e2e8f0;
}
.art-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
  padding: 4px 0;
  color: #334155;
}
.art-check-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #0d9488;
  cursor: pointer;
}

/* ── FAQ ACCORDION ─────────────────────────────────────────── */
.art-faq { display: flex; flex-direction: column; gap: 10px; margin: 1.4rem 0; }
.art-faq-item {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.art-faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 15px 18px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  line-height: 1.4;
}
.art-faq-q::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: #0d9488;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.2s;
}
.art-faq-q[aria-expanded="true"]::after {
  content: '−';
}
.art-faq-q:hover { background: #f8fafc; }
.art-faq-a {
  padding: 0 18px 15px;
  font-size: 0.91rem;
  color: #334155;
  line-height: 1.7;
}
.art-faq-a p { margin: 0 0 0.7rem; }
.art-faq-a p:last-child { margin: 0; }
.art-faq-a ul, .art-faq-a ol { margin: 0.5rem 0; padding-left: 1.3rem; }
.art-faq-a li { margin-bottom: 0.3rem; }

/* ── QUIZ ──────────────────────────────────────────────────── */
.art-quiz-section {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  margin: 2rem 0;
}
.art-quiz-section > h2 {
  border-bottom: none !important;
  margin-top: 0 !important;
  font-size: 1.2rem;
}
.art-quiz-section > p {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 20px;
}

/* Pytania — schowane domyślnie, widoczne .art-quiz-q--active */
.art-quiz-q {
  display: none;
}
.art-quiz-q.art-quiz-q--active {
  display: block;
}

.quiz-q-number {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0d9488;
  margin-bottom: 8px;
}
.quiz-q-text {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}
.art-quiz-opt {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.art-quiz-opt:hover:not(:disabled) {
  border-color: #0d9488;
  background: #f0fdfa;
  color: #0f766e;
}
.art-quiz-opt:disabled {
  cursor: default;
  opacity: 0.75;
}
/* Po odpowiedzi — podświetlenie */
.art-quiz-opt.opt-correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}
.art-quiz-opt.opt-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}
.art-quiz-opt.opt-reveal {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

/* Wyjaśnienie — widoczne po odpowiedzi */
.quiz-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  font-size: 0.86rem;
  color: #78350f;
  line-height: 1.6;
}

/* Przycisk następnego pytania */
.quiz-next-btn {
  display: none;
  margin-top: 14px;
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.quiz-next-btn:hover { background: #0f766e; }
.quiz-next-btn.visible { display: inline-block; }

/* Pasek postępu quizu */
.quiz-progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: #0d9488;
  border-radius: 2px;
  transition: width 0.3s;
}

/* Wynik końcowy */
.quiz-result {
  display: none;
  text-align: center;
  padding: 24px 16px;
}
.quiz-result.visible { display: block; }
.quiz-result h3 {
  font-size: 1.5rem;
  color: #0f766e;
  margin-bottom: 8px;
}
.quiz-result p { color: #334155; margin-bottom: 20px; }
.quiz-retry-btn {
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 26px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.quiz-retry-btn:hover { background: #0f766e; }

/* ── ARTICLE NAV ───────────────────────────────────────────── */
.art-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
  flex-wrap: wrap;
}
.art-nav-prev, .art-nav-next {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 45%;
}
.art-nav-next { align-items: flex-end; }
.art-nav-label {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.art-nav a {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f766e;
  text-decoration: none;
  line-height: 1.4;
}
.art-nav a:hover { text-decoration: underline; }

/* ── AUTHOR BOX ─────────────────────────────────────────────── */
.art-author-box {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0 2rem;
}
.art-author-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent, #f59e0b);
  color: #000;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  overflow: hidden;
  border: 3px solid var(--accent, #f59e0b);
}
.art-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}
.art-author-info {
  flex: 1;
  min-width: 0;
}
.art-author-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.15rem;
  line-height: 1.3;
}
.art-author-role {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 0.65rem;
}
.art-author-bio {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.65;
  margin: 0 0 0.85rem;
}
.art-author-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0a66c2 !important;
  text-decoration: none;
  border: 1px solid #0a66c2;
  border-radius: 6px;
  padding: 4px 10px;
  transition: background 0.15s, color 0.15s;
}
.art-author-linkedin:hover {
  background: #0a66c2;
  color: #fff !important;
}
@media (max-width: 600px) {
  .art-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
  }
  .art-author-name { text-align: center; }
  .art-author-role { text-align: center; }
}

/* ── PRINT ─────────────────────────────────────────────────── */
@media print {
  .art-sidebar, .art-nav, .art-quiz-section { display: none; }
  .art-layout { grid-template-columns: 1fr; }
}
