/* ============================================
   BLACK HISTORY GUIDES | Global Stylesheet
   ============================================ */

/* --- CSS Custom Properties (Brand Colors) --- */
:root {
  /* Primary */
  --gold:          #F5A623;   /* buttons, headings, highlights, logo accent */
  --teal:          #0D6E6E;   /* navigation, hero backgrounds, section headers */
  --cream:         #FDF6EC;   /* all page backgrounds */

  /* Secondary */
  --terracotta:    #C1622F;   /* era tags, section dividers, secondary CTAs */
  --forest:        #1B4332;   /* subject tags, tertiary accents */
  --charcoal:      #2C2C2C;   /* primary body text, footer background */

  /* Supporting */
  --gold-light:    #FDE68A;   /* hover states, card highlights */
  --teal-light:    #E0F4F4;   /* info boxes, alternate section backgrounds */
  --gray:          #6B7280;   /* captions, secondary text */
  --white:         #FFFFFF;   /* text on dark backgrounds */
  --green:         #16A34A;   /* checkmarks, success states, completion */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* --- Skip to Main Content (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--gold);
  color: var(--charcoal);
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* --- Typography Scale --- */
h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  color: var(--charcoal);
}

h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: var(--teal);
}

h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.3;
  color: var(--charcoal);
}

h4 {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.4;
  color: var(--charcoal);
}

p {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
}

/* --- Utility Classes --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--teal);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-desc {
  font-size: 17px;
  color: var(--gray);
  max-width: 640px;
  margin-bottom: 48px;
}

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

.text-gold { color: var(--gold); }
.text-teal { color: var(--teal); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray); }

.bg-cream { background-color: var(--cream); }
.bg-teal { background-color: var(--teal); }
.bg-teal-light { background-color: var(--teal-light); }
.bg-charcoal { background-color: var(--charcoal); }

/* --- Screen Reader Only --- */
.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;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.4;
}

/* --- Responsive Images --- */
.lazy-img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

/* --- Selection Color --- */
::selection {
  background: var(--gold-light);
  color: var(--charcoal);
}

/* --- Focus Styles (Accessibility) --- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* --- Responsive Breakpoints Reference ---
   Mobile: < 768px
   Tablet: 768px – 1199px
   Desktop: >= 1200px
   ---------------------------------------- */

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  p {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 48px 0;
  }

  .section-desc {
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .section {
    padding: 40px 0;
  }
}
