* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }

p { line-height: 1.65; color: var(--text-mid); margin: 0 0 1rem 0; }

a { color: inherit; }

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 8vw;
}

@media (min-width: 1000px) {
  .container { padding: 0 3.5rem; }
}

/* ============ HEADER / NAV ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 22, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* Drugi <ul> wstrzykiwany przez nav.js (Czynności/Dokumenty/Opłaty/Q&A) —
   na desktopie te same linki żyją w dolnym pasku .quick-links, więc tu
   zostają ukryte; na mobile .quick-links chowamy (patrz niżej) i dopiero
   wtedy ta lista pokazuje się w menu hamburgera, pod linkami głównymi.
   Selektor musi być specyficzniejszy niż ".site-nav ul { display: flex }"
   powyżej, inaczej ta reguła wygrywa i lista wychodzi od razu w górnym
   nav barze na desktopie. */
.site-nav .site-nav-quick { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    inset: 4.5rem 0 0 0;
    background: var(--bg);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-top: 1px solid var(--line);
    overflow-y: auto;
  }
  .site-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) 8vw;
  }
  .site-nav a {
    display: block;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .site-nav .site-nav-quick {
    display: flex;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
  }
  .site-header--minimal .site-nav .site-nav-quick a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
  }
}

/* ============ HEADER — minimal variant (photo-hero pages) ============
   Used by pages that mount the shared header via #site-header + nav.js
   (no logo/brand, full-width uppercase nav). Scoped with --minimal so it
   never touches the classic .site-header used on the not-yet-redesigned
   pages (Usługi, Dokumenty, Dojazd, FAQ, Instytucje, Współpraca). */

.site-header.site-header--minimal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* Sheer, not a solid bar — but a soft scrim is still needed so the nav
     stays legible no matter how bright the photo behind it is (e.g. the
     man's face/sky on kontakt.html's right panel). */
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.55) 0%, rgba(8, 7, 6, 0) 100%);
  backdrop-filter: none;
  border-bottom: none;
}

.site-header--minimal .container {
  justify-content: flex-start;
  /* Match .quick-links' 16vw inset exactly, at every width, so the top nav
     and bottom quick-links bar start/end on the same vertical line. */
  max-width: none;
  padding-left: 16vw;
  padding-right: 16vw;
}

@media (max-width: 900px) {
  .site-header--minimal .container { justify-content: space-between; }
}

@media (min-width: 901px) {
  .site-header--minimal .site-nav { flex: 1 1 auto; }
  .site-header--minimal .site-nav ul { width: 100%; justify-content: space-between; gap: 2rem; }
}

.site-header--minimal .site-nav a {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--text-mid);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid transparent;
}

.site-header--minimal .site-nav a:hover,
.site-header--minimal .site-nav a[aria-current="page"] {
  color: var(--text);
  border-color: var(--accent);
}

/* ============ FOOTER ============ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
  background: var(--bg-soft);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ============ PAGE HERO (non-homepage) ============ */

.page-hero {
  padding: var(--space-5) 0 var(--space-4) 0;
  border-bottom: 1px solid var(--line);
}

.page-hero .eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.75rem 0;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 500;
  color: var(--text);
}

.page-hero p.lede {
  max-width: 60ch;
  margin-top: var(--space-2);
}

/* ============ REVEAL ANIMATIONS ============ */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: revealUp 0.9s var(--ease) forwards;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-on-scroll {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ============ BUTTONS ============ */

.btn {
  appearance: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 0.95rem 2.3rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, gap 0.3s ease;
}

.btn:hover, .btn:focus-visible {
  border-color: var(--accent);
  background: rgba(182, 147, 90, 0.08);
  box-shadow: 0 0 28px var(--accent-glow);
  gap: 1.1rem;
  outline: none;
}

.btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.btn svg { width: 0.85rem; height: 0.85rem; stroke: var(--accent); transition: transform 0.4s ease; }
.btn:hover svg { transform: translateX(3px); }

/* ============ QUICK LINKS (overlay bar on photo sections) ============ */

.quick-links {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  /* 16vw at every width — matches the ~16-18% edge inset measured in the PDF
     mockup. Previously this collapsed to a fixed 6rem past 1000px (≈6.7% at
     1440px), pinning the bar too close to the edges on laptop/desktop
     viewports. */
  padding: var(--space-3) 16vw;
}

.quick-links a {
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--text-mid);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.quick-links a:hover,
.quick-links a:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}

/* Na mobile te same linki żyją już w menu hamburgera (.site-nav-quick),
   więc dolny pasek na zdjęciu chowamy całkowicie. Musi być zdefiniowane
   PO bezwarunkowym .quick-links{display:flex} powyżej, żeby wygrać przy
   tej samej specyficzności. */
@media (max-width: 900px) {
  .quick-links { display: none; }
}

/* ============ ACCORDION (Usługi / Dokumenty / FAQ) ============ */

.acc-list {
  border-top: 1px solid var(--line);
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-3) 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.3s ease;
}

.acc-summary::-webkit-details-marker { display: none; }

.acc-summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.acc-item[open] .acc-summary::after { transform: rotate(45deg); }
.acc-summary:hover { color: var(--accent); }

.acc-body {
  padding: 0 0 var(--space-3) 0;
  max-width: 70ch;
}

.acc-body ul { margin: 0; padding-left: 1.2rem; color: var(--text-mid); }
.acc-body li { margin-bottom: 0.4rem; }

.acc-error { color: var(--text-dim); font-style: italic; }
