/* ==========================================================================
   Základ: reset, prvky HTML, přístupnost
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, figure, fieldset, legend, blockquote, form, table {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Elms Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--z-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
a { color: var(--sky-text); }
img, svg, canvas { max-width: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; }
fieldset { border: 0; min-width: 0; }
hr { border: 0; border-top: 1px solid var(--z-200); margin: 16px 0; }
[hidden] { display: none !important; }

/* Pole formulářů — jednotný vzhled i bez třídy */
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="url"], input[type="date"], input[type="search"], input[type="time"],
input[type="datetime-local"], input[type="month"], select, textarea {
  max-width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #fff;
  color: var(--z-900);
  border: 1px solid var(--z-300);
  border-radius: var(--r);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
input::placeholder, textarea::placeholder { color: var(--z-500); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--z-500); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(1, 0, 102, .14);
}
input:disabled, select:disabled, textarea:disabled { background: var(--z-100); color: var(--z-500); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; flex-shrink: 0; }
input[type="range"] { accent-color: var(--ink); }

/* Přístupnost */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100000;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.max { flex: 1 1 auto; }

/* Omezený pohyb: žádné animace, obsah rovnou vidět */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* iOS: pole menší než 16 px přibližují stránku */
@media (max-width: 768px) {
  input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"],
  input[type="tel"], input[type="url"], input[type="date"], input[type="search"], select, textarea { font-size: 16px; }
}

[id] { scroll-margin-top: 72px; }

/* Plynulé posouvání na kotvy (Proč odbory, Jak to probíhá), pokud si uživatel nepřeje omezený pohyb */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Pole ve formulářích vyplní šířku sloupce */
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.form-group select, .form-group textarea, .field input, .field select, .field textarea { width: 100%; }
