/* ============================================================
   prawomundurowych.pl — design system
   Paper white / ink / deep uniform green / muted khaki
   Display: Spectral · Body/UI: Inter
   ============================================================ */

:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --ink: #21251f;
  --ink-soft: #4a4f45;
  --green: #3e4d3a;
  --green-dark: #2d3829;
  --green-tint: #eef0ea;
  --khaki: #86805f;
  --line: #e5e4da;
  --line-strong: #cfcec0;
  --max: 1100px;
  --radius: 3px;
  --font-display: "Spectral", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

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

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

/* ---------- chevron insignia (signature element) ---------- */
.chevrons {
  display: inline-block;
  width: 14px; height: 12px;
  position: relative;
  flex: none;
}
.chevrons::before, .chevrons::after {
  content: "";
  position: absolute; left: 1px;
  width: 10px; height: 10px;
  border-left: 2px solid var(--khaki);
  border-top: 2px solid var(--khaki);
  transform: rotate(45deg) scale(1, .72);
}
.chevrons::before { top: 0; }
.chevrons::after { top: 6px; }

/* ---------- header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 3px 0 -1px var(--line); /* slim double rule */
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 600; letter-spacing: .01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .chevrons::before, .brand .chevrons::after { border-color: var(--green); }
.brand em { font-style: normal; color: var(--green); }

/* ---------- nav + dropdowns ---------- */
.nav { display: flex; align-items: stretch; }
.nav ul { list-style: none; display: flex; }
.nav > ul > li { position: relative; }
.nav > ul > li > a {
  display: flex; align-items: center; gap: 7px;
  padding: 22px 14px;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-soft);
}
.nav > ul > li > a::after {
  content: ""; width: 7px; height: 7px; margin-top: -4px;
  border-right: 1.5px solid var(--khaki);
  border-bottom: 1.5px solid var(--khaki);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.nav > ul > li > a:hover, .nav > ul > li.open > a { color: var(--green-dark); }
.nav > ul > li.open > a::after { transform: rotate(225deg); margin-top: 2px; }

.dropdown {
  position: absolute; top: 100%; left: 0;
  min-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--green);
  box-shadow: 0 12px 28px rgba(33, 37, 31, .10);
  padding: 8px 0;
  display: none;
}
.nav li.open .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 10px 18px;
  font-size: .93rem; line-height: 1.4;
  color: var(--ink);
  border-left: 2px solid transparent;
}
.dropdown a:hover {
  background: var(--green-tint);
  border-left-color: var(--green);
  color: var(--green-dark);
}
.dropdown .dropdown-all {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--khaki);
}
.dropdown .dropdown-empty {
  padding: 10px 18px; font-size: .9rem; color: var(--khaki);
}
.dropdown a { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dropdown .dropdown-count {
  font-size: .72rem; font-weight: 600;
  color: var(--khaki);
  background: var(--green-tint);
  border-radius: 999px;
  padding: 1px 8px;
  flex: none;
}
.dropdown .dropdown-all { justify-content: flex-start; }

/* Plain nav item (Pomoc prawna) — no dropdown, no caret. */
.nav > ul > li.nav-plain > a::after { display: none; }

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

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 16px 30px rgba(33, 37, 31, .12);
  }
  .nav.open { display: block; }
  .nav ul { display: block; }
  .nav > ul > li > a { padding: 14px 24px; }
  .dropdown {
    position: static;
    min-width: 0;
    border: none; border-top: 1px solid var(--line);
    box-shadow: none;
    background: var(--bg);
  }
  .dropdown a { padding-left: 36px; }
}

/* ---------- hero / featured ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .74rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--khaki);
}

/* ---------- homepage ---------- */
.home {
  padding: 56px 0 56px;
  border-bottom: 1px solid var(--line);
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 56px;
  align-items: start;
}
.home-lead h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 600; line-height: 1.18;
  margin: 14px 0 20px;
}
.home-lead p { margin-bottom: 16px; max-width: 62ch; color: var(--ink-soft); }
.home-lead .lead { font-size: 1.06rem; color: var(--ink); }
.home-lead strong { color: var(--ink); font-weight: 600; }
.home-note {
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--khaki);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .88rem;
}
.home-side { display: flex; flex-direction: column; gap: 32px; }
.side-list--boxed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 22px 8px;
}
.side-list--boxed h2 { border-bottom-color: var(--line); }

