/* base.css — reset, typografia, nav, footer, elementy wspólne (H8 a11y) */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  color: var(--text);
}
p { margin: 0 0 1em; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.25em; }

/* Focus — widoczny (H8 pkt 5) */
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip-link (H8 pkt 5) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--fiolet);
  color: var(--on-fiolet);
  padding: 0.5em 1em;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- NAV ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.site-nav .brand:hover { text-decoration: none; }
.site-nav .brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--fiolet), var(--mint));
}
.site-nav nav { display: flex; gap: 1rem; }
.site-nav nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
}
.site-nav nav a:hover { color: var(--mint); text-decoration: none; }

/* hamburger (wzorzec Yasuke) — obok przełącznika motywu, widoczny tylko na mobile */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}
.nav__toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: 0.25s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile: linki chowają się, otwiera je hamburger */
@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .site-nav nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    display: none;
  }
  .site-nav nav[data-open="true"] { display: flex; }
  .site-nav nav a {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--line);
    font-size: 1rem;
    color: var(--text);
  }
  .site-nav nav a:hover { background: var(--bg-elevated); color: var(--mint); }
}

/* ---------- BREADCRUMBS (okruszki na podstronach) ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1rem 0;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--text-soft);
}
/* breadcrumb tuż nad blokiem treści — zmniejsz górny odstęp następnego bloku,
   żeby okruszki i tytuł tworzyły jeden nagłówek (zamiast wisieć w pustce) */
.crumbs + .block {
  padding-top: 0.75rem;
}
.crumbs a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--ease) 0.15s;
}
.crumbs a:hover {
  color: var(--mint);
}
.crumbs span[aria-current="page"] {
  color: var(--text);
}
.crumbs__sep {
  color: var(--line);
  opacity: 0.7;
  user-select: none;
  font-size: 0.75rem;
}

/* ---------- PRZYCISKI STERUJĄCE (motyw) ---------- */
.site-nav__ctrls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ctrl[hidden] {
  display: none;
}
.ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.ctrl:hover {
  border-color: var(--mint);
  color: var(--mint);
}
.ctrl__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.ctrl__icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- SCROLL-TO-TOP (pływający) ---------- */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--fiolet);
  color: var(--on-fiolet);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--ease) 0.2s, transform 0.2s;
  z-index: 99;
}
.scroll-top:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.scroll-top[hidden] {
  display: none;
}

/* ---------- FOOTER ---------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--mint); }

/* ---------- LAYOUT (kontener bloków) ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- BLOKI (wspólna rama) ---------- */
.block {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1rem;
}
.block h2 {
  margin-bottom: 1rem;
}

/* ---------- PRZYCISKI ---------- */
.btn {
  display: inline-block;
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--ease) 0.15s, opacity 0.15s;
}
.btn--mint {
  background: var(--mint);
  color: var(--on-mint);
}
.btn--mint:hover { opacity: 0.9; text-decoration: none; }
.btn--fiolet {
  background: var(--fiolet);
  color: var(--on-fiolet);
}
.btn--fiolet:hover { opacity: 0.9; text-decoration: none; }

/* ---------- FORMULARZ (szkielet, reszta w blocks.css) ---------- */
form label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 500; }
form input, form select, form textarea {
  width: 100%;
  padding: 0.6em 0.8em;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--fiolet);
  border-color: var(--fiolet);
}
form label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-weight: 400;
  font-size: 0.9rem;
}
form label.check input { width: auto; margin-top: 0.3em; }

/* Błąd walidacji pola (form.js — aria-invalid + role=alert) */
form input[aria-invalid="true"],
form select[aria-invalid="true"],
form textarea[aria-invalid="true"] {
  border-color: var(--err);
}
.field-error {
  color: var(--err);
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}

/* Status wysyłki formularza (render.js) */
.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--mint);
  color: var(--text);
}
.form-status--error {
  border-color: var(--err);
  color: var(--err);
}
