/* ============================================================
   CodeLearn NG — main.css
   Design system tokens, reset, global typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,700;1,9..144,400;1,9..144,700&family=DM+Sans:wght@400;500;600&display=swap');

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Brand Colours */
  --deep-navy:     #0F2D5E;
  --brand-blue:    #1A5DAB;
  --sky-blue:      #2E86D4;
  --cloud-tint:    #E6F1FB;
  --harvest-gold:  #F2A61D;
  --gold-light:    #FEF7E7;
  --cream:         #FAF8F3;
  --ink:           #1C1C1C;
  --muted:         #6B7280;
  --border:        #E5E7EB;
  --white:         #ffffff;

  /* Type Scale */
  --fs-h1:   clamp(42px, 6vw, 64px);
  --fs-h2:   36px;
  --fs-h3:   20px;
  --fs-body: 16px;
  --fs-sm:   13px;
  --fs-label:11px;

  /* Spacing */
  --section-pad: clamp(64px, 8vw, 96px);
  --container:   1200px;
  --gap:         32px;

  /* Border */
  --card-border: 0.5px solid var(--border);
  --card-radius: 14px;
}

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

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--sky-blue);
}

ul {
  list-style: none;
}

button {
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── LAYOUT UTILITIES ───────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

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

.section--navy {
  background: var(--deep-navy);
}

.section--cloud {
  background: var(--cloud-tint);
}

.section--gold {
  background: var(--harvest-gold);
}

.section--cream {
  background: var(--cream);
}

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); color: var(--deep-navy); }

h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--deep-navy);
  line-height: 1.3;
}

p {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
}

.label {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

.label--gold { color: var(--harvest-gold); }
.label--muted { color: var(--muted); }

.text-muted { color: var(--muted); font-size: var(--fs-sm); }
.text-white  { color: var(--white); }
.text-navy   { color: var(--deep-navy); }
.text-gold   { color: var(--harvest-gold); }
.text-blue   { color: var(--brand-blue); }

.italic-serif {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
}

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  margin-bottom: 48px;
}

.section-header .label {
  display: block;
  margin-bottom: 10px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  color: var(--muted);
  max-width: 600px;
  font-size: var(--fs-body);
}

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

.section-header--center p {
  margin: 0 auto;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.btn--gold {
  background: var(--harvest-gold);
  color: var(--deep-navy);
  border-color: var(--harvest-gold);
}

.btn--gold:hover {
  background: #da9419;
  border-color: #da9419;
  color: var(--deep-navy);
}

.btn--outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

.btn--outline-white:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
  color: var(--white);
}

.btn--outline-navy {
  background: transparent;
  color: var(--deep-navy);
  border-color: var(--deep-navy);
}

.btn--outline-navy:hover {
  background: var(--deep-navy);
  color: var(--white);
}

.btn--navy {
  background: var(--deep-navy);
  color: var(--white);
  border-color: var(--deep-navy);
}

.btn--navy:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: var(--white);
}

.btn--blue {
  background: var(--brand-blue);
  color: var(--white);
  border-color: var(--brand-blue);
}

.btn--blue:hover {
  background: var(--sky-blue);
  border-color: var(--sky-blue);
  color: var(--white);
}

.btn--sm {
  font-size: 13px;
  padding: 10px 20px;
}

/* ── GRID UTILITIES ─────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── DIVIDER ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* ── SKIP LINK (accessibility) ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--harvest-gold);
  color: var(--deep-navy);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  z-index: 1000;
  transition: top 0.2s;
}

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

/* Screen-reader only helper */
.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 ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease both;
}

.animate-in--delay-1 { animation-delay: 0.1s; }
.animate-in--delay-2 { animation-delay: 0.2s; }
.animate-in--delay-3 { animation-delay: 0.3s; }
.animate-in--delay-4 { animation-delay: 0.4s; }

/* Intersection observer reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FORM BASE ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--deep-navy);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s ease;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(26,93,171,0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ── ALERT / MESSAGES ──────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 24px;
  border: 1px solid transparent;
}

.alert--success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.alert--error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand-blue);
}

.breadcrumb span {
  color: var(--border);
}

/* ── PAGE HERO (inner pages) ────────────────────────────── */
.page-hero {
  background: var(--deep-navy);
  padding: 80px 0 64px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.018) 0px,
    rgba(255,255,255,0.018) 1px,
    transparent 1px,
    transparent 14px
  );
  pointer-events: none;
}

.page-hero .label {
  color: var(--harvest-gold);
  margin-bottom: 12px;
  display: block;
}

.page-hero h1 {
  color: var(--white);
  font-size: clamp(36px, 5vw, 54px);
  margin-bottom: 18px;
}

.page-hero p {
  color: rgba(255,255,255,0.72);
  font-size: 18px;
  max-width: 640px;
  line-height: 1.7;
}

/* ── DONATE STRIP ───────────────────────────────────────── */
.donate-strip {
  background: var(--harvest-gold);
  padding: 64px 0;
}

.donate-strip h2 {
  color: var(--deep-navy);
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 40px);
}

.donate-strip p {
  color: rgba(15,45,94,0.78);
  max-width: 560px;
  font-size: 17px;
  margin-bottom: 32px;
}

.donate-strip--inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .donate-strip { padding: 48px 0; }
  .donate-strip h2 { font-size: 26px; }
}
