/* ITA_SITE_INTEGRITY_CONTRAST_START
 *
 * Managed contrast layer for the Route-First visual system.
 * Normal text on dark surfaces is held above WCAG AA's 4.5:1 target.
 */

:root {
  --ita-dark-surface: #082b3a;
  --ita-dark-surface-2: #0d4052;
  --ita-dark-text: #e5eff1;
  --ita-dark-muted: #c6d5d9;
  --ita-dark-link: #bdf2ed;
  --ita-accessible-coral: #b84c39;
  --ita-focus: #f7c66d;
}

/* The previous coral was visually attractive but white text did not
   reach normal-text contrast. */
.rf-button-primary,
.button.button-primary,
.button-primary,
a.button-primary,
input[type="submit"].button-primary {
  color: #fff !important;
  background-color: var(--ita-accessible-coral) !important;
}

.rf-button-primary:hover,
.button.button-primary:hover,
.button-primary:hover,
a.button-primary:hover {
  background-color: #9e3f31 !important;
}

/* Explicitly scope every established dark theme surface. */
:where(
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-footer,
  .site-footer,
  .premium-footer,
  .r-footer,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .cluster-hero,
  .greek-hub-hero,
  .ocean-hub-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero
) {
  color: var(--ita-dark-text);
}

:where(
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-footer,
  .site-footer,
  .premium-footer,
  .r-footer,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .cluster-hero,
  .greek-hub-hero,
  .ocean-hub-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero
) :where(p, li, dd, figcaption, small, .editorial-byline, .breadcrumbs) {
  color: var(--ita-dark-muted) !important;
}

:where(
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-footer,
  .site-footer,
  .premium-footer,
  .r-footer,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .cluster-hero,
  .greek-hub-hero,
  .ocean-hub-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero
) :where(h1, h2, h3, h4, strong) {
  color: #fff !important;
}

:where(
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-footer,
  .site-footer,
  .premium-footer,
  .r-footer,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .cluster-hero,
  .greek-hub-hero,
  .ocean-hub-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero
) a:not(.button):not(.rf-button) {
  color: var(--ita-dark-link) !important;
  text-decoration-color: rgba(189, 242, 237, 0.65);
  text-underline-offset: 0.18em;
}

.rf-footer-bottom p,
.rf-footer-bottom a,
.rf-footer-bottom button,
.site-footer .footer-bottom p,
.site-footer .footer-bottom a,
.site-footer .footer-bottom button {
  color: #c6d5d9 !important;
}

.rf-footer .rf-brand-copy small,
.site-footer .footer-brand small {
  color: #c6d5d9 !important;
}

/* Focus must remain visible on both pale and dark surfaces. */
body :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ita-focus) !important;
  outline-offset: 3px !important;
}

/* Keep text readable when browser text or page zoom is increased. */
body {
  overflow-wrap: anywhere;
}

table {
  overflow-wrap: normal;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ITA_SITE_INTEGRITY_CONTRAST_END */
