/* NeuroFora 360 · baza wspólna
   Reset, kontener, dostępność, sloty grafik Astra i struktura formularza kontaktowego. */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ol, ul, table { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd, dt { text-wrap: pretty; }
table { border-collapse: collapse; }

.wrap {
  width: 100%;
  max-width: var(--wrap, 1200px);
  margin-inline: auto;
  padding-left: max(var(--gutter, 20px), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter, 20px), env(safe-area-inset-right, 0px));
}

[id] { scroll-margin-top: var(--scroll-offset, 88px); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: -100px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--skip-bg, #fff);
  color: var(--skip-fg, #000);
  text-decoration: none;
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

:focus-visible {
  outline: 2px solid var(--focus, #9fc3ff);
  outline-offset: 3px;
}

/* ---------- Sloty grafik Astra ----------
   <figure class="astra" data-slot="…"> zawiera <img> i .astra__fallback.
   Dopóki plik grafiki nie istnieje, widać zaprojektowane tło zastępcze. */
.astra {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0;
}
.astra > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .9s ease;
}
.astra.is-loaded > img { opacity: 1; }
.astra__fallback { position: absolute; inset: 0; z-index: 0; }

/* ---------- Formularz kontaktowy: wspólna struktura ---------- */
.cform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cform-gap, 22px 26px);
}
.cform__field { display: grid; gap: 8px; min-width: 0; }
.cform__field--wide,
.cform__note,
.cform__actions,
.cform__status { grid-column: 1 / -1; }
.cform input,
.cform select,
.cform textarea { width: 100%; min-width: 0; }
.cform textarea { resize: vertical; min-height: 7.5em; }
.cform__status:empty { display: none; }
/* Pole-pułapka na automaty: niewidoczne dla ludzi, ale obecne w formularzu */
.cform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cform button[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
  .cform { grid-template-columns: minmax(0, 1fr); }
}

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