:root {
  --green: #2f7d4f;
  --green-dark: #1e5836;
  --green-soft: #eaf4ee;
  --ink: #1c2620;
  --muted: #61706a;
  --bg: #fcfdfc;
  --card: #ffffff;
  --line: #e4ebe6;
  --amber: #b9770a;
  --amber-soft: #fdf3e2;
  --blue: #2563a8;
  --blue-soft: #eaf1fb;
  --shadow: 0 1px 2px rgba(20,40,30,.04), 0 6px 24px rgba(20,40,30,.06);
  --wrap: 1120px;
  --read: 720px;
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
}

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--ink); }

a { color: var(--green-dark); text-decoration-color: rgba(47,125,79,.35); text-underline-offset: 2px; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 22px; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--green-dark); text-decoration: none; letter-spacing: -.01em; }
.brand-logo { height: 36px; width: 36px; border-radius: 8px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; }
.site-nav a:hover { color: var(--green); }

main { padding-bottom: 3.5rem; }

/* ---------- Hero ---------- */
.hero { padding: 2.6rem 0 1.6rem; text-align: center; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin: 0 0 .6rem; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* ---------- Cards grid ---------- */
.cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(20,40,30,.10); }
.card-imgwrap { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--green-soft); }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; }
.card-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.card-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.25; color: var(--ink); text-decoration: none; }
.card-title:hover { color: var(--green-dark); }
.card-desc { margin: 0; color: var(--muted); font-size: .95rem; }
.card-meta { margin-top: auto; padding-top: .4rem; color: var(--muted); font-size: .8rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding-top: 1.4rem; }
.breadcrumb .wrap { max-width: var(--read); padding: 0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Article ---------- */
.post { max-width: var(--read); margin: 0 auto; padding-top: .4rem; }
.post h1 { font-size: clamp(2rem, 3.6vw, 2.7rem); letter-spacing: -.02em; margin: .6rem 0 .2rem; }
.post h2 { font-size: 1.6rem; margin: 2.4rem 0 .7rem; padding-top: .4rem; }
.post h3 { font-size: 1.22rem; margin: 1.6rem 0 .4rem; }
.post p, .post li { font-size: 1.06rem; }
.post ul, .post ol { padding-left: 1.3rem; }
.post li { margin: .3rem 0; }
.post strong { color: var(--ink); }
.post a { font-weight: 500; }

/* meta bar pod H1 */
.post-metabar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted); font-size: .85rem; margin: .3rem 0 1.6rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.post-metabar > * { position: relative; }
.post-metabar > *:not(:last-child)::after { content: "·"; margin-left: .6rem; color: var(--line); }
.pm-cat { color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; }

/* spis treści */
.toc { background: var(--green-soft); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 2rem; }
.toc summary { cursor: pointer; font-weight: 600; font-family: var(--serif); }
.toc-list { list-style: none; margin: .7rem 0 0; padding: 0; }
.toc-list li { margin: .3rem 0; }
.toc-list a { text-decoration: none; color: var(--green-dark); }
.toc-list a:hover { text-decoration: underline; }
.toc-sub { padding-left: 1.1rem; font-size: .95rem; }

