/* ==========================================================================
   IslandTravelAtlas v36 Final Stabilization Layer
   Loaded after page-specific CSS on every public page.
   ========================================================================== */

:root {
  --ita36-page: #f7f4ec;
  --ita36-surface: #ffffff;
  --ita36-surface-soft: #eef5f0;
  --ita36-ink: #10251c;
  --ita36-text: #40584d;
  --ita36-muted: #61746b;
  --ita36-green: #1a6b4a;
  --ita36-green-dark: #104b36;
  --ita36-deep: #0d2f26;
  --ita36-border: #d8e4dc;
  --ita36-on-dark: #f7fbf9;
  --ita36-on-dark-muted: #d6e8e0;
  --ita36-focus: #f2c36b;
  --ita36-shell: min(1180px, calc(100% - 32px));
  --ita36-reading: 760px;
  --ita36-radius: 18px;
  --ita36-shadow: 0 16px 42px rgba(16, 37, 28, .09);
}

html {
  min-width: 320px;
  overflow-x: clip;
  text-size-adjust: 100%;
}

body.ita-v36 {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--ita36-page);
  color: var(--ita36-text);
  font-size: 16px;
  line-height: 1.65;
}

body.ita-v36 *,
body.ita-v36 *::before,
body.ita-v36 *::after {
  box-sizing: border-box;
}

body.ita-v36 :where(main, article, section, aside, nav, header, footer, figure, form),
body.ita-v36 :where([class*="grid"], [class*="layout"], [class*="shell"], [class*="container"]) {
  min-width: 0;
}

body.ita-v36 :where(img, picture, video, svg, iframe, embed, object) {
  max-width: 100%;
}

body.ita-v36 :where(img, picture, video) {
  display: block;
  height: auto;
}

body.ita-v36 :where(iframe, embed, object) {
  width: 100%;
  border: 0;
}

body.ita-v36 :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 0;
  color: var(--ita36-ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}

body.ita-v36 main h1 {
  font-size: clamp(2.15rem, 5vw, 4.45rem);
  line-height: 1.04;
}

body.ita-v36 main h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.75rem);
  line-height: 1.12;
}

body.ita-v36 main h3 {
  font-size: clamp(1.12rem, 2vw, 1.48rem);
  line-height: 1.22;
}

body.ita-v36 :where(p, li, dd, dt, figcaption, small) {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

body.ita-v36 main :where(p, li, dd, dt, figcaption) {
  color: var(--ita36-text);
  line-height: 1.68;
}

body.ita-v36 main :where(p, ul, ol, dl, blockquote) {
  margin-top: 0;
}

body.ita-v36 :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ita36-focus);
  outline-offset: 3px;
}

body.ita-v36 :where(.site-container, .container, .wrapper, .site-shell, .page-shell, .content-shell, .content-wrap, .page-container, .layout-shell, .rf-shell, .ita-tool-shell) {
  width: var(--ita36-shell);
  margin-inline: auto;
}

body.ita-v36 main > section {
  margin-block: 0;
}

body.ita-v36 :where([class*="grid"]) > * {
  min-width: 0;
}

body.ita-v36 :where(.card, [class$="-card"], [class*="-card "]) {
  overflow-wrap: anywhere;
}

body.ita-v36 :where(.rf-card, .ita-card, .tool-card, .provider-card, .rf-tool-card, .ita-provider-card, .ita-option-card, .rf-latest-card, .rf-route-card) {
  height: auto;
  min-height: 0;
}

body.ita-v36 :where(.rf-button, .ita-button, .hp-button, .pm-header-cta, .ita-provider-link, .ita-tool-button, .ad-button, .ita-tp-button, [class*="button"]) {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  text-decoration: none;
}