/* "Może Cię zainteresować": Jekyll wypisuje wszystkich kandydatów, a wybiera
   js/site.js. Zanim skrypt zadziała (albo gdy JS jest wyłączony) pokazujemy
   tylko trzy pierwsze — bez tego lista mignęłaby w całości. */
.side-list--pick article:nth-child(n+4) { display: none; }
.side-list--pick.is-picked article { display: block; }

.side-list h2 {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--khaki);
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
}
.side-list article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.side-list article:last-child { border-bottom: none; }
.side-list h3 {
  font-family: var(--font-display);
  font-size: 1.02rem; font-weight: 600; line-height: 1.35;
}
.side-list h3 a { color: var(--ink); }
.side-list h3 a:hover { color: var(--green-dark); }
.side-list .meta { margin-top: 4px; }

@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- article cards ---------- */
.section { padding: 48px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600;
  display: flex; align-items: center; gap: 12px;
}
.section-head .more {
  font-size: .8rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-top-color: var(--green); transform: translateY(-2px); }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.16rem; font-weight: 600; line-height: 1.32;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--green-dark); }
.card p { font-size: .93rem; color: var(--ink-soft); }
.card .meta { margin-top: auto; padding-top: 8px; }

.meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  font-size: .78rem; color: var(--khaki);
}
.meta .cat {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--green);
}
.meta .cat .chevrons { transform: scale(.8); }

@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
@media (min-width: 861px) and (max-width: 1024px) { .cards { grid-template-columns: repeat(2, 1fr); } }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--green);
  color: #f2f3ee;
  padding: 44px 0;
}
.cta-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600;
}
.cta-band p { color: #cfd4c6; font-size: .95rem; max-width: 60ch; margin-top: 6px; }
.btn {
  display: inline-block;
  background: var(--bg); color: var(--green-dark);
  font-weight: 600; font-size: .88rem;
  letter-spacing: .04em;
  padding: 13px 26px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.btn:hover { background: #fff; color: var(--green-dark); }

/* ---------- category page ---------- */
.page-head { padding: 52px 0 8px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 600;
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px;
}
.page-head .intro { color: var(--ink-soft); max-width: 68ch; margin-top: 12px; }

.article-list { padding: 28px 0 56px; }

/* Two-column variant: article list left, subcategory nav right. */
.listing-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 56px;
  align-items: start;
  padding-top: 32px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  /* Odstęp przed paskiem CTA musi być na siatce, nie na lewej kolumnie —
     inaczej znika, gdy to boczna lista działów jest wyższa od listy wpisów. */
  padding-bottom: 56px;
}
.listing-grid .article-list { padding: 0; }
.listing-grid .article-list article { max-width: none; }
.listing-grid .article-list article:first-child { padding-top: 0; }

.branch-sections {
  position: sticky; top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.branch-sections h2 {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; line-height: 1.3;
  margin: 4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}
.branch-sections ul { list-style: none; margin: 0; padding: 0; }
.branch-sections li {
  border-bottom: 1px solid var(--line);
  font-size: .95rem; line-height: 1.35;
}
.branch-sections li:last-child { border-bottom: none; }
.branch-sections a,
.branch-sections li > span {
  display: block;
  padding: 11px 0 11px 16px;
  position: relative;
  color: var(--ink);
}
.branch-sections a::before,
.branch-sections li > span::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 5px; height: 5px; margin-top: -6px;
  border-right: 1.5px solid var(--khaki);
  border-top: 1.5px solid var(--khaki);
  transform: rotate(45deg);
}
.branch-sections a:hover { color: var(--green-dark); }
.branch-sections a:hover::before { border-color: var(--green); }
.branch-sections .is-current > span { font-weight: 600; color: var(--green-dark); }
.branch-sections .is-current > span::before { border-color: var(--green); }
.branch-sections-count {
  display: block;
  font-size: .76rem; color: var(--khaki);
  font-weight: 400;
  margin-top: 1px;
}

@media (max-width: 860px) {
  .listing-grid { grid-template-columns: 1fr; gap: 32px; }
  .branch-sections { position: static; order: -1; }
}

.article-list article {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  max-width: 760px;
}
.article-list h2 {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 600; line-height: 1.3;
}
.article-list h2 a { color: var(--ink); }
.article-list h2 a:hover { color: var(--green-dark); }
.article-list p { color: var(--ink-soft); font-size: .95rem; margin-top: 8px; }
.article-list .meta { margin-top: 10px; }

/* ---------- article page ---------- */
.article-page { padding: 52px 0 24px; }
.article-page .article-head { max-width: 860px; }
.article-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-weight: 600; line-height: 1.2;
  margin: 14px 0 14px;
}
/* Body left, spis treści działu right — mirrors the homepage proportions. */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 56px;
  align-items: start;
  margin-top: 24px;
  /* Jak w .listing-grid — odstęp na siatce, żeby wysoki spis treści
     nie dotykał paska CTA. */
  padding-bottom: 32px;
}
.article-body {
  max-width: 700px;
  padding: 0 0 24px;
  font-size: 1.03rem;
}

