/* Quantaffi — global site styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-surface: #f8fafc;
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-cta: #16a34a;
  --color-cta-dark: #15803d;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fcd34d;
  --color-warning-text: #78350f;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 1rem;
}

/* ── Layout ──────────────────────────────────────────────────── */

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ──────────────────────────────────────────────────── */

.site-header {
  background: #0f172a;
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-logo {
  color: #f8fafc;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo span { color: var(--color-primary); }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a {
  color: #94a3b8;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color .15s;
}
.site-header nav a:hover { color: #f8fafc; }

/* ── Main ──────────────────────────────────────────────────────── */

main.container, main > .container {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

/* ── Footer ──────────────────────────────────────────────────── */

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  margin-top: 4rem;
}
.site-footer p { font-size: 0.82rem; color: var(--color-muted); }
.site-footer a { color: var(--color-primary); }

/* ── Typography ──────────────────────────────────────────────── */

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  color: #0f172a;
}
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: #1e293b;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: #334155;
}
p { margin-bottom: 1rem; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

strong { font-weight: 600; }

/* ── Article-specific wrappers ──────────────────────────────── */

.article-content { margin-top: 1.75rem; }

/* ── Images — kluczowa naprawa ──────────────────────────────── */

img { max-width: 100%; height: auto; display: block; }

figure { margin: 1.75rem 0; }
figcaption {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.4rem;
  text-align: center;
}

/* Hero image — pełna szerokość, ograniczona wysokość */
figure.article-image--hero {
  margin: 1.75rem -1.25rem;
  border-radius: 0;
  overflow: hidden;
}
figure.article-image--hero img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 0;
}

/* Zdjęcia produktów — małe, wycentrowane */
figure.article-image:not(.article-image--hero) {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 320px;
  margin: 1.5rem auto;
}
figure.article-image:not(.article-image--hero) img {
  max-height: 220px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ── Product sections (karty produktów) ─────────────────────── */

.product-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}
.product-section h2 {
  margin-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
  font-size: 1.2rem;
}

/* Listy plusy/minusy wewnątrz karty */
.product-section ul { list-style: none; padding-left: 0; }
.product-section ul li { padding: 0.2rem 0 0.2rem 1.6rem; position: relative; }
.product-section ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-cta);
  font-weight: 700;
}

/* Minusy — jeśli karta ma klasę .minusy lub nagłówek "Minusy" */
.product-section .minusy li::before,
.product-section ul.minusy li::before { content: "✗"; color: #dc2626; }

/* ── CTA buy buttons ─────────────────────────────────────────── */

a[href^="/go/"],
a[rel~="sponsored"] {
  display: inline-block;
  background: var(--color-cta);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
a[href^="/go/"]:hover,
a[rel~="sponsored"]:hover {
  background: var(--color-cta-dark);
  transform: translateY(-1px);
}

/* ── Comparison table ────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
}
thead th {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.85rem;
  text-align: left;
}
tbody tr:nth-child(even) { background: var(--color-surface); }
tbody tr:hover { background: #f0f9ff; }
td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
/* Highlight pierwszego rzędu tabeli (best pick) */
tbody tr:first-child td { font-weight: 500; }

/* ── Affiliate disclosure ────────────────────────────────────── */

.affiliate-disclosure {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  color: var(--color-warning-text);
  margin: 1.5rem 0;
}
.affiliate-disclosure a { color: #92400e; }

/* ── FAQ ──────────────────────────────────────────────────────── */

.faq {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-border);
}
.faq h2 { margin-top: 0; }

details {
  border-bottom: 1px solid var(--color-border);
}
details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: 1rem;
}
details[open] summary::after { content: "−"; }
details summary:hover { color: var(--color-primary); }
details p {
  padding: 0 0 1rem;
  color: #475569;
  font-size: 0.93rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Article footer ──────────────────────────────────────────── */

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
  color: var(--color-muted);
}
.last-updated { margin-top: 0.4rem; color: #94a3b8; }

/* ── Price notice (where-to-buy) ─────────────────────────────── */

.price-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: #0369a1;
  margin-bottom: 1rem;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.2rem; }

  figure.article-image--hero { margin: 1.5rem -1.25rem; }
  figure.article-image--hero img { max-height: 240px; }

  figure.article-image:not(.article-image--hero) { max-width: 100%; }

  .product-section { padding: 1.1rem; }

  table { font-size: 0.8rem; }
  thead th, td { padding: 0.5rem 0.6rem; }

  /* Horizontal scroll na małych ekranach dla tabel */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
