/* ==========================================================================
   BenessereNaturale — Base Styles, Typography & Mobile Zero-Overflow Foundation
   ========================================================================== */

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bn-bg-linen);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: var(--bn-bg-linen);
  color: var(--bn-ink-primary);
  font-family: var(--bn-font-sans);
  font-size: var(--bn-text-base);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.bn-no-scroll {
  overflow: hidden;
}

/* Zero-overflow guards for media, SVGs & Flex/Grid children */
svg,
picture,
video,
canvas,
iframe {
  max-width: 100%;
  display: block;
}

main,
section,
header,
footer,
article,
aside {
  min-width: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
.bn-serif {
  font-family: var(--bn-font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.16;
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: var(--bn-h1);
  font-weight: 600;
}

h2 {
  font-size: var(--bn-h2);
}

h3 {
  font-size: var(--bn-h3);
}

h4 {
  font-size: var(--bn-h4);
  font-family: var(--bn-font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 em,
h2 em,
h3 em,
.bn-serif em {
  font-style: italic;
  font-weight: 500;
}

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

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

ul,
ol {
  margin: 0;
  padding-left: 1.25rem;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

button {
  cursor: pointer;
}

/* Tabular figures for prices, ratings, calculator & totals */
.bn-tabular {
  font-variant-numeric: tabular-nums;
}

/* Focus Visibility (WCAG AA/AAA) */
:focus-visible {
  outline: 2.5px solid var(--bn-accent-herbal);
  outline-offset: 2px;
}

.bn-section--dark :focus-visible,
.bn-hero :focus-visible,
.bn-footer :focus-visible {
  outline-color: var(--bn-ink-on-dark);
}

/* Accessibility Helpers */
.bn-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;
}

.bn-skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--bn-bg-forest);
  color: var(--bn-ink-on-dark);
  padding: 0.75rem 1.25rem;
  border-radius: var(--bn-radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--bn-duration-fast) var(--bn-ease);
}

.bn-skip-link:focus {
  top: 1rem;
}

/* Containers & Sections */
.bn-container {
  width: 100%;
  max-width: var(--bn-container-max);
  margin-inline: auto;
  padding-inline: var(--bn-gutter);
}

.bn-section {
  padding-block: var(--bn-section-pad);
}

.bn-section--chalk {
  background-color: var(--bn-bg-chalk);
  border-block: 1px solid var(--bn-border-hairline);
}

.bn-section--mist {
  background-color: var(--bn-bg-sage-mist);
  border-block: 1px solid rgba(46, 90, 68, 0.16);
}

.bn-section--dark {
  background-color: var(--bn-bg-forest);
  color: var(--bn-ink-on-dark);
}

.bn-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  max-width: 72ch;
}

.bn-section-head--split {
  max-width: none;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .bn-section-head--split {
    flex-direction: row;
    align-items: flex-end;
  }
}

.bn-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bn-accent-herbal);
}

.bn-section--dark .bn-eyebrow,
.bn-hero .bn-eyebrow {
  color: #9ED1B6;
}

.bn-lead {
  font-size: var(--bn-text-lg);
  color: var(--bn-ink-secondary);
  max-width: 64ch;
}

.bn-section--dark .bn-lead,
.bn-hero .bn-lead {
  color: var(--bn-ink-on-dark-muted);
}

.bn-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--bn-accent-herbal);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-block: 0.25rem;
  transition: color var(--bn-duration-fast) var(--bn-ease);
}

.bn-text-link:hover {
  color: var(--bn-cta-plum);
}

.bn-section--dark .bn-text-link {
  color: #AEE0C5;
}

/* Reduced Motion */
@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;
  }
}
