/*
 * IslandTravelAtlas targeted visual foundation V2
 *
 * Repairs confirmed rendered contrast, inherited foreground colors,
 * homepage journey overlap, article modules and continuation surfaces.
 */

/* ---------------------------------------------------------
   1. Explicit global interactive contrast
   --------------------------------------------------------- */

html body .pm-header-cta,
html body a.pm-header-cta {
  color: #ffffff !important;
  background: #a94332 !important;
  border-color: #a94332 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html body .pm-header-cta:hover,
html body .pm-header-cta:focus-visible {
  color: #ffffff !important;
  background: #873326 !important;
  border-color: #873326 !important;
}

html body .button-primary,
html body a.button-primary,
html body button.button-primary {
  color: #ffffff !important;
  text-shadow: none !important;
}

html body .button-secondary,
html body a.button-secondary {
  color: #0b5260 !important;
  background: #ffffff !important;
  border-color: rgba(11, 82, 96, 0.28) !important;
}

/* ---------------------------------------------------------
   2. Tables: prevent pale inherited text on pale headers
   --------------------------------------------------------- */

html body table thead th,
html body .table-wrap table thead th,
html body .comparison-table thead th {
  color: #123c45 !important;
  background: #e2eee8 !important;
  border-color: rgba(18, 60, 69, 0.18) !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html body table tbody td {
  color: #334d53;
}

html body .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------------------------------------------------------
   3. Review and verification panels
   --------------------------------------------------------- */

html body .review-bar,
html body .caribbean-review-bar {
  color: #29474e !important;
  background: #f6fbf8 !important;
}

html body .review-bar strong,
html body .caribbean-review-bar strong {
  color: #163c45 !important;
}

html body .review-bar a,
html body .caribbean-review-bar a {
  color: #075c67 !important;
  font-weight: 750 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 0.18em !important;
}

html body .review-bar a:hover,
html body .caribbean-review-bar a:hover {
  color: #073f49 !important;
}

/* ---------------------------------------------------------
   4. Homepage journey section: remove rendered overlap
   --------------------------------------------------------- */

html body.ita-page--home .ita-ref-scene-grid {
  align-items: center !important;
}

html body.ita-page--home .ita-ref-scene-actions {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: center !important;
  gap: 1rem !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  transform: none !important;
}

html body.ita-page--home .ita-ref-independent,
html body.ita-page--home .ita-ref-build {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 74px !important;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
}

html body.ita-page--home .ita-ref-independent {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 0.9rem !important;
  padding: 1rem 1.1rem !important;
}

html body.ita-page--home .ita-ref-independent strong,
html body.ita-page--home .ita-ref-independent a,
html body.ita-page--home .ita-ref-build,
html body.ita-page--home .ita-ref-build span,
html body.ita-page--home .ita-ref-build strong {
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html body.ita-page--home .ita-ref-build {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1rem 1.15rem !important;
}

/* ---------------------------------------------------------
   5. Caribbean article readability and useful sidebar
   --------------------------------------------------------- */

html body.ita-page--guides-caribbean-best-areas-to-stay
.caribbean-article-layout {
  grid-template-columns: minmax(0, 860px) minmax(260px, 1fr) !important;
  gap: clamp(2rem, 4vw, 4rem) !important;
  align-items: start !important;
}

html body.ita-page--guides-caribbean-best-areas-to-stay
.caribbean-article-content {
  width: 100% !important;
  max-width: 860px !important;
  min-width: 0 !important;
}

html body .caribbean-sticky {
  color: #29474e !important;
  background: #f7f3e9 !important;
  border: 1px solid rgba(154, 105, 20, 0.24) !important;
  border-radius: 18px !important;
  padding: 1.25rem !important;
  box-shadow: 0 16px 35px rgba(16, 58, 67, 0.08) !important;
}

html body .caribbean-sticky > span {
  display: block !important;
  margin-bottom: 0.7rem !important;
  color: #0d5863 !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

html body .caribbean-sticky li {
  color: #38545a !important;
}

/* ---------------------------------------------------------
   6. Continue-planning module
   --------------------------------------------------------- */

html body .caribbean-related {
  display: block !important;
  margin-top: clamp(3rem, 6vw, 5rem) !important;
  padding: clamp(1.35rem, 3vw, 2rem) !important;
  color: #173f48 !important;
  background:
    linear-gradient(135deg, #f1f8f4 0%, #fffaf0 100%) !important;
  border: 1px solid rgba(16, 91, 101, 0.18) !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 42px rgba(16, 58, 67, 0.08) !important;
}

html body .caribbean-related > span {
  display: block !important;
  margin-bottom: 0.45rem !important;
  color: #0a6870 !important;
  font-size: 0.78rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase !important;
}

html body .caribbean-related h2 {
  margin: 0 0 1.25rem !important;
  color: #103a43 !important;
}

html body .caribbean-related > div {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.8rem !important;
  margin-bottom: 1.25rem !important;
}

html body .caribbean-related > div > a {
  display: flex !important;
  align-items: center !important;
  min-height: 68px !important;
  padding: 0.9rem 1rem !important;
  color: #0b5661 !important;
  background: #ffffff !important;
  border: 1px solid rgba(11, 86, 97, 0.16) !important;
  border-radius: 13px !important;
  font-weight: 720 !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
}

html body .caribbean-related > div > a:hover,
html body .caribbean-related > div > a:focus-visible {
  color: #ffffff !important;
  background: #0b626b !important;
  border-color: #0b626b !important;
}

/* ---------------------------------------------------------
   7. Dark editorial cards
   --------------------------------------------------------- */

html body .caribbean-decision-card,
html body .caribbean-route-card,
html body .ita-dark-surface .ita-card-dark {
  color: #f4faf8 !important;
}

html body .caribbean-decision-card h2,
html body .caribbean-decision-card h3,
html body .caribbean-decision-card p,
html body .caribbean-route-card h2,
html body .caribbean-route-card h3,
html body .caribbean-route-card p {
  color: inherit !important;
}

/* ---------------------------------------------------------
   8. Focus visibility
   --------------------------------------------------------- */

html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible {
  outline: 3px solid #f3b63f !important;
  outline-offset: 3px !important;
}

/* ---------------------------------------------------------
   9. Responsive repair
   --------------------------------------------------------- */

@media (max-width: 980px) {
  html body.ita-page--guides-caribbean-best-areas-to-stay
  .caribbean-article-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body.ita-page--guides-caribbean-best-areas-to-stay
  .caribbean-article-content {
    max-width: none !important;
  }

  html body .caribbean-sticky {
    position: static !important;
    width: auto !important;
  }
}

@media (max-width: 700px) {
  html body .caribbean-related > div {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body.ita-page--home .ita-ref-scene-actions {
    gap: 0.75rem !important;
  }

  html body.ita-page--home .ita-ref-independent {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/*
 * IslandTravelAtlas rendered correction V3B
 */

/* Legacy theme rules separately inherit text-fill colors. */

html body .pm-header-cta,
html body a.pm-header-cta {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

html body .review-bar a,
html body .caribbean-review-bar a {
  color: #075c67 !important;
  -webkit-text-fill-color: #075c67 !important;
}

html body table thead th,
html body .table-wrap table thead th,
html body .comparison-table thead th {
  color: #123c45 !important;
  -webkit-text-fill-color: #123c45 !important;
}

html body .button-primary,
html body a.button-primary,
html body button.button-primary {
  -webkit-text-fill-color: #ffffff !important;
}

html body .caribbean-related > div > a {
  color: #0b5661 !important;
  -webkit-text-fill-color: #0b5661 !important;
}

html body .caribbean-related > div > a:hover,
html body .caribbean-related > div > a:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Hide duplicated fixed planner where an equivalent action exists. */

html body.ita-page--home .ita-planning-dock,
html body.ita-page--guides-caribbean-best-areas-to-stay
.ita-planning-dock,
html body.ita-page--flights .ita-planning-dock {
  display: none !important;
}

/* Flights has a light hero and therefore requires dark editorial text. */

html body.ita-page--flights .rf-flight-hero {
  color: #123c45 !important;
}

html body.ita-page--flights .rf-flight-hero h1 {
  color: #123c45 !important;
  -webkit-text-fill-color: #123c45 !important;
  text-shadow: none !important;
}

html body.ita-page--flights .rf-flight-hero
:is(.rf-flight-lede, .rf-kicker) {
  color: #38575e !important;
  -webkit-text-fill-color: #38575e !important;
  opacity: 1 !important;
}

html body.ita-page--flights .rf-flight-hero .rf-kicker {
  color: #0b6670 !important;
  -webkit-text-fill-color: #0b6670 !important;
}

html body.ita-page--flights .rf-flight-hero
.breadcrumbs,
html body.ita-page--flights .rf-flight-hero
.breadcrumbs a,
html body.ita-page--flights .rf-flight-hero
.breadcrumbs span {
  color: #235c65 !important;
  -webkit-text-fill-color: #235c65 !important;
}

html body.ita-page--flights .rf-flight-hero
.rf-button-primary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #a94332 !important;
  border-color: #a94332 !important;
}

html body.ita-page--flights .rf-flight-hero
.rf-button-primary:hover,
html body.ita-page--flights .rf-flight-hero
.rf-button-primary:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #873326 !important;
  border-color: #873326 !important;
}

html body.ita-page--flights .rf-flight-hero
.rf-button-secondary {
  color: #075c67 !important;
  -webkit-text-fill-color: #075c67 !important;
}

@media (max-width: 760px) {
  html body.ita-page--flights .rf-flight-hero h1 {
    overflow-wrap: anywhere;
  }
}
