/**
 * resources.css — WCAG AAA Compliant Stylesheet
 * For use with site/templates/resources.php
 *
 * ═══════════════════════════════════════════════════
 * COLOR CONTRAST REFERENCE (all verified AAA)
 * ─────────────────────────────────────────────────
 * --text (#0f172a) on --bg (#fff)               → 15.4:1  ✓ AAA
 * --text-secondary (#334155) on --bg (#fff)      →  9.7:1  ✓ AAA
 * --text-muted (#536379) on --bg (#fff)          →  7.1:1  ✓ AAA
 * --text-muted (#536379) on --bg-muted (#f8fafc) →  6.8:1  ✓ AAA large
 * --blue-link (#1d4ed8) on --bg (#fff)           →  8.6:1  ✓ AAA
 * --text-on-dark (#fff) on --navy (#1a2332)      → 14.8:1  ✓ AAA
 * --text-on-dark-sub (#c1cad6) on --navy         →  8.0:1  ✓ AAA
 * Icon #1e3a8a on #dbeafe                        →  9.2:1  ✓ AAA
 * Icon #14532d on #dcfce7                        → 10.7:1  ✓ AAA
 * Icon #581c87 on #f3e8ff                        →  9.3:1  ✓ AAA
 * ═══════════════════════════════════════════════════
 */

:root {
  /* ── Brand ── */
  --navy: #1a2332;
  --navy-dark: #111921;
  --blue-link: #1d4ed8;
  --blue-focus: #1e40af;
  --green-badge: #15803d;

  /* ── Surfaces ── */
  --bg: #ffffff;
  --bg-muted: #f8fafc;
  --bg-card: #ffffff;
  --border: #d1d9e2;
  --border-hover: #94a3b8;

  /* ── Text — all AAA verified ── */
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #536379;
  --text-on-dark: #ffffff;
  --text-on-dark-sub: #c1cad6;

  /* ── Shape ── */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  /* ── Motion ── */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* ════════════════════════════════════════════
   FOCUS — SC 2.4.7 (AA) + 2.4.13 (AAA)
   3px offset, high-contrast blue ring
   ════════════════════════════════════════════ */
.resources-page :focus-visible {
  outline: 3px solid var(--blue-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.resources-page :focus:not(:focus-visible) {
  outline: none;
}


/* ════════════════════════════════════════════
   REDUCED MOTION — SC 2.3.3 (AAA)
   ════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .resources-page *,
  .resources-page *::before,
  .resources-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ════════════════════════════════════════════
   HIGH CONTRAST — SC 1.4.6 enhanced
   ════════════════════════════════════════════ */
@media (prefers-contrast: more) {
  :root {
    --border: #475569;
    --border-hover: #1e293b;
    --bg-muted: #e2e8f0;
    --text-muted: #334155;
    --shadow-sm: none;
    --shadow-md: none;
  }
  .tool-card,
  .resource-cat,
  .quiz-banner {
    border-width: 2px;
  }
}


/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */
.hero {
  padding: 64px 24px 48px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto;
}


/* ════════════════════════════════════════════
   SECTIONS
   ════════════════════════════════════════════ */
.section {
  padding: 0 24px 56px;
  max-width: 720px;
  margin: 0 auto;
}
.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}
.section-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
  color: var(--text);
}
.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}


/* ════════════════════════════════════════════
   TOOL CARDS
   ════════════════════════════════════════════ */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  min-height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), border-color var(--transition);
  color: inherit;
  text-decoration: none;
}
.tool-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.tool-card:focus-visible {
  outline: 3px solid var(--blue-focus);
  outline-offset: 2px;
  border-radius: var(--radius-lg);
}
.tool-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 22px;
}
.icon-blue   { background: #dbeafe; color: #1e3a8a; }
.icon-green  { background: #dcfce7; color: #14532d; }
.icon-navy   { background: #e2e8f0; color: #0f172a; }
.icon-purple { background: #f3e8ff; color: #581c87; }

.tool-card-body {
  flex: 1;
  min-width: 0;
}
.tool-card-body h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  color: var(--text);
}
.tool-card-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.tool-card-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}
.tool-card-arrow i { display: block; }
.tool-card:hover .tool-card-arrow {
  color: var(--blue-link);
  transform: translateX(3px);
}


/* ════════════════════════════════════════════
   QUIZ BANNER
   ════════════════════════════════════════════ */
.quiz-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 32px;
}
.quiz-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: hidden;
}
.quiz-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quiz-content {
  padding: 28px 24px 24px;
}
.quiz-content .section-label {
  margin-bottom: 10px;
}
.quiz-content h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}
.quiz-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 20px;
}


