/* IslandTravelAtlas — Affiliate, Contrast and Image Integrity v2 */
:root {
  --fix-ocean-950: #052a38;
  --fix-ocean-900: #073746;
  --fix-ocean-800: #0c4a5d;
  --fix-ink: #17313a;
  --fix-muted: #50676e;
  --fix-paper: #ffffff;
  --fix-canvas: #f5f7f5;
  --fix-line: rgba(5, 42, 56, .16);
  --fix-dark-text: #f2f8f9;
  --fix-dark-muted: #d6e4e6;
  --fix-dark-link: #c6fff7;
  --fix-coral: #b84c39;
  --fix-coral-hover: #963d31;
  --fix-focus: #ffd377;
  --fix-shadow: 0 12px 34px rgba(5, 42, 56, .10);
  --fix-radius: 18px;
  --fix-shell: 1180px;
}

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body,
body.rf-theme,
body.ita-tool-page,
body.guide-page {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--fix-ink);
  background: var(--fix-canvas);
}

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

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

img,
picture,
video,
svg,
iframe,
embed,
object {
  max-width: 100%;
}

img,
picture,
video {
  display: block;
  height: auto;
}

iframe,
embed,
object {
  width: 100%;
  border: 0;
}

p,
li,
dd,
figcaption,
a,
button,
summary,
th,
td {
  overflow-wrap: break-word;
}

body :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--fix-focus) !important;
  outline-offset: 3px !important;
}

/* All known dark components plus runtime-detected dark surfaces. */
:where(
  .ita-dark-surface,
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-flight-dark-section,
  .rf-flight-hero,
  .rf-footer,
  .pm-mega-intro,
  .pm-destination-tools,
  .pm-footer,
  .ita-tool-hero,
  .ita-route-preview,
  .ita-dock-panel,
  .site-footer,
  .premium-footer,
  .r-footer,
  .atlas-footer,
  .coastal-footer,
  .cluster-hero,
  .greek-cluster-hero,
  .ocean-cluster-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero,
  .decision-hero,
  .page-hero.dark,
  .compact-hero.dark,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .section.dark,
  section.dark
) {
  color: var(--fix-dark-text) !important;
}

:where(
  .ita-dark-surface,
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-flight-dark-section,
  .rf-flight-hero,
  .rf-footer,
  .pm-mega-intro,
  .pm-destination-tools,
  .pm-footer,
  .ita-tool-hero,
  .ita-route-preview,
  .ita-dock-panel,
  .site-footer,
  .premium-footer,
  .r-footer,
  .atlas-footer,
  .coastal-footer,
  .cluster-hero,
  .greek-cluster-hero,
  .ocean-cluster-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero,
  .decision-hero,
  .page-hero.dark,
  .compact-hero.dark,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .section.dark,
  section.dark
) :where(h1, h2, h3, h4, h5, h6, strong, b) {
  color: #ffffff !important;
}

:where(
  .ita-dark-surface,
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-flight-dark-section,
  .rf-flight-hero,
  .rf-footer,
  .pm-mega-intro,
  .pm-destination-tools,
  .pm-footer,
  .ita-tool-hero,
  .ita-route-preview,
  .ita-dock-panel,
  .site-footer,
  .premium-footer,
  .r-footer,
  .atlas-footer,
  .coastal-footer,
  .cluster-hero,
  .greek-cluster-hero,
  .ocean-cluster-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero,
  .decision-hero,
  .page-hero.dark,
  .compact-hero.dark,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .section.dark,
  section.dark
) :where(p, li, dd, small, figcaption, .meta, .excerpt, .breadcrumbs, .editorial-byline) {
  color: var(--fix-dark-muted) !important;
}