/* Dark-surface contrast: headings, body copy, links and controls remain readable. */
body.ita-v36 :is(
  .rf-hero,
  .rf-final-cta,
  .rf-library-hero,
  .rf-destination-hero,
  .hp-hero,
  .hp-final,
  .commercial-hero,
  .cluster-hero,
  .r-hero,
  .greek-hero,
  .ocean-hero,
  .caribbean-hero,
  .decision-cta,
  .r-decision-cta,
  .greek-decision-cta,
  .ocean-decision-cta,
  .caribbean-cta,
  .plan-decision,
  .ad-hero,
  .ita-wl-hero,
  .ita-tool-dark,
  .site-footer,
  .rf-footer,
  .pm-footer
) :where(h1, h2, h3, h4, h5, h6, strong, b) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.ita-v36 :is(
  .rf-hero,
  .rf-final-cta,
  .rf-library-hero,
  .rf-destination-hero,
  .hp-hero,
  .hp-final,
  .commercial-hero,
  .cluster-hero,
  .r-hero,
  .greek-hero,
  .ocean-hero,
  .caribbean-hero,
  .decision-cta,
  .r-decision-cta,
  .greek-decision-cta,
  .ocean-decision-cta,
  .caribbean-cta,
  .plan-decision,
  .ad-hero,
  .ita-wl-hero,
  .ita-tool-dark,
  .site-footer,
  .rf-footer,
  .pm-footer
) :where(p, li, dd, dt, small, figcaption, span:not([class*="button"]):not([class*="badge"])) {
  color: var(--ita36-on-dark-muted) !important;
  -webkit-text-fill-color: var(--ita36-on-dark-muted) !important;
}

body.ita-v36 :is(.site-footer, .rf-footer, .pm-footer) a,
body.ita-v36 :is(.rf-hero, .rf-final-cta, .decision-cta, .plan-decision, .ad-hero, .ita-wl-hero) a:not([class*="button"]) {
  color: #d9fff5 !important;
  -webkit-text-fill-color: #d9fff5 !important;
}

/* Header and navigation consistency. */
body.ita-v36 .pm-header {
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--ita36-border);
}

body.ita-v36 :where(.pm-brand-copy strong, .pm-nav-link, .pm-nav-trigger, .pm-mobile-direct, .pm-mobile-nav summary) {
  color: var(--ita36-ink) !important;
  -webkit-text-fill-color: var(--ita36-ink) !important;
}

body.ita-v36 .pm-brand-copy small {
  color: var(--ita36-muted) !important;
}

body.ita-v36 .pm-mega,
body.ita-v36 .pm-mobile-nav {
  color: var(--ita36-text);
  background: #ffffff;
}

/* Forms and embedded planning workspaces. */
body.ita-v36 :where(input, select, textarea) {
  max-width: 100%;
  color: var(--ita36-ink);
  background: #ffffff;
  border-color: var(--ita36-border);
}

body.ita-v36 :where(input, select, textarea)::placeholder {
  color: #718078;
  opacity: 1;
}

body.ita-v36 :where(.planning-workspace, .ita-workspace, .rf-workspace, .ad-app, .ita-widget-shell, .ita-search-panel) {
  color: var(--ita36-text);
  background: #ffffff;
}

/* Guide and hub cards with image overlays. */
body.ita-v36 :where(.rf-destination-card, .pm-destination-card, .atlas-destination-card) {
  isolation: isolate;
}

body.ita-v36 :where(.rf-destination-card, .pm-destination-card, .atlas-destination-card) :where(h2, h3, h4, strong) {
  text-wrap: balance;
}

body.ita-v36 :where(.rf-destination-card, .pm-destination-card, .atlas-destination-card) img {
  width: 100%;
  object-fit: cover;
}

/* Connectivity page: remove the former inline-style dependency and keep light surfaces readable. */
body.ita-v36.ita-connectivity-direct-v6 main > section:not(.ita-connectivity-widget-section) {
  min-height: 0 !important;
  color: #40574d !important;
}

body.ita-v36.ita-connectivity-direct-v6 main > section:not(.ita-connectivity-widget-section) :where(h1, h2, h3, h4, strong, b) {
  color: #14271f !important;
  -webkit-text-fill-color: #14271f !important;
  text-shadow: none !important;
}

body.ita-v36.ita-connectivity-direct-v6 main > section:not(.ita-connectivity-widget-section) :where(p, li, span, small, label) {
  color: #40574d !important;
  -webkit-text-fill-color: #40574d !important;
  text-shadow: none !important;
}

body.ita-v36.ita-connectivity-direct-v6 main > section:not(.ita-connectivity-widget-section) a:not([class*="button"]):not(.ita-provider-link) {
  color: #006458 !important;
  -webkit-text-fill-color: #006458 !important;
}

