/* ============================================
   AfriPure Essentials — Base & Typography
   ============================================ */

/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--nav-height);
  overflow-y: scroll; /* Force a scroll gutter if needed to prevent layout shift */
}

body {
  min-height: 100%;
  font-family: var(--font-secondary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-gray-800);
  background-color: var(--color-ivory);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-secondary);
  letter-spacing: var(--ls-tight);
}

h1 {
  font-size: var(--fs-5xl);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-4xl);
}

h3 {
  font-size: var(--fs-2xl);
}

h4 {
  font-size: var(--fs-xl);
}

h5 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

h6 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

p {
  margin-bottom: var(--space-4);
  max-width: 70ch;
}

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

.text-accent {
  font-family: var(--font-accent);
  font-style: italic;
}

.text-primary {
  color: var(--color-primary);
}

.text-gold {
  color: var(--color-accent);
}

.text-center {
  text-align: center;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-primary);
}

/* ---- Section Headings ---- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-title {
  font-size: var(--fs-4xl);
  color: var(--color-secondary);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-family: var(--font-secondary);
  font-size: var(--fs-lg);
  color: var(--color-gray-500);
  font-weight: var(--fw-regular);
  max-width: 600px;
  line-height: var(--lh-relaxed);
}

.section-header {
  margin-bottom: var(--space-16);
}

.section-header.centered {
  text-align: center;
}

.section-header.centered .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.section-header.centered .section-label {
  justify-content: center;
}

/* ---- Utility ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.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;
}

/* ---- Selection ---- */
::selection {
  background: var(--color-soft-green);
  color: var(--color-secondary-dark);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-ivory);
}

::-webkit-scrollbar-thumb {
  background: var(--color-soft-green);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ---- Responsive Typography ---- */
@media (max-width: 1024px) {
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-xl); }
  .section-title { font-size: var(--fs-3xl); }
}

@media (max-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
  .section-title { font-size: var(--fs-2xl); }
  :root {
    --section-padding: var(--space-16) 0; /* Horizontal padding moved to containers */
    --nav-height: 70px;
  }
}

/* Global mobile content alignment */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--gutter); /* Uniform 25px horizontal padding */
    max-width: 100%;
  }
  
  /* Sections that want edge-to-edge backgrounds must use negative margin or internal padding */
  .section-full-mobile {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ---- Scroll Lock Utilities ---- */
.is-locked {
  overflow: hidden !important;
  height: 100% !important;
  left:0; right:0; top:0; bottom:0; position:fixed; /* Mobile Safari fix */
}
