/* ═══════════════════════════════════════════════════════════
   El Shideed — Performance & A11y (v5)
   ═══════════════════════════════════════════════════════════ */

/* ─── Font fallback with matched metrics (fixes CLS) ─── */
@font-face {
  font-family: 'Cairo Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Roboto');
  size-adjust: 100%;
  ascent-override: 105%;
  descent-override: 30%;
  line-gap-override: 0%;
}

/* Apply fallback to prevent layout shift */
html, body {
  font-family: 'Cairo', 'Cairo Fallback', system-ui, sans-serif;
}

/* ─── Reserve space (fixes CLS on hero + stats) ─── */
.hero-viewport [class*="w-72"],
.hero-viewport [class*="rounded-3xl"] {
  aspect-ratio: 1 / 1;
  contain: layout paint;
}

/* Reserve space for stats counters */
.grid.grid-cols-2 > div,
.grid.grid-cols-4 > div {
  min-height: 90px;
}

/* Prevent CLS on counters */
.counter {
  display: inline-block;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}

/* ─── Fix marquee CLS ─── */
.animate-marquee {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ─── Reduce motion preference ─── */
@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;
  }
}

/* ─── Contrast fixes (WCAG AA) ─── */
.text-darkText { color: #C5D0E3 !important; }
.text-darkText\/60 { color: #A8B4C7 !important; }
.text-darkText\/40 { color: #95A0B3 !important; }
.text-darkText\/50 { color: #9BA8BE !important; }

/* Emergency phone number contrast */
a[href^="tel:"] {
  color: #F0F5FF !important;
}
a[href^="tel:"] span,
a[href^="tel:"] .font-mono {
  color: #FFFFFF !important;
}

/* Red banner contrast */
.bg-red-500 {
  background-color: #DC2626 !important;
}
.bg-red-500 span {
  color: #FFFFFF !important;
}

/* Tech marquee */
span[class*="text-darkText\/40"] {
  color: #A8B4C7 !important;
}

/* Footer bottom text */
footer p[class*="text-darkText\/60"] {
  color: #A8B4C7 !important;
}

/* ─── Focus indicators ─── */
:focus-visible {
  outline: 3px solid #D4AF37 !important;
  outline-offset: 3px !important;
  border-radius: 6px;
}

/* ─── Touch targets (min 44×44) ─── */
@media (hover: none) and (pointer: coarse) {
  button, a[role="button"], input[type="submit"] {
    min-height: 44px;
  }
  .copy-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* ─── Honeypot fix (don't include in a11y tree) ─── */
input[name="website"][tabindex="-1"] {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─── Skip link ─── */
.skip-link {
  position: absolute;
  top: -100px;
  right: 0;
  background: #D4AF37;
  color: #030811;
  padding: 12px 20px;
  border-radius: 0 0 12px 0;
  font-weight: 800;
  z-index: 99999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ─── Mobile menu: hide focusable children when closed ─── */
.mm-drawer[aria-hidden="true"] {
  /* Use inert attribute for modern browsers */
  pointer-events: none;
}
.mm-drawer[inert] {
  visibility: hidden;
}

/* ─── Reduce DOM size hints ─── */
section:not(:first-of-type) {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

/* ─── Better images ─── */
img {
  max-width: 100%;
  height: auto;
}

/* ─── iOS zoom prevention ─── */
@media (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ─── Select dropdown readability ─── */
select option {
  background: #081226;
  color: #F0F5FF;
  padding: 8px;
}

/* ─── Checkbox larger ─── */
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
}