.atlas[hidden] { display: none; }
.atlas {
  display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: 4px; overflow: clip;
}
.atlas-board {
  display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0;
  background: var(--paper); padding: 10px 10px 12px;
}
.atlas-legend { display: flex; justify-content: center; gap: 8px 18px; flex-wrap: wrap; padding: 0 4px 7px; font: 650 12px/1.4 var(--ui); color: var(--muted); }
.atlas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.atlas-legend span::before { content: ""; width: 14px; border-top: 2px solid var(--plum); }
.atlas-legend span + span::before { border-top-style: dashed; border-color: var(--muted); }
.atlas-map { position: relative; width: min(100%, 380px); aspect-ratio: 300 / 320; background: var(--paper); isolation: isolate; }
.atlas-river { position: absolute; inset: 0; width: 100%; height: 100%; }
.atlas-river path { vector-effect: non-scaling-stroke; }
.atlas-water { fill: var(--rose); }
.atlas-nile, .atlas-core, .atlas-extension { fill: none; stroke-linecap: round; }
.atlas-nile { stroke: #d2a7be; stroke-width: 3px; }
.atlas-core { stroke: var(--plum); stroke-width: 3px; stroke-dasharray: 240; stroke-dashoffset: 0; }
.atlas-extension { stroke: var(--muted); stroke-width: 1.35px; stroke-dasharray: 4 5; opacity: .7; }
.atlas-sea { position: absolute; color: var(--muted); font: italic 13px/1.2 var(--reading); pointer-events: none; }
.atlas-sea--north { top: 3%; left: 6%; }
.atlas-sea--east { right: 4%; bottom: 13%; }
.atlas-pin {
  position: absolute; top: var(--pin-y); left: var(--pin-x);
  transform: translate(-10px,-50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 0 5px 0 4px; min-height: 44px; min-width: 44px; border: 0; border-radius: 3px;
  color: var(--ink); background: transparent; font: 700 13px/1.15 var(--ui); white-space: nowrap;
}
.atlas-pin::before {
  content: ""; width: 10px; height: 10px; flex: 0 0 10px; border: 1px solid var(--plum); border-radius: 50%;
  background: white; transition: transform .2s, box-shadow .2s, background-color .2s;
}
.atlas-pin--extension::before { border-color: var(--muted); }
.atlas-pin span { background: var(--paper); padding: 3px 5px; border-radius: 3px; }
.atlas-pin[aria-pressed="true"] { color: var(--plum-dark); z-index: 1; }
.atlas-pin[aria-pressed="true"]::before { background: var(--plum); box-shadow: 0 0 0 4px var(--rose); transform: scale(1.14); }
.atlas-pin:hover span, .atlas-pin:focus-visible span { background: var(--rose); }
.atlas-pin:hover::before, .atlas-pin:focus-visible::before { transform: scale(1.3); }
.atlas-postcard { display: grid; grid-template-rows: minmax(0,1fr) auto; min-width: 0; background: var(--white); }
.atlas-photo { position: relative; isolation: isolate; min-height: 260px; overflow: hidden; }
.atlas-photo img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; object-position: center 56%; }
.atlas-photo[data-place="luxor"] img { object-position: center 45%; }
.atlas-postcard figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; padding: 5px 15px; }
.atlas-caption { font: 600 clamp(19px, 2vw, 27px)/1.2 var(--heading); }
.atlas-postcard a { min-height: 44px; display: inline-flex; align-items: center; color: var(--plum-dark); font: 700 13px/1.35 var(--ui); }