:where(
  .ita-dark-surface,
  .rf-route-card,
  .rf-connection-strip,
  .rf-route-method,
  .rf-planning-section,
  .rf-final-cta,
  .rf-flight-dark-section,
  .rf-flight-hero,
  .rf-footer,
  .pm-mega-intro,
  .pm-destination-tools,
  .pm-footer,
  .ita-tool-hero,
  .ita-route-preview,
  .ita-dock-panel,
  .site-footer,
  .premium-footer,
  .r-footer,
  .atlas-footer,
  .coastal-footer,
  .cluster-hero,
  .greek-cluster-hero,
  .ocean-cluster-hero,
  .caribbean-hub-hero,
  .article-hero,
  .greek-article-hero,
  .ocean-article-hero,
  .caribbean-article-hero,
  .decision-hero,
  .page-hero.dark,
  .compact-hero.dark,
  .home-v2-route-method,
  .home-v2-final-cta,
  .home-v2-dark-section,
  .section.dark,
  section.dark
) a:not(.button):not(.rf-button):not(.pm-header-cta):not(.ita-provider-link) {
  color: var(--fix-dark-link) !important;
  text-decoration-color: rgba(198, 255, 247, .72) !important;
  text-underline-offset: .18em;
}

/* Runtime/light cards nested in dark areas must retain dark text. */
:where(
  .ita-light-surface,
  .ita-provider-card,
  .ita-tool-card,
  .ita-widget-panel,
  .ita-provider-widget-output,
  .pm-destination-card,
  .pm-tool-choice,
  .rf-library-item,
  .rf-library-group,
  .review-bar,
  .greek-review-bar,
  .ocean-review-bar,
  .caribbean-review-bar,
  .sidebar-widget,
  .toc,
  .greek-toc,
  .ocean-toc,
  .caribbean-toc,
  .source-panel,
  .caribbean-source-panel,
  .notice-panel,
  .compliance-card,
  .partner-card
) {
  color: var(--fix-ink) !important;
  background-color: var(--fix-paper);
}

:where(
  .ita-light-surface,
  .ita-provider-card,
  .ita-tool-card,
  .ita-widget-panel,
  .ita-provider-widget-output,
  .pm-destination-card,
  .pm-tool-choice,
  .rf-library-item,
  .rf-library-group,
  .review-bar,
  .greek-review-bar,
  .ocean-review-bar,
  .caribbean-review-bar,
  .sidebar-widget,
  .toc,
  .greek-toc,
  .ocean-toc,
  .caribbean-toc,
  .source-panel,
  .caribbean-source-panel,
  .notice-panel,
  .compliance-card,
  .partner-card
) :where(h1, h2, h3, h4, strong, b) {
  color: var(--fix-ink) !important;
}

:where(
  .ita-light-surface,
  .ita-provider-card,
  .ita-tool-card,
  .ita-widget-panel,
  .ita-provider-widget-output,
  .pm-destination-card,
  .pm-tool-choice,
  .rf-library-item,
  .rf-library-group,
  .review-bar,
  .greek-review-bar,
  .ocean-review-bar,
  .caribbean-review-bar,
  .sidebar-widget,
  .toc,
  .greek-toc,
  .ocean-toc,
  .caribbean-toc,
  .source-panel,
  .caribbean-source-panel,
  .notice-panel,
  .compliance-card,
  .partner-card
) :where(p, li, small, figcaption, .meta, .excerpt) {
  color: var(--fix-muted) !important;
}

:where(
  .ita-light-surface,
  .ita-provider-card,
  .ita-tool-card,
  .ita-widget-panel,
  .ita-provider-widget-output,
  .pm-destination-card,
  .pm-tool-choice,
  .rf-library-item,
  .rf-library-group,
  .review-bar,
  .greek-review-bar,
  .ocean-review-bar,
  .caribbean-review-bar,
  .sidebar-widget,
  .toc,
  .greek-toc,
  .ocean-toc,
  .caribbean-toc,
  .source-panel,
  .caribbean-source-panel,
  .notice-panel,
  .compliance-card,
  .partner-card
) a:not(.button):not(.rf-button):not(.ita-provider-link) {
  color: var(--fix-ocean-800) !important;
}

/* Provider cards and functional actions. */
.ita-provider-grid {
  align-items: stretch;
}

.ita-provider-card {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--fix-line) !important;
  border-radius: var(--fix-radius) !important;
  box-shadow: var(--fix-shadow) !important;
}

.ita-provider-card > p {
  flex: 1 1 auto;
}

.ita-provider-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: auto;
}

.ita-provider-link,
.ita-provider-widget-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: .72rem 1rem;
  border-radius: 999px;
  font-size: .84rem !important;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
}

.ita-provider-link[data-provider-state="active"] {
  color: #fff !important;
  background: var(--fix-coral) !important;
  border-color: var(--fix-coral) !important;
}

