/*
Theme Name: Papierowy Bilans
Theme URI: https://faxcena.pl/
Author: AA
Version: 1.0.0
Text Domain: aa-faxcena-papier
*/
/* ==========================================================================
   Fax cena — wspólny arkusz stylów
   Kierunek: biel + czerwień cenowa, wielkie liczby/etykiety, prosty landing
   Mobile-first, samowystarczalny (fonty systemowe, zero zasobów zdalnych)
   ========================================================================== */

/* ---------- Reset lekki ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; padding: 0; }

/* ---------- Design tokens ---------- */
:root {
  /* Biel / papier */
  --paper:    #ffffff;
  --paper-2:  #faf7f6;
  --paper-3:  #f3eeed;
  --card:     #ffffff;

  /* Czerwień cenowa */
  --red-700:  #9c0f27;
  --red-600:  #c21230;   /* czytelna na bieli (AA) */
  --red-500:  #d8163a;   /* akcent główny */
  --red-400:  #ef3355;
  --red-tint: #fdecef;
  --red-tint-2:#fbdbe1;

  /* Tusz / tekst */
  --ink:      #1b1513;
  --ink-2:    #3a302d;
  --muted:    #6a5f5b;   /* AA na bieli */
  --on-red:   #fff5f6;
  --on-dark:  #f6efed;
  --on-dark-muted: #d8c9c5;

  /* Linie / cienie */
  --line:     #ece4e2;
  --line-strong: #ddd0cd;
  --shadow-sm: 0 1px 2px rgba(60, 15, 22, .06), 0 2px 6px rgba(60, 15, 22, .05);
  --shadow-md: 0 8px 22px rgba(60, 15, 22, .10), 0 2px 6px rgba(60, 15, 22, .06);
  --shadow-lg: 0 24px 56px rgba(90, 10, 26, .18);

  /* Kształt / rytm */
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --pill:      999px;
  --wrap:      1180px;
  --gap:       clamp(1rem, 3vw, 2rem);
  --ease:      cubic-bezier(.2, .7, .2, 1);

  /* Typografia */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
}

/* ---------- Baza ---------- */
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper-2);
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.015em; font-weight: 800; color: var(--ink); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); }
p { max-width: 68ch; }

a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
main a { color: var(--red-600); }
main a:hover { color: var(--red-700); }

