/* ==========================================================================
   GuidaBenessere — Base Reset, Zero-Overflow & Fluid Typography (css/base.css)
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--gb-font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gb-ink-primary);
  background-color: var(--gb-bg-canvas);
  background-image:
    radial-gradient(circle at 10% 6%, rgba(58, 107, 92, 0.20) 0%, transparent 38%),
    radial-gradient(circle at 90% 14%, rgba(201, 106, 27, 0.16) 0%, transparent 36%),
    radial-gradient(circle at 75% 54%, rgba(30, 41, 66, 0.12) 0%, transparent 44%),
    radial-gradient(circle at 16% 84%, rgba(58, 107, 92, 0.15) 0%, transparent 42%);
  background-attachment: fixed;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.gb-scroll-lock {
  overflow: hidden;
}

/* Enforce zero overflow on grid & flex items */
*,
*::before,
*::after {
  min-width: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gb-cta-saffron);
  outline-offset: 2px;
}

/* Headings & Italian Word-Wrapping Rules */
h1,
h2,
h3,
h4,
.gb-h1,
.gb-h2,
.gb-h3 {
  font-family: var(--gb-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--gb-ink-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

h1,
.gb-h1 {
  font-size: clamp(1.85rem, 5.2vw, 3.25rem);
}

h2,
.gb-h2 {
  font-size: clamp(1.45rem, 3.6vw, 2.35rem);
}

h3,
.gb-h3 {
  font-size: clamp(1.125rem, 2.2vw, 1.4rem);
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Editorial Serif Subtitles & Quotes */
.gb-editorial-subtitle {
  font-family: var(--gb-font-editorial);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--gb-ink-secondary);
  font-weight: 400;
}

.gb-quote {
  font-family: var(--gb-font-editorial);
  font-style: italic;
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  border-left: 3px solid var(--gb-cta-saffron);
  padding-left: 1rem;
  margin: 1.25rem 0;
}

/* Tabular Numbers for Italian Prices, Ratings & Calculator Values */
.gb-num {
  font-variant-numeric: tabular-nums;
}

/* Accessibility Helpers */
.gb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gb-skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--gb-bg-indigo);
  color: var(--gb-ink-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--gb-radius-pill);
  font-weight: 600;
  transition: top 0.15s ease;
}

.gb-skip-link:focus {
  top: 0.75rem;
}

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