/* ==========================================================================
   SaluteQuotidiana Base & Reset Styles
   Mobile-First Zero-Overflow Architecture
   ========================================================================== */

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--sq-bg-canvas);
  color: var(--sq-ink-primary);
  font-family: var(--sq-font-body);
  font-size: var(--sq-text-base);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: clip;
  max-width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body.sq-body--locked {
  overflow: hidden;
  touch-action: none;
}

main {
  flex: 1 0 auto;
  min-width: 0;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* Guard every Flex and Grid child from text/media overflow */
.sq-grid > *,
.sq-flex > *,
.sq-row > * {
  min-width: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
.sq-heading {
  font-family: var(--sq-font-display);
  color: var(--sq-ink-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 0.5em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

h1 {
  font-size: var(--sq-text-hero);
}

h2 {
  font-size: var(--sq-text-2xl);
}

h3 {
  font-size: var(--sq-text-xl);
}

h4 {
  font-size: var(--sq-text-lg);
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--sq-ink-secondary);
}

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

a {
  color: var(--sq-brand-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--sq-brand-primary-hover);
}

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

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

button {
  cursor: pointer;
}

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

.sq-skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  background-color: var(--sq-bg-dark);
  color: var(--sq-ink-inverse);
  padding: 12px 18px;
  border-radius: var(--sq-radius-sm);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--sq-cta-primary);
  transition: top var(--sq-duration) var(--sq-ease);
}

.sq-skip-link:focus {
  top: 12px;
  color: var(--sq-ink-inverse);
}

:focus-visible {
  outline: 2.5px solid var(--sq-brand-primary);
  outline-offset: 2px;
}

.sq-tabular {
  font-variant-numeric: tabular-nums;
}

.sq-hidden {
  display: none !important;
}

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

.sq-container--narrow {
  max-width: var(--sq-container-narrow);
}

.sq-section {
  padding-block: var(--sq-section-space);
}

.sq-section--surface {
  background-color: var(--sq-bg-surface);
  border-top: 1px solid var(--sq-border-subtle);
  border-bottom: 1px solid var(--sq-border-subtle);
}

.sq-section--subtle {
  background-color: var(--sq-bg-subtle);
  border-top: 1px solid var(--sq-border-subtle);
  border-bottom: 1px solid var(--sq-border-subtle);
}

.sq-section--dark {
  background-color: var(--sq-bg-dark);
  color: var(--sq-ink-inverse);
}

.sq-section--dark h2,
.sq-section--dark h3,
.sq-section--dark p {
  color: var(--sq-ink-inverse);
}

.sq-section__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(24px, 4vw, 40px);
}

@media (min-width: 768px) {
  .sq-section__head--split {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
  }
}

.sq-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sq-font-body);
  font-size: var(--sq-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sq-brand-teal);
  background-color: var(--sq-brand-teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.25);
  padding: 5px 12px;
  border-radius: var(--sq-radius-pill);
  width: fit-content;
  max-width: 100%;
}

.sq-eyebrow--cobalt {
  color: var(--sq-brand-primary);
  background-color: var(--sq-brand-primary-soft);
  border-color: rgba(30, 64, 175, 0.22);
}

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

/* Responsive Product & Content Grids */
.sq-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.sq-product-grid > * {
  min-width: 0;
}

@media (min-width: 640px) {
  .sq-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .sq-product-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1140px) {
  .sq-product-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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