/* ---------- Dostępność ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--red-600); color: var(--on-red);
  padding: .7rem 1.1rem; border-radius: var(--pill);
  z-index: 100; font-weight: 700; box-shadow: var(--shadow-md);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--red-500);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Nagłówek / nawigacja ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px;
}

.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
  text-decoration: none; font-size: 1.2rem;
}
.brand:hover { color: var(--red-700); }
.brand .tag-mark { width: 34px; height: 34px; flex: none; }
.brand b { color: var(--red-600); font-weight: 800; }

.nav-toggle { display: none; }
.nav-btn {
  display: none;
  align-items: center; gap: .5rem;
  border: 1px solid var(--line-strong); background: var(--card);
  color: var(--ink); font-weight: 700; font-family: inherit;
  padding: .55rem .85rem; border-radius: var(--pill); cursor: pointer;
  box-shadow: var(--shadow-sm); font-size: .95rem;
}
.nav-btn .bars { width: 18px; height: 12px; position: relative; display: inline-block; }
.nav-btn .bars::before, .nav-btn .bars::after, .nav-btn .bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px;
}
.nav-btn .bars::before { top: 0; }
.nav-btn .bars span { top: 5px; }
.nav-btn .bars::after { bottom: 0; }

.main-nav ul { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.main-nav a {
  display: inline-block; text-decoration: none; color: var(--ink-2);
  font-weight: 600; padding: .5rem .8rem; border-radius: var(--pill);
  font-size: .96rem; line-height: 1.25; transition: background .15s var(--ease), color .15s var(--ease);
}
.main-nav a:hover { background: var(--red-tint); color: var(--red-700); }
.main-nav a[aria-current="page"] { background: var(--red-600); color: var(--on-red); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-family: inherit; text-decoration: none;
  padding: .8rem 1.3rem; border-radius: var(--pill); cursor: pointer;
  border: 1px solid transparent; font-size: 1rem; line-height: 1.1;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red-600); color: var(--on-red); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--red-700); box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--red-400); color: var(--red-700); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 4vw, 5rem) 0 clamp(2rem, 3vw, 3.5rem); position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red-700); background: var(--red-tint); border: 1px solid var(--red-tint-2);
  padding: .4rem .8rem; border-radius: var(--pill);
}
.hero h1 {
  font-size: clamp(2.1rem, 1.3rem + 4.6vw, 4.1rem);
  margin: 1.1rem 0 1rem; letter-spacing: -0.03em;
}
.hero h1 .accent { color: var(--red-600); }
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.28rem); color: var(--ink-2); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.hero-visual { position: relative; }
.price-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem); position: relative; overflow: hidden;
}
.price-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--red-tint) 0%, transparent 55%);
  pointer-events: none;
}
.price-card .pc-head { display: flex; align-items: center; gap: .7rem; position: relative; }
.price-card .pc-head svg { width: 42px; height: 42px; flex: none; }
.price-card .pc-title { font-weight: 800; letter-spacing: -0.01em; }
.price-card .pc-sub { color: var(--muted); font-size: .92rem; }
.pc-list { display: grid; gap: .6rem; margin-top: 1.2rem; position: relative; }
.pc-row { display: flex; align-items: center; gap: .7rem; font-weight: 600; color: var(--ink-2); }
.pc-row .dot {
  width: 24px; height: 24px; flex: none; border-radius: var(--pill);
  background: var(--red-tint); color: var(--red-700);
  display: grid; place-items: center;
}
.pc-row .dot svg { width: 14px; height: 14px; }

/* ---------- Wielkie liczby / stat tiles ---------- */
.stat-band { padding: clamp(1.5rem, 3vw, 2.5rem) 0; }
.stat-grid {
  display: grid; gap: clamp(.8rem, 2vw, 1.2rem);
  grid-template-columns: repeat(2, 1fr);
}
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.4vw, 1.6rem);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(var(--red-500), var(--red-600));
}
.stat .num {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.2rem); font-weight: 800;
  letter-spacing: -0.03em; color: var(--red-600); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat .num small { font-size: .42em; font-weight: 800; color: var(--red-700); letter-spacing: 0; }
.stat .lbl { margin-top: .55rem; color: var(--muted); font-weight: 600; font-size: .95rem; }
/* Cennik w panelu bocznym: jedna kolumna i mniejsza liczba — w wąskiej kolumnie 2×2 karta obcinała „221,40 zł”
   do „221,” przy 1440/1920 (przegląd przed K4, Fable 2026-09-08). */
.aside .stat-grid { grid-template-columns: 1fr; }
.aside .stat .num { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); }

/* ---------- Sekcje / karty ---------- */
.section { padding: clamp(2rem, 4vw, 3.5rem) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.section-head .kicker {
  font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red-700);
}
.section-head h2 { margin-top: .5rem; }
.section-head p { margin-top: .7rem; color: var(--ink-2); }

.card-grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); grid-template-columns: 1fr; }
.feature {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.3rem, 3vw, 1.9rem);
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.feature .ic {
  width: 52px; height: 52px; border-radius: 15px; flex: none;
  background: var(--red-tint); color: var(--red-600);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.feature .ic svg { width: 26px; height: 26px; }
.feature h3 { margin-bottom: .5rem; }
.feature p { color: var(--ink-2); max-width: none; }

/* ---------- Układ artykuł + aside ---------- */
.layout {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.article { min-width: 0; }
.article .post-head { margin-bottom: 1.6rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 700; padding: .35rem .75rem;
  border-radius: var(--pill); text-decoration: none;
  background: var(--red-tint); color: var(--red-700); border: 1px solid var(--red-tint-2);
}
a.chip:hover { background: var(--red-tint-2); }
.chip.neutral { background: var(--paper-3); color: var(--ink-2); border-color: var(--line); }

.article h1 {
  font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3rem); margin-bottom: .4rem; letter-spacing: -0.03em;
}
.prose > * + * { margin-top: 1.15rem; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 800; }
.prose a { font-weight: 600; }
.prose .highlight-name {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: 1.15rem; font-weight: 800;
}

/* Wyróżniony blok z ceną w treści */
.callout {
  background: var(--red-tint); border: 1px solid var(--red-tint-2);
  border-left: 5px solid var(--red-600);
  border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.6rem);
  margin-top: 1.4rem;
}
.callout .callout-title { font-weight: 800; color: var(--red-700); margin-bottom: .5rem; }
.callout p { color: var(--ink-2); }