/* tabele */
.post table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; font-size: .98rem; box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }
.post th, .post td { border-bottom: 1px solid var(--line); padding: .65rem .85rem; text-align: left; }
.post thead th { background: var(--green); color: #fff; font-weight: 600; }
.post tbody tr:nth-child(even) { background: #f7faf8; }

/* callout boxy (Markdig custom containers :::nazwa) */
.callout { border-radius: 12px; padding: 1rem 1.1rem 1rem 1.15rem; margin: 1.6rem 0; border-left: 5px solid var(--green); background: var(--green-soft); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout::before { display: block; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .4rem; }
.callout--wskazowka { border-color: var(--green); background: var(--green-soft); }
.callout--wskazowka::before { content: "💡 Wskazówka"; color: var(--green-dark); }
.callout--warto { border-color: var(--blue); background: var(--blue-soft); }
.callout--warto::before { content: "📌 Warto pamiętać"; color: var(--blue); }
.callout--uwaga { border-color: var(--amber); background: var(--amber-soft); }
.callout--uwaga::before { content: "⚠️ Uwaga"; color: var(--amber); }
.callout--podsumowanie { border-color: var(--green-dark); background: #eef6f0; }
.callout--podsumowanie::before { content: "✅ W skrócie"; color: var(--green-dark); }

/* tagi */
.post-tags { margin: 2.2rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; }

/* box autora */
.author-box { display: flex; gap: 1rem; align-items: flex-start; background: #f6f9f7; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 2.6rem 0 0; }
.author-avatar { border-radius: 50%; width: 72px; height: 72px; object-fit: cover; flex-shrink: 0; }
.author-kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.author-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; display: block; }
.author-role { margin: .1rem 0 .4rem; color: var(--muted); font-size: .9rem; font-weight: 500; }
.author-bio { margin: 0; color: var(--ink); font-size: .95rem; }

/* powiązane */
.related { max-width: var(--wrap); margin: 3rem auto 0; }
.related h2 { font-size: 1.5rem; margin: 0; }

/* strona autora */
.author-hero { display: flex; gap: 1.4rem; align-items: center; max-width: var(--read); margin: 2.4rem auto 0; }
.author-avatar-lg { border-radius: 50%; width: 96px; height: 96px; object-fit: cover; }
.author-hero h1 { margin: 0 0 .2rem; font-size: 2rem; }

/* ---------- Top bar ---------- */
.topbar { background: var(--green-dark); color: #eaf4ee; font-size: .82rem; }
.topbar .wrap { padding-top: .45rem; padding-bottom: .45rem; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: #eef4f0; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; margin-top: 3rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 2.4rem 22px 1.6rem; }
.foot-brand { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--green-dark); }
.foot-col p { margin: .5rem 0 0; }
.foot-col h3 { font-size: 1rem; margin: 0 0 .6rem; color: var(--ink); }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: .35rem 0; }
.foot-col a { color: var(--green-dark); text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-bottom { border-top: 1px solid var(--line); text-align: center; padding: 1rem 22px 1.6rem; font-size: .85rem; }
.foot-bottom p { margin: 0; }
.empty-note { color: var(--muted); padding: 2.5rem 0; text-align: center; font-size: 1.05rem; }

/* ---------- Sekcje kategorii (strona główna) ---------- */
.cat-section { margin-top: 2.6rem; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--green-soft); padding-bottom: .5rem; margin-bottom: .2rem; }
.cat-head h2 { margin: 0; font-size: 1.7rem; }
.cat-head h2 a { color: var(--ink); text-decoration: none; }
.cat-head h2 a:hover { color: var(--green-dark); }
.see-all { font-size: .9rem; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--green-dark); }
.see-all:hover { text-decoration: underline; }

/* sekcje klastrów (strona kategorii) */
.cluster-section { margin-top: 2.2rem; }
.cluster-title { font-size: 1.4rem; margin: 0 0 .2rem; padding-bottom: .4rem; border-bottom: 2px solid var(--green-soft); }

/* ---------- Wyszukiwarka ---------- */
.search { position: relative; display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; transition: box-shadow .18s ease, border-color .18s ease; min-width: 210px; }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.search-ico { color: var(--muted); flex-shrink: 0; }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: .95rem; width: 100%; min-width: 120px; }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; opacity: 0; transform: translateY(-6px); transition: opacity .16s ease, transform .16s ease; pointer-events: none; }
.search-results.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sr-item { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .85rem; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .12s ease; }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.is-active { background: var(--green-soft); }
.sr-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--green); font-weight: 700; }
.sr-title { color: var(--ink); font-size: .95rem; }
.sr-empty { padding: .85rem; color: var(--muted); font-size: .9rem; }

/* ---------- Animowany hero (welcome page) ---------- */
.hero-cine { position: relative; height: 100vh; min-height: 560px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #11221a; }
.hero-media { position: absolute; inset: -4%; will-change: transform; }
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,38,28,.28) 0%, rgba(18,38,28,.45) 55%, rgba(18,38,28,.68) 100%); }
.hero-content { position: relative; z-index: 2; text-align: center; color: #fff; max-width: 820px; padding: 0 22px; }
.hero-content h1 { color: #fff; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .7rem; text-shadow: 0 2px 24px rgba(0,0,0,.4); }
.hero-content p { color: #eef6f0; font-size: clamp(1.05rem, 2.2vw, 1.35rem); margin: 0 auto; max-width: 640px; text-shadow: 0 1px 14px rgba(0,0,0,.35); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.7rem; }
.btn { display: inline-block; padding: .82rem 1.6rem; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn-primary { background: linear-gradient(135deg, #3aa862, #1e5836); color: #fff; box-shadow: 0 10px 26px rgba(30,88,54,.5); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(30,88,54,.6); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1.5px solid rgba(255,255,255,.65); }
.btn-ghost:hover { background: rgba(255,255,255,.26); transform: translateY(-2px); }
.hero-hint { margin-top: 2.4rem; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.hero-hint::after { content: "↓"; display: block; font-size: 1.3rem; margin-top: .35rem; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* animacje wejścia sekcji */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* baner kategorii ze zdjęciem w tle */
.cat-hero { position: relative; border-radius: var(--radius); overflow: hidden; background-size: cover; background-position: center; margin: 1.4rem 0 .8rem; box-shadow: var(--shadow); }
.cat-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,38,28,.35), rgba(18,38,28,.66)); }
.cat-hero-inner { position: relative; padding: 3.2rem 1.5rem; text-align: center; color: #fff; }
.cat-hero-inner h1 { color: #fff; margin: 0 0 .4rem; font-size: clamp(2rem, 4vw, 2.8rem); text-shadow: 0 2px 16px rgba(0,0,0,.45); }
.cat-hero-inner p { color: #eef6f0; margin: 0 auto; max-width: 620px; text-shadow: 0 1px 12px rgba(0,0,0,.4); }

@media (prefers-reduced-motion: reduce) {
  .hero-layer { transition: none; }
  .reveal { opacity: 1; transform: none; }
  .hero-hint::after { animation: none; }
}

/* ---------- Responsywność ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav { gap: .8rem; }
  .author-box { flex-direction: column; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .header-inner { flex-direction: column; align-items: stretch; gap: .6rem; }
  .search { min-width: 0; width: 100%; }
  .cat-head h2 { font-size: 1.45rem; }
}