/* Sticky section table of contents */
.section-toc {
  position: sticky; top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.section-toc .eyebrow { margin-bottom: 4px; }
.section-toc h2 {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; line-height: 1.3;
  margin: 4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}
/* Scoped to direct children so the "Z działu" fallback list below doesn't
   inherit the numbering or the hanging indent. */
.section-toc > ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.section-toc > ol > li {
  counter-increment: toc;
  position: relative;
  padding: 9px 0 9px 30px;
  border-bottom: 1px solid var(--line);
  font-size: .93rem; line-height: 1.4;
}
.section-toc > ol > li:last-child { border-bottom: none; }
.section-toc > ol > li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 10px;
  font-size: .72rem; font-weight: 600;
  color: var(--khaki);
}
.section-toc a { color: var(--ink); }
.section-toc a:hover { color: var(--green-dark); }
.section-toc .is-current > span {
  font-weight: 600; color: var(--green-dark);
  display: block;
}
.section-toc .is-current::before { color: var(--green); }
.section-toc-more {
  display: inline-block;
  margin-top: 16px;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--khaki);
}
.section-toc-more:hover { color: var(--green-dark); }

/* Sibling list — shown when the current section has only one article */
.toc-related {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
}
/* Promoted to the top of the box (empty TOC above): drop the extra rule,
   the h2 underline already separates it from the section name. */
.section-toc > ol:empty + .toc-related {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.toc-related h3 {
  font-size: .74rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--khaki);
  margin-bottom: 10px;
}
.toc-related ul { list-style: none; margin: 0; padding: 0; }
.toc-related li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem; line-height: 1.4;
}
.toc-related li:last-child { border-bottom: none; }
.toc-related a { color: var(--ink); display: block; }
.toc-related a:hover { color: var(--green-dark); }
.toc-related-sec {
  display: block;
  font-size: .72rem; color: var(--khaki);
  margin-top: 2px;
}

@media (max-width: 860px) {
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .section-toc { position: static; }
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 600;
  margin: 36px 0 12px;
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600;
  margin: 28px 0 10px;
}
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--green);
  background: var(--green-tint);
  padding: 14px 20px;
  margin: 0 0 18px;
  font-size: .97rem;
}
/* "Artykuł dotyczy:" — widoczne tylko gdy wpis należy do kilku działów */
.article-sections {
  max-width: 700px;
  margin: 0 0 24px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px;
}
.article-sections-label {
  font-size: .74rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--khaki);
  margin-right: 4px;
}
.article-sections > a {
  display: inline-flex; flex-direction: column;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .88rem; font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.article-sections > a:hover {
  border-left-color: var(--green-dark);
  background: var(--green-tint);
  color: var(--green-dark);
}
.article-sections-branch {
  font-size: .7rem; font-weight: 400;
  color: var(--khaki);
  letter-spacing: .04em;
}

.disclaimer {
  max-width: 700px;
  margin: 8px 0 48px;
  padding: 16px 20px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--khaki);
  border-radius: var(--radius);
  font-size: .85rem; color: var(--ink-soft);
  background: var(--surface);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  box-shadow: inset 0 3px 0 -1px var(--line); /* mirrored double rule */
  padding: 36px 0 44px;
  margin-top: 24px;
  font-size: .88rem; color: var(--ink-soft);
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-inner nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-inner a { color: var(--ink-soft); }
.footer-inner a:hover { color: var(--green-dark); }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600; color: var(--ink);
}
.footer-credit {
  display: inline-block;
  margin-top: 8px;
  font-size: .82rem; color: var(--khaki);
}