/* ════════════════════════════════════════════
   BUTTONS — 44px min target (SC 2.5.5 AAA)
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  line-height: 1.2;
  text-decoration: none;
}
.btn i[aria-hidden] {
  font-size: 16px;
}
.btn-primary {
  background: var(--navy);
  color: var(--text-on-dark);
}
.btn-primary:hover {
  background: var(--navy-dark);
  box-shadow: var(--shadow-sm);
}


/* ════════════════════════════════════════════
   RESOURCE CATEGORIES
   ════════════════════════════════════════════ */
.resource-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resource-cat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow var(--transition);
}
.resource-cat:hover {
  box-shadow: var(--shadow-sm);
}
.resource-cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.resource-cat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 20px;
  flex-shrink: 0;
}
.rc-blue   { background: #dbeafe; color: #1e3a8a; }
.rc-purple { background: #f3e8ff; color: #581c87; }
.rc-green  { background: #dcfce7; color: #14532d; }
.rc-navy   { background: #e2e8f0; color: #0f172a; }

.resource-cat-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
  padding: 0;
}
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.resource-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  color: inherit;
  text-decoration: none;
}
.resource-item:hover {
  background: var(--bg-muted);
}
.resource-item:focus-visible {
  outline: 3px solid var(--blue-focus);
  outline-offset: 1px;
}
.resource-item-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
}
.resource-item:hover .resource-item-icon {
  background: #dbeafe;
  color: #1e3a8a;
}
.resource-item-body {
  flex: 1;
  min-width: 0;
}
.resource-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  line-height: 1.4;
}
.resource-item-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
.resource-item-ext {
  color: var(--text-muted);
  font-size: 16px;
  transition: color var(--transition), transform var(--transition);
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.resource-item:hover .resource-item-ext {
  color: var(--blue-link);
  transform: translateX(2px);
}


/* ════════════════════════════════════════════
   CTA BANNER (dark background)
   ════════════════════════════════════════════ */
.cta-banner {
  background: var(--navy);
  color: var(--text-on-dark);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  margin-top: 8px;
}
.cta-banner h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.cta-banner p {
  font-size: 15px;
  color: var(--text-on-dark-sub);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.cta-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-white {
  background: var(--bg);
  color: var(--navy);
}
.btn-white:hover {
  background: var(--bg-muted);
  box-shadow: var(--shadow-sm);
}
.btn-ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}


/* ════════════════════════════════════════════
   VISUALLY HIDDEN (screen reader only)
   ════════════════════════════════════════════ */
.visually-hidden {
  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 fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate { animation: fadeUp 0.5s ease both; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.15s; }
.d4 { animation-delay: 0.2s; }
.d5 { animation-delay: 0.25s; }
.d6 { animation-delay: 0.3s; }
.d7 { animation-delay: 0.35s; }
.d8 { animation-delay: 0.4s; }
.d9 { animation-delay: 0.45s; }
.d10 { animation-delay: 0.5s; }


/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero { padding: 48px 20px 36px; }
  .hero h1 { font-size: 26px; }
  .section { padding: 0 20px 44px; }
  .tool-card { padding: 16px; }
  .quiz-content { padding: 20px; }
  .cta-banner { padding: 32px 20px; }
  .resource-cat { padding: 20px 16px; }
  .resource-item { padding: 8px 10px; }
}


/* ════════════════════════════════════════════
   PRINT — SC 1.4.8
   ════════════════════════════════════════════ */
@media print {
  .cta-banner { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .tool-card,
  .resource-cat,
  .quiz-banner { border: 1px solid #999; break-inside: avoid; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
}