/* Only the published homepage's route and closing enquiry receive new section styling. */
body.est-brand-patterns .est-home-v2__route[data-est-homepage-refinement],
body.est-brand-patterns .est-home-v2__final[data-est-homepage-refinement] {
  --ink: #1c2e55;
  --plum: #a63e78;
  --plum-dark: #813060;
  --paper: #f6f2ed;
  --rose: #f3e8ee;
  --white: #fff;
  --muted: #4b5973;
  --line: #d8cdd1;
  --heading: "Playfair Display", Georgia, serif;
  --reading: Lora, Georgia, serif;
  --ui: Montserrat, Arial, sans-serif;
  color: var(--ink);
  background: var(--white) !important;
}
body.est-brand-patterns .est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__eyebrow, .est-home-v2__route-label),
body.est-brand-patterns .est-home-v2__final[data-est-homepage-refinement] .est-home-v2__eyebrow { color: var(--plum-dark) !important; }
.est-home-v2__route[data-est-homepage-refinement] :is(h2, h3, .est-home-v2__stop a, .est-home-v2__extension a),
.est-home-v2__final[data-est-homepage-refinement] h2 { color: var(--ink); }
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__section-head > p:last-child,
.est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__route-note, .est-home-v2__stop p, .est-home-v2__extension p),
.est-home-v2__final[data-est-homepage-refinement] p:last-child { color: var(--ink); }
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__section-head { margin-bottom: clamp(22px,3.8vw,54px); }
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__route-line { padding: 0; gap: 18px; }
.est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__route-line,.est-home-v2__stop)::before { display: none; }
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__stop {
  padding: 12px 0; border-top: 1px solid var(--line); text-align: start;
}
.est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__stop,.est-home-v2__extension) h3 { font-size: clamp(23px,2vw,31px); }
.est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__stop,.est-home-v2__extension) h3 a {
  min-height: 44px; display: inline-flex; align-items: center; color: var(--ink);
}
.est-home-v2__route[data-est-homepage-refinement] :is(.est-home-v2__stop,.est-home-v2__extension) h3 a:is(:hover,:focus-visible) { color: var(--plum-dark); }
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__extensions {
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 17px 0 0; margin-top: 17px;
}
.est-home-v2__route[data-est-homepage-refinement] .est-home-v2__extension { border: 0; border-radius: 0; background: transparent; padding: 0; }
.atlas-pin:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
.atlas-postcard figcaption { margin: 0; }
.atlas-postcard img { display: block; }
body.est-brand-patterns .est-home-v2__final[data-est-homepage-refinement] { padding: clamp(36px,5.2vw,76px) 0; }
.est-home-v2__final[data-est-homepage-refinement] .est-home-v2__final-grid {
  width: min(1220px, calc(100% - 2 * clamp(18px,4vw,64px))); margin-inline: auto;
  padding: clamp(22px,5vw,62px); gap: 24px;
  border-top: 3px solid var(--plum); border-bottom: 1px solid var(--line); border-radius: 0 0 4px 4px;
  background: var(--rose);
}
.est-home-v2__final[data-est-homepage-refinement] h2 { font-size: clamp(30px,3.8vw,55px); max-width: 21ch; }
.est-home-v2__final[data-est-homepage-refinement] p:last-child { max-width: 58ch; }
.est-j-hero[data-est-homepage-refinement] .est-j-note { margin-top: 12px; }

@media (max-width: 800px) {
  .est-home-v2__final[data-est-homepage-refinement] .est-home-v2__final-grid { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 680px) {
  .atlas { grid-template-columns: minmax(0,1fr); }
  .atlas-board { padding: 10px 6px 8px; }
  .atlas-map { width: min(100%,315px); aspect-ratio: 1.18; }
  .atlas-photo { min-height: 0; aspect-ratio: 16/9; }
  .atlas-postcard figcaption { padding: 7px 11px 3px; }
  .est-home-v2__route[data-est-homepage-refinement] .est-home-v2__route-line { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-pin::before { transition: none; }
}

@media (width < 768px) {
  .est-j-hero[data-est-homepage-refinement] .est-j-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 0;
  }
  body.est-brand-patterns .est-j-hero[data-est-homepage-refinement] .est-j-actions > a {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 5px;
    text-align: center;
  }
}

/* Match the paired trust actions across phone sizes and keep the eastern map pin inside its board. */
@media (width < 768px) {
  .est-j-hero[data-est-homepage-refinement] ~ section .est-home-v2__trust-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .est-j-hero[data-est-homepage-refinement] ~ section .est-home-v2__trust-actions > a {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }
}

@media (680px < width < 768px) {
  .est-j-hero[data-est-homepage-refinement] ~ section .est-home-v2__trust-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 420px;
    margin-inline: auto;
  }
}

.est-home-v2__route[data-est-homepage-refinement] .atlas-map {
  container: est-home-atlas / inline-size;
}

@container est-home-atlas (width < 305px) {
  .est-home-v2__route[data-est-homepage-refinement] .atlas-sea--east {
    display: none;
  }

  .est-home-v2__route[data-est-homepage-refinement] .atlas-pin[data-place="red-sea"] {
    gap: 4px;
    padding-right: 0;
  }

  .est-home-v2__route[data-est-homepage-refinement] .atlas-pin[data-place="red-sea"] span {
    padding-inline: 2px;
  }
}

/* Reveal the mobile trip action after the hero has scrolled out of view. */
@media (scripting: enabled) {
  body:has(#main-content > .est-j-hero[data-est-homepage-refinement]) .est-brand-mobile-actions:not([data-est-trip-bar-ready]) {
    visibility: hidden;
  }
}

/* Match direct section links to the sticky menu's active range. */
#main-content:has(> #est-brand-home-plan[data-est-homepage-refinement])
  :is(#est-j-journeys, #est-brand-home-process, #est-brand-home-why, #est-brand-home-answers, #est-brand-home-plan) {
  scroll-margin-top: calc(var(--est-brand-header) + var(--est-brand-nav) - var(--est-home-section-page-padding, 0px)) !important;
}

@media (max-width: 991px) {
  html:has(body.est-shell-contact-region) #main-content:has(> #est-brand-home-plan[data-est-homepage-refinement]) {
    /* The contact shell already adds this clearance to the root scroll container. */
    --est-home-section-page-padding: 88px;
  }
}
