/**
 * EFD Deaf Foundation — Base CSS & Accessibility Layer
 * Theme: "Luminous Dignity — Pearl & Sun"
 * WCAG 2.2 Level AA / AAA Compliant
 */

/* ==========================================================================
   1. Modern Reset & Box Sizing
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-body);
  font-size: var(--fs-body);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. Bidirectional Typography & Language Rules
   ========================================================================== */
html[lang="ar"],
html[dir="rtl"] {
  font-family: var(--font-ar);
  direction: rtl;
}

html[lang="ar"] body {
  line-height: var(--lh-body-ar);
  letter-spacing: 0;
}

html[lang="en"],
html[dir="ltr"] {
  font-family: var(--font-en);
  direction: ltr;
}

html[lang="en"] body {
  line-height: var(--lh-body-en);
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 800;
  line-height: var(--lh-heading);
  color: var(--text-strong);
}

p {
  color: var(--text-body);
}

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

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

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   3. Strict Media & Logo Aspect Ratio Preservation (Zero Distortion)
   ========================================================================== */
img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Mandatory 1:1 circular medallion logo rule */
.efd-logo-medallion {
  aspect-ratio: 1 / 1;
  width: clamp(52px, 6.5vw, 76px);
  height: clamp(52px, 6.5vw, 76px);
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 4px 16px rgba(197, 155, 39, 0.28);
  transition: transform var(--transition-base);
}

.efd-logo-medallion:hover {
  transform: scale(1.04);
}

/* ==========================================================================
   4. High-Accessibility (WCAG 2.2 AA/AAA) Utilities
   ========================================================================== */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1.5rem;
  background: var(--brand-gold);
  color: var(--text-ongold);
  font-weight: 800;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  z-index: 99999;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1.5rem;
  outline: 3px solid var(--brand-sapphire);
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--brand-gold) !important;
  outline-offset: 3px !important;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   5. Layout Containers & Grid Helpers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 2.5rem);
}

.section-padding {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-block-end: clamp(2.5rem, 5vw, 4rem);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem;
  background: var(--brand-gold-tint);
  border: 1px solid var(--border-gold);
  color: var(--brand-gold-deep);
  border-radius: var(--radius-full);
  font-size: var(--fs-small);
  font-weight: 700;
  margin-block-end: 1rem;
}

html[data-theme="dark"] .section-tag {
  color: var(--brand-gold);
}

.section-title {
  font-size: var(--fs-h2);
  margin-block-end: 1rem;
  color: var(--text-strong);
}

.section-subtitle {
  font-size: var(--fs-body-lg);
  color: var(--text-muted);
}

/* ==========================================================================
   6. Universal Button System (Touch-Target >= 48px)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--fs-body);
  text-align: center;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Prestige CTA: Sun Gold */
.btn-primary {
  background: var(--grad-gold);
  color: var(--text-ongold);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(197, 155, 39, 0.38);
}

/* Secondary CTA: Regal Sapphire */
.btn-secondary {
  background: var(--grad-sapphire);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-lg);
}

/* Ruby Emergency / Donation CTA */
.btn-ruby {
  background: var(--brand-ruby);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(166, 28, 46, 0.35);
}

.btn-ruby:hover {
  background: var(--brand-ruby-bright);
  box-shadow: 0 6px 24px rgba(166, 28, 46, 0.48);
}

/* Glassmorphism / Ghost Outline CTA */
.btn-glass {
  background: var(--surface-card);
  border-color: var(--border-soft);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}

.btn-glass:hover {
  border-color: var(--brand-gold);
  color: var(--brand-sapphire);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  color: var(--text-strong);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
  transform: translateY(-2px);
}
