/* ==========================================================================
   tarot.net.pl — base.css
   Reset, elementy HTML, typografia, dostępność.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums proportional-nums;
  font-feature-settings: "lnum" 1;
}
body.is-locked { overflow: hidden; }

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  color: var(--color-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}
h1, h2 { font-weight: var(--fw-display); }
em, i { font-style: italic; }
h1 em, h2 em, .lead em { font-family: var(--font-heading); font-style: italic; }
/* v3.0: druga linia H1 w kolorze Royal Blue (7.89:1 na Ivory) — akcent jak w szablonie, bez złotego tekstu */
.section--ivory h1 em, .section--cream h1 em { color: var(--royal-blue); }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: var(--space-2); }

p, ul, ol, dl, blockquote, figure { margin: 0 0 var(--space-3); }
p { text-wrap: pretty; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .35em; }
strong { font-weight: var(--fw-semibold); }

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { text-decoration-thickness: 2px; }

button { font: inherit; color: inherit; }

hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-5) 0; }

/* --- Focus: wysoki kontrast, tylko przy nawigacji klawiaturą --- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Dostępność --- */
.visually-hidden {
  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: var(--space-2);
  top: -100px;
  z-index: var(--z-skip);
  padding: .75rem 1.25rem;
  background: var(--midnight-blue);
  color: var(--soft-cream);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: var(--space-2); outline-color: var(--antique-gold); }

main:focus { outline: none; }

::selection { background: var(--royal-blue); color: var(--soft-cream); }

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

/* Długie adresy (e-mail, URL) nie mogą rozpychać strony na wąskich ekranach */
@media (max-width: 480px) { a[href^="mailto:"] { overflow-wrap: anywhere; } }
