/* ============================================
   FDFB - Base CSS
   Reset, Custom Properties, Typography, Layout
   ============================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-color);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading-color);
  line-height: 1.2;
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors (constant across themes) */
  --color-primary: #2390A4;
  --color-primary-dark: #1B7488;
  --color-primary-light: #2BA3B9;
  --color-yellow: #F8AF19;
  --color-green: #4CB749;
  --color-blue: #4498E7;
  --color-red: #E22827;
  --color-white: #FFFFFF;
  --color-dark: #232323;
  --color-medium: #454545;
  --color-body: #7A7A7A;
  --color-muted: #696E71;
  --color-light-gray: #E8EAEC;
  --color-border: #E0E0E0;

  /* Theme-overridable */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-accent: 'Poppins', sans-serif;

  --heading-color: var(--color-dark);
  --body-color: var(--color-body);

  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-sm: 4px;
  --btn-radius: 6px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);

  --section-padding: 80px 0;
  --section-padding-sm: 48px 0;
  --section-alt-bg: #F7F9FA;
  --hero-bg: var(--color-white);

  --container-width: 1200px;
  --container-padding: 24px;

  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
}

/* --- Typography Scale --- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }

h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 2rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
h4 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
h5 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

p + p { margin-top: 1rem; }

.section-label {
  font-family: var(--font-accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-medium);
  max-width: 640px;
}

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

.section {
  padding: var(--section-padding);
}

.section--alt {
  background-color: var(--section-alt-bg);
}

.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__header .section-subtitle {
  margin: 0 auto;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Flex Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 12px; }
.gap-md { gap: 24px; }
.gap-lg { gap: 48px; }

/* --- Text Alignment --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* --- Spacing --- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

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

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --section-padding: 64px 0;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  .section-title { font-size: 1.75rem; }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 48px 0;
    --container-padding: 20px;
  }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .section-title { font-size: 1.5rem; }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 40px 0;
    --container-padding: 16px;
  }
  h1 { font-size: 1.5rem; }
}
