/* ============================================================
   RIVIERA DESIGN SYSTEM — BASE
   Reset moderno + elementi HTML. Dipende da tokens.css.
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--rn-font-sans);
  font-size: var(--rn-fs-base);
  line-height: var(--rn-lh-base);
  font-weight: var(--rn-fw-regular);
  background-color: var(--rn-color-bg);
  color: var(--rn-color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings — display geometrico/tech premium (Sora) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--rn-font-display);
  font-weight: var(--rn-fw-semibold);
  line-height: var(--rn-lh-tight);
  color: inherit;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 { font-size: var(--rn-fs-3xl); }
h2 { font-size: var(--rn-fs-2xl); }
h3 { font-size: var(--rn-fs-xl); }
h4 { font-size: var(--rn-fs-lg); }
h5 { font-size: var(--rn-fs-md); }
h6 { font-size: var(--rn-fs-base); }

p { line-height: var(--rn-lh-base); }
p + p { margin-top: var(--rn-space-3); }

small { font-size: var(--rn-fs-sm); }
strong, b { font-weight: var(--rn-fw-semibold); }

/* Link */
a {
  color: var(--rn-gold-600);
  text-decoration: none;
  transition: color var(--rn-dur-fast) var(--rn-ease);
}
a:hover { color: var(--rn-dark); }

/* Liste: rimuovi default dove serve via .rn-list-reset */
.rn-list-reset { list-style: none; margin: 0; padding: 0; }

/* Media responsive */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
svg { fill: currentColor; }

/* Form elements ereditano il font */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; }

/* Tabelle pulite (no puzza WP) */
table { border-collapse: collapse; width: 100%; }

/* Focus accessibile e visibile su superficie chiara o scura */
:focus-visible {
  outline: 3px solid var(--rn-focus);
  outline-offset: 2px;
  border-radius: var(--rn-radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* Selezione testo */
::selection { background: var(--rn-gold); color: var(--rn-color-on-gold); }

/* Skip link accessibilità */
.rn-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--rn-z-toast);
  background: var(--rn-dark);
  color: var(--rn-color-on-dark);
  padding: var(--rn-space-3) var(--rn-space-4);
  border-radius: var(--rn-radius-sm);
}
.rn-skip-link:focus { left: var(--rn-space-3); top: var(--rn-space-3); }

/* Hidden visivo ma leggibile da screen reader */
.rn-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;
}

/* Container fluido di base */
.rn-container {
  width: 100%;
  max-width: var(--rn-container);
  margin-inline: auto;
  padding-inline: var(--rn-gutter);
}
.rn-container--narrow { max-width: var(--rn-container-narrow); }
