/* Bankuj z Głową - design system
   Paleta: papier, atrament granatowy, złoty (akcent), zieleń funkcyjna */

:root {
  --paper: #fdfcfa;
  --card: #ffffff;
  --ink: #1b2a4a;
  --ink-soft: #33415f;
  --muted: #5b6478;
  --zloty: #e8a020;
  --zloty-deep: #b97a10;
  --zloty-soft: #fdf3df;
  --mint: #177b54;
  --mint-soft: #e7f4ee;
  --line: #e9e4d9;
  --radius: 18px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(27, 42, 74, 0.05), 0 6px 24px rgba(27, 42, 74, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 5.5vw, 3.1rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 2.2em 0 0.7em; }
h3 { font-size: 1.15rem; margin: 1.6em 0 0.5em; }

p { margin: 0 0 1em; }

a { color: var(--zloty-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--zloty);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; }

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- uklad z sidebarem --- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 44px;
  align-items: start;
}

.sidebar { position: sticky; top: 88px; margin-top: 100px; }

.post-header h1 { margin-top: 34px; }

.post-header .meta { margin-bottom: 10px; }

.bio-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  font-size: 0.95rem;
}

.bio-card h3 { margin: 0 0 10px; }

.bio-card .bio-photo {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 4px 0 12px;
}

.about-photo {
  float: right;
  max-width: 300px;
  margin: 0 0 24px 32px;
  transform: rotate(1.4deg);
}

@media (max-width: 700px) {
  .about-photo { float: none; margin: 0 auto 24px; }
}

.bio-card p { color: var(--ink-soft); }

.bio-card .btn { display: block; text-align: center; font-size: 0.9rem; padding: 10px 16px; }

main.post-page .sidebar { margin-top: 0; }

@media (max-width: 980px) {
  .layout { display: block; }
  .sidebar { position: static; margin: 40px 0 0; }
  main.post-page .sidebar { margin-top: 40px; }
}

/* --- naglowek --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 252, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.logo img { height: 40px; width: auto; }

.logo-text { position: relative; top: 3px; }

.logo .zloty { color: var(--zloty-deep); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-nav a:hover { background: var(--zloty-soft); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    flex-direction: column;
  }
  .site-nav.open { display: flex; }
}

/* --- hero --- */

.hero { padding: 56px 0 30px; }

.hero .eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--zloty-deep);
  margin-bottom: 14px;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px 56px;
  align-items: center;
}

.hero-photo {
  margin: 0;
  justify-self: end;
  max-width: 380px;
  transform: rotate(1.4deg);
}

.hero-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(27, 42, 74, 0.18);
  border: 6px solid #fff;
}

.hero-photo figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.hero-grid .stat-strip { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .hero-grid { display: block; }
  .hero-photo { max-width: 340px; margin: 28px auto 0; }
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--zloty-deep);
}

.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* sygnatura: zakreslenie markerem */
.marker {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.marker::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.1em;
  right: -0.1em;
  bottom: 0.03em;
  height: 0.46em;
  background: var(--zloty);
  opacity: 0.45;
  border-radius: 0.08em;
  transform: skewX(-8deg) rotate(-0.6deg);
}

/* --- karty ofert --- */

.offer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.offer-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}

.card-top { display: flex; align-items: center; gap: 10px; min-height: 30px; }

.bank-logo { max-height: 28px; width: auto; object-fit: contain; }

.offer-card .bank {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.offer-card h3 {
  margin: 6px 0 4px;
  font-size: 1.22rem;
}

.offer-card h3 a { color: inherit; text-decoration: none; }
.offer-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--zloty); }

.offer-card .amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  margin: 10px 0 2px;
}

.amount small {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.offer-card ul.highlights {
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.offer-card ul.highlights li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 6px;
}

.offer-card ul.highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--mint);
  font-weight: 700;
}

.offer-card .card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- odznaki --- */

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.countdown { background: var(--zloty-soft); color: var(--zloty-deep); }
.badge.countdown.urgent { background: #fbe9e4; color: #b3401f; }
.badge.verified { background: var(--mint-soft); color: var(--mint); }
.badge.ended { background: #eee; color: var(--muted); }

.stars { color: var(--zloty); letter-spacing: 2px; font-size: 0.95rem; }
.stars .off { color: var(--line); }

/* --- przyciski --- */

.btn {
  display: inline-block;
  text-align: center;
  font-weight: 800;
  font-family: var(--font-body);
  text-decoration: none;
  border-radius: 12px;
  padding: 13px 22px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn.primary {
  background: var(--zloty);
  color: #241a05;
  box-shadow: 0 2px 0 var(--zloty-deep);
}

.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--zloty-deep); }
.btn.primary:active { transform: translateY(1px); box-shadow: none; }

.btn.ghost {
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn.ghost:hover { border-color: var(--zloty); }

.aff-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* --- tabele --- */

.table-scroll { overflow-x: auto; margin: 24px 0; }

table.offers {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.97rem;
  min-width: 640px;
}

table.offers th, table.offers td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

table.offers thead th {
  background: var(--paper);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

table.offers th[data-sort] { cursor: pointer; user-select: none; }
table.offers th[data-sort]:hover { color: var(--ink); }
table.offers th[data-sort]::after { content: " ↕"; opacity: 0.5; }
table.offers th[data-sort][aria-sort="descending"]::after { content: " ↓"; opacity: 1; }
table.offers th[data-sort][aria-sort="ascending"]::after { content: " ↑"; opacity: 1; }

table.offers tbody tr:last-child td { border-bottom: none; }
table.offers tbody tr:hover { background: var(--zloty-soft); }

table.offers .rate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--mint);
  white-space: nowrap;
}

/* --- sekcje na stronie oferty --- */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 20px 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 56px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--zloty);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.two-col {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 20px 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.panel h3 { margin-top: 0; }

.panel ul { margin: 0; padding-left: 20px; }
.panel li { margin-bottom: 6px; }

.panel.pros h3 { color: var(--mint); }
.panel.cons h3 { color: #b3401f; }

details.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 20px;
  margin-bottom: 10px;
}

details.faq-item summary {
  font-weight: 700;
  padding: 12px 0;
  cursor: pointer;
}

details.faq-item[open] summary { color: var(--zloty-deep); }

.offer-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin: 30px 0;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

@media (max-width: 640px) {
  .offer-hero { grid-template-columns: 1fr; }
}

.offer-hero .amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 20px 0 0;
}

.breadcrumbs a { color: var(--muted); }

/* --- kafelki kategorii --- */

.category-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 24px 0;
}

.category-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}

.category-tile:hover { transform: translateY(-2px); border-color: var(--zloty); }

.category-tile .emoji { font-size: 1.6rem; }

.category-tile h3 { margin: 8px 0 4px; }

.category-tile p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* --- blog --- */

.post-list { list-style: none; margin: 24px 0; padding: 0; }

.post-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
}

.post-list h3 { margin: 0 0 6px; }
.post-list h3 a { color: inherit; text-decoration: none; }
.post-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--zloty); }
.post-list .meta { font-size: 0.85rem; color: var(--muted); }

.article { max-width: 720px; }
.article-wide { max-width: none; }
.article h2 { margin-top: 1.6em; }

/* --- stopka --- */

.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  padding: 34px 20px 40px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.site-footer h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 10px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

.disclaimer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 0.76rem;
  color: #8b91a1;
}

/* --- drobiazgi --- */

.updated-note { font-size: 0.85rem; color: var(--muted); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head .more { font-weight: 700; font-size: 0.92rem; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
