/* ========================================
 * Global Accessibility Fixes (a11y)
 * ======================================== */

/* Fix 1: Hide the Drupal page-title block H1 globally.
 * Each page template renders its own H1, making this one duplicated.
 * Using display:none removes it from the a11y tree entirely. */
/* Fix color contrast on legacy inline-styled HTML tables from database content */
table [style*="color"],
table span[style],
table b[style],
table td[style],
table p[style] {
  color: #171717 !important;
}

#block-icac-theme-page-title {
  display: none !important;
}

/* Fix 4: Global focus-visible outline for keyboard navigation.
 * Ensures all interactive elements have a visible focus indicator
 * per WCAG 2.4.7 Focus Visible (AA). */
*:focus-visible {
  outline: 2px solid #1D4ED8;
  outline-offset: 2px;
}

/* Suppress the double outline on elements that already have custom focus styles */
.search-trigger-btn:focus-visible,
.lang-selector__trigger:focus-visible,
.footer-newsletter__input:focus-visible,
.footer-newsletter__btn:focus-visible {
  outline: 2px solid #1D4ED8;
  outline-offset: 2px;
}

/* Fix: newsletter live region styling */
#icac-newsletter-msg[role="alert"] {
  font-size: 13px;
}

/* Fix 2: Mega-menu category titles changed from h4 to span
 * to fix heading hierarchy. Display:block preserves visual behavior. */
.mega-menu__category-title {
  display: block;
}

/* Respect user preferences for reduced motion (WCAG 2.3.3) */
@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;
  }
}

/* ========================================
 * Legal / Footer Pages Styles
 * ======================================== */
.legal-page {
  width: 100%;
}

.legal-page__hero {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 48px 0 40px;
}

.legal-page__hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.legal-page__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #525252;
}

.legal-page__breadcrumb-link {
  color: #525252;
  text-decoration: none;
  transition: color 0.2s;
}

.legal-page__breadcrumb-link:hover {
  color: #0a0a0a;
  text-decoration: underline;
}

.legal-page__breadcrumb-current {
  color: #0a0a0a;
  font-weight: 500;
}

.legal-page__breadcrumb svg {
  flex-shrink: 0;
}

.legal-page__title {
  font-size: 36px;
  font-weight: 700;
  color: #0a0a0a;
  line-height: 1.2;
  margin: 0;
}

.legal-page__body {
  padding: 48px 0 80px;
}

.legal-page__body-inner {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 32px;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
}

/* Typography inside legal pages */
.legal-page__body-inner h2 {
  font-size: 22px;
  font-weight: 700;
  color: #172554;
  margin: 32px 0 16px;
  line-height: 1.3;
}

.legal-page__body-inner h3 {
  font-size: 18px;
  font-weight: 600;
  color: #0a0a0a;
  margin: 24px 0 12px;
  line-height: 1.4;
}

.legal-page__body-inner p {
  margin: 0 0 16px;
}

.legal-page__body-inner a {
  color: #1D4ED8;
  text-decoration: underline;
}

.legal-page__body-inner a:hover {
  color: #1e3a8a;
}

.legal-page__body-inner ul,
.legal-page__body-inner ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.legal-page__body-inner li {
  margin-bottom: 8px;
}

.legal-page__body-inner ul {
  list-style: disc;
}

.legal-page__body-inner ol {
  list-style: decimal;
}

.legal-page__body-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.legal-page__body-inner table th,
.legal-page__body-inner table td {
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  text-align: left;
}

.legal-page__body-inner table th {
  background: #f8fafc;
  font-weight: 600;
  color: #0a0a0a;
}

.legal-page__body-inner table td {
  color: #333;
}

/* Strip old ICAC styling from scraped content */
.legal-page__body-inner main {
  display: block;
}

.legal-page__body-inner [style*="color: #4aaeff"] {
  color: #172554 !important;
}

/* Mobile */
@media (max-width: 768px) {
  .legal-page__hero {
    padding: 32px 0 24px;
  }

  .legal-page__hero-inner {
    padding: 0 20px;
  }

  .legal-page__title {
    font-size: 28px;
  }

  .legal-page__body {
    padding: 32px 0 48px;
  }

  .legal-page__body-inner {
    padding: 0 20px;
    font-size: 15px;
  }
}