.ita-provider-link[data-provider-state="active"]:hover {
  background: var(--fix-coral-hover) !important;
}

.ita-provider-link[data-provider-state="fallback"] {
  color: var(--fix-ocean-800) !important;
  background: #edf5f4 !important;
  border-color: rgba(12, 74, 93, .22) !important;
}

.ita-provider-widget-button {
  color: var(--fix-ocean-800) !important;
  background: #fff !important;
  border: 1px solid rgba(12, 74, 93, .28) !important;
}

.ita-provider-widget-output {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
}

/* Correct oversized headings inside constrained cards and footers. */
:where(
  .ita-provider-card,
  .ita-tool-card,
  .pm-destination-card,
  .pm-tool-choice,
  .rf-library-item,
  .rf-destination-card,
  .sidebar-widget,
  .partner-card,
  .compliance-card
) :where(h2, h3, strong) {
  max-width: 100%;
  font-size: clamp(1.02rem, 1.35vw, 1.36rem) !important;
  line-height: 1.28 !important;
  letter-spacing: -.015em !important;
  text-wrap: balance;
}

.pm-footer-heading,
.rf-footer-column h2,
.site-footer h2,
.premium-footer h2,
.r-footer h2,
.atlas-footer h2,
.coastal-footer h2 {
  max-width: none !important;
  margin: 0 0 .65rem !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: .72rem !important;
  font-weight: 820 !important;
  line-height: 1.25 !important;
  letter-spacing: .11em !important;
  text-transform: uppercase !important;
  text-wrap: nowrap;
}

:where(
  .pm-footer,
  .rf-footer,
  .site-footer,
  .premium-footer,
  .r-footer,
  .atlas-footer,
  .coastal-footer
) :where(a, p, li, button) {
  color: var(--fix-dark-muted) !important;
}

/* Real destination photography and missing-image behavior. */
img.ita-real-photo,
.pm-real-image,
.cluster-hero img,
.greek-cluster-hero img,
.ocean-cluster-hero img,
.caribbean-hub-hero img,
.article-hero img,
.greek-article-hero img,
.ocean-article-hero img,
.caribbean-article-hero img {
  width: 100%;
  max-width: 100%;
  object-fit: cover;
  border-radius: clamp(14px, 2vw, 24px);
}

.cluster-hero img,
.greek-cluster-hero img,
.ocean-cluster-hero img,
.caribbean-hub-hero img {
  min-height: clamp(300px, 44vw, 560px);
}

.article-hero img,
.greek-article-hero img,
.ocean-article-hero img,
.caribbean-article-hero img {
  min-height: clamp(260px, 38vw, 500px);
}

img[data-image-failed="true"] {
  opacity: 0;
}

/* General malformed-layout containment. */
.rf-shell,
.pm-shell,
.ita-tool-shell,
.container,
.site-container,
.content-narrow {
  width: min(var(--fix-shell), calc(100% - 40px));
  max-width: var(--fix-shell);
  margin-inline: auto;
}

[class*="grid"] > *,
[class*="layout"] > * {
  min-width: 0;
}

.table-wrap,
.ita-widget-stage,
.tpwl-widget-frame,
.ita-provider-widget-output {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

main table {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.pm-mega {
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

@media (max-width: 960px) {
  .ita-provider-grid,
  .ita-tool-grid,
  .pm-destination-grid,
  .pm-tool-choice-grid,
  .rf-library-grid,
  .rf-destination-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px) {
  .rf-shell,
  .pm-shell,
  .ita-tool-shell,
  .container,
  .site-container,
  .content-narrow {
    width: min(var(--fix-shell), calc(100% - 28px));
  }

  .ita-provider-grid,
  .ita-tool-grid,
  .pm-destination-grid,
  .pm-tool-choice-grid,
  .rf-library-grid,
  .rf-destination-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ita-provider-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ita-provider-link,
  .ita-provider-widget-button {
    width: 100%;
  }

  .cluster-hero img,
  .greek-cluster-hero img,
  .ocean-cluster-hero img,
  .caribbean-hub-hero img,
  .article-hero img,
  .greek-article-hero img,
  .ocean-article-hero img,
  .caribbean-article-hero img {
    min-height: 220px;
  }
}