body.ita-v36.ita-connectivity-direct-v6 .ita-route-grid-restored-v12 :where(.rf-destination-card, .pm-destination-card, [class*="destination-card"]) :where(h2, h3, h4, strong, b, p, span, small, em) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 0 2px 9px rgba(0, 0, 0, .82) !important;
}

/* Transfers notice and commercial disclaimers. */
body.ita-v36 .ita-tp-notice {
  background: #fff8e6 !important;
  border-block: 1px solid #e4ce8c !important;
}

body.ita-v36 .ita-tp-notice :where(h2, strong) {
  color: #3d3214 !important;
}

body.ita-v36 .ita-tp-notice :where(p, li) {
  color: #5b5032 !important;
}

body.ita-v36 :where(.affiliate-disclosure, .planning-notice, .important-notice, .legal-notice, .disclaimer-box) {
  color: #4c4a3d;
  background: #fffaf0;
  border-color: #e2d4ad;
}

/* Prevent legacy patch rules from hiding content or creating empty vertical panels. */
body.ita-v36 main :where(section, article, aside, div) {
  visibility: visible;
}

body.ita-v36 main > section:empty,
body.ita-v36 [hidden] {
  display: none !important;
}

body.ita-v36 :where(.ita-widget-output, .ita-provider-widget-output, .tpwl-container):empty {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Responsive safeguards. */
@media (max-width: 900px) {
  body.ita-v36 :where(.pm-mega-grid, .rf-hero-grid, .rf-destination-hero-grid, .ita-tool-hero-grid, .ita-tp-hero-grid, .ad-hero-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.ita-v36 main h1 {
    font-size: clamp(2rem, 9vw, 3.35rem);
  }
}

@media (max-width: 640px) {
  :root { --ita36-shell: min(100% - 24px, 1180px); }

  body.ita-v36 main h2 {
    font-size: clamp(1.5rem, 8vw, 2.15rem);
  }

  body.ita-v36 :where(.decision-cta, .r-decision-cta, .greek-decision-cta, .ocean-decision-cta, .caribbean-cta, .plan-decision) {
    padding: 1.2rem;
    border-radius: 16px;
  }
}

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

/* ========================================================================== 
   V36 targeted corrections found during rendered-page QA
   ========================================================================== */

/* The v3 homepage hero is intentionally light, so it must never inherit the
   white-on-dark hero treatment used by older homepage generations. */
html body.ita-v36.ita-home-v3 .hp-hero :where(h1, h2, h3, h4, strong, b) {
  color: var(--ita36-ink) !important;
  -webkit-text-fill-color: var(--ita36-ink) !important;
  text-shadow: none !important;
}

html body.ita-v36.ita-home-v3 .hp-hero :where(p, li, span, small) {
  color: var(--ita36-text) !important;
  -webkit-text-fill-color: var(--ita36-text) !important;
  text-shadow: none !important;
}

html body.ita-v36.ita-home-v3 .hp-hero :where(.hp-kicker, .hp-eyebrow) {
  color: var(--ita36-green) !important;
  -webkit-text-fill-color: var(--ita36-green) !important;
}

/* Provider buttons are controls, not ordinary inline links. */
html body.ita-v36.ita-connectivity-direct-v6 .ita-provider-link {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Destination cards on the connectivity page use dark image overlays. The
   stronger selector prevents older light-section text rules winning. */
html body.ita-v36.ita-connectivity-direct-v6 main section.ita-route-grid-restored-v12
:where(.rf-destination-card, .pm-destination-card, [class*="destination-card"])
:where(h2, h3, h4, strong, b, p, span, small, em) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-shadow: 0 2px 9px rgba(0, 0, 0, .86) !important;
}

/* Shared live-result workspace used by activity, transfer, transport and
   related tools. This was previously hidden inside a readability patch. */
html body.ita-v36 .ita-live-results {
  padding: clamp(50px, 6vw, 78px) 0;
  background: #f4f8f6;
}

html body.ita-v36 .ita-live-results__shell {
  width: min(1160px, calc(100% - 36px));
  margin-inline: auto;
}

html body.ita-v36 .ita-live-results__intro {
  max-width: 780px;
  margin-bottom: 28px;
}

html body.ita-v36 .ita-live-results__eyebrow {
  margin: 0 0 9px;
  color: #078675 !important;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

html body.ita-v36 .ita-live-results__intro h2 {
  margin: 0;
  color: var(--ita36-ink) !important;
  font-size: clamp(1.8rem, 3.3vw, 2.55rem);
  line-height: 1.1;
  letter-spacing: -.038em;
}

html body.ita-v36 .ita-live-results__intro > p:last-child {
  margin: 13px 0 0;
  color: var(--ita36-text) !important;
  font-size: 1rem;
  line-height: 1.66;
}

html body.ita-v36 .ita-live-results__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 22px;
}

html body.ita-v36 .ita-live-widget {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ita36-border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--ita36-shadow);
}

html body.ita-v36 .ita-live-widget__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ita36-border);
  background: #ffffff;
}