/* Placeholder obrazu */
.img-ph {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px dashed var(--line-strong); background: var(--paper-3);
  display: block; text-decoration: none;
}
.img-ph svg { width: 100%; height: auto; display: block; }
.img-ph .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(27, 21, 19, .72));
  color: #fff; font-size: .82rem; font-weight: 600;
  padding: 1.6rem .9rem .7rem;
}
figure.media { margin: 1.4rem 0; }
figure.media figcaption { margin-top: .5rem; color: var(--muted); font-size: .88rem; }

/* ---------- Aside ---------- */
.aside { min-width: 0; display: grid; gap: clamp(1rem, 3vw, 1.5rem); align-content: start; }
.widget {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow-sm);
}
.widget h2, .widget h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.widget-title {
  font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red-700); margin-bottom: .9rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.index-list { display: grid; gap: .5rem; }
.index-list a {
  display: flex; align-items: center; gap: .6rem; text-decoration: none;
  padding: .6rem .8rem; border-radius: var(--radius); color: var(--ink-2);
  font-weight: 600; border: 1px solid var(--line); background: var(--paper-2);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.index-list a:hover { border-color: var(--red-400); color: var(--red-700); background: var(--red-tint); }
.index-list a .n {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--red-600); color: var(--on-red); font-weight: 800; font-size: .85rem;
  display: grid; place-items: center;
}

.rss-link {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; font-weight: 700; color: var(--red-700);
}
.rss-link svg { width: 20px; height: 20px; }

/* ---------- Paginacja ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; padding: 0 .8rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-weight: 700; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
}
.pagination a:hover { border-color: var(--red-400); color: var(--red-700); background: var(--red-tint); }
.pagination [aria-current="page"] { background: var(--red-600); color: var(--on-red); border-color: var(--red-600); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Stopka ---------- */
.site-footer {
  background: var(--ink); color: var(--on-dark);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem;
}
.footer-grid {
  display: grid; gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: 1fr;
}
.site-footer .brand { color: #fff; }
.site-footer .brand b { color: var(--red-400); }
.site-footer p { color: var(--on-dark-muted); max-width: 46ch; margin-top: .8rem; }
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: .9rem; }
.footer-links { display: grid; gap: .55rem; }
.footer-links a { color: var(--on-dark-muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.site-footer .rss-link { color: #fff; }
.site-footer .rss-link:hover { color: var(--red-400); }
.footer-bottom {
  margin-top: clamp(1.8rem, 4vw, 2.6rem); padding-top: 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center;
  color: var(--on-dark-muted); font-size: .9rem;
}
.footer-bottom a { color: var(--on-dark-muted); }
.footer-note { font-size: .82rem; color: rgba(216, 201, 197, .8); }

/* ==========================================================================
   Responsywność
   ========================================================================== */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .nav-btn, .nav-toggle { display: none !important; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- Menu mobilne (details/summary + fallback checkbox) ---------- */
@media (max-width: 899px) {
  .nav-btn { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .28s var(--ease), visibility .28s var(--ease);
  }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: .2rem; padding: .8rem clamp(1rem, 4vw, 2.5rem) 1.2rem; }
  .main-nav a { padding: .8rem 1rem; font-size: 1.05rem; }
  .nav-toggle:checked ~ .main-nav { max-height: 80vh; visibility: visible; overflow: auto; }
  .header-inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .aside, .hero-cta, .nav-btn { display: none !important; }
  body { background: #fff; }
}

/* =========================================================================
   Skala powyżej 1366 px (przegląd przed K4, Fable 2026-09-08)
   Pismo rośnie płynnie 16 → 20 px, kontener trzyma ~95 px marginesu
   bocznego aż do 1920 px; kolumny boczne w rem, żeby rosły z pismem.
   ========================================================================= */
@media (min-width: 1367px) {
  html { font-size: clamp(1rem, 0.384rem + 0.722vw, 1.25rem); }  /* 16 px przy 1366 → 20 px przy 1920 */
  :root { --wrap: clamp(1180px, 100vw - 190px, 1730px); }
  .layout { grid-template-columns: minmax(0, 1fr) 20rem; }
}