html body.ita-v36 .ita-live-widget__toolbar strong {
  color: var(--ita36-ink) !important;
}

html body.ita-v36 .ita-live-widget__status {
  margin: 0;
  color: var(--ita36-muted) !important;
  font-size: .8rem;
}

html body.ita-v36 .ita-live-widget__load {
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 11px;
  background: #078675;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}

html body.ita-v36 .ita-live-widget__load:hover {
  background: #066d60;
}

html body.ita-v36 .ita-live-widget__load:disabled {
  cursor: wait;
  opacity: .72;
}

html body.ita-v36 .ita-live-widget__stage {
  position: relative;
  min-height: 430px;
  padding: 18px;
  background: #f7faf9;
}

html body.ita-v36 .ita-live-widget__placeholder {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 28px;
  border: 1px dashed #bfd3cb;
  border-radius: 15px;
  background: var(--ita36-surface-soft);
  color: var(--ita36-muted) !important;
  text-align: center;
}

html body.ita-v36 .ita-live-widget iframe {
  display: block;
  width: 100%;
  min-height: 430px;
  border: 0;
  background: #ffffff;
}

html body.ita-v36 .ita-live-review {
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(145deg, #092d25, #12483b);
  color: var(--ita36-on-dark);
}

html body.ita-v36 .ita-live-review h3 {
  margin: 0;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 1.2rem;
  line-height: 1.25;
}

html body.ita-v36 .ita-live-review > p {
  margin: 10px 0 20px;
  color: var(--ita36-on-dark-muted) !important;
  -webkit-text-fill-color: var(--ita36-on-dark-muted) !important;
  font-size: .9rem;
  line-height: 1.58;
}

html body.ita-v36 .ita-live-review__checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html body.ita-v36 .ita-live-review__checklist label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ita36-on-dark) !important;
  -webkit-text-fill-color: var(--ita36-on-dark) !important;
  font-size: .88rem;
  line-height: 1.45;
  cursor: pointer;
}

html body.ita-v36 .ita-live-review__checklist input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #55c9ae;
}

html body.ita-v36 .ita-live-review__links {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

html body.ita-v36 .ita-live-review__links a {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: .86rem;
  font-weight: 750;
}

html body.ita-v36 .ita-live-review__disclosure {
  margin: 18px 0 0 !important;
  color: var(--ita36-on-dark-muted) !important;
  -webkit-text-fill-color: var(--ita36-on-dark-muted) !important;
  font-size: .76rem !important;
  line-height: 1.5 !important;
}

@media (max-width: 900px) {
  html body.ita-v36 .ita-live-results__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  html body.ita-v36 .ita-live-review {
    order: -1;
  }
}

@media (max-width: 600px) {
  html body.ita-v36 .ita-live-results {
    padding: 42px 0;
  }

  html body.ita-v36 .ita-live-results__shell {
    width: min(100% - 24px, 1160px);
  }

  html body.ita-v36 .ita-live-widget__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  html body.ita-v36 .ita-live-widget__load {
    width: 100%;
  }

  html body.ita-v36 .ita-live-widget__stage {
    min-height: 360px;
    padding: 10px;
  }

  html body.ita-v36 .ita-live-widget iframe {
    min-height: 390px;
  }
}
