/* Atlas · small responses to an action, never a delay before an action.
   Load after the shared UI/header styles. Keep page palettes and CTA sheen.
   These hooks exclude maps, dragging surfaces and generic form controls. */
:root {
  --atlas-finish-fast:160ms;
  --atlas-finish-ease:cubic-bezier(.2,.75,.25,1);
}

/* The active page keeps its existing underline. Other links reveal theirs. */
html body [data-site-header] .aa-nav a {
  transition:color var(--atlas-finish-fast) ease;
}
html body [data-site-header] .aa-nav a:not([aria-current="page"])::after {
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:2px;
  background:currentColor;
  transform:scaleX(0);
  transform-origin:left center;
  transition:transform var(--atlas-finish-fast) var(--atlas-finish-ease);
  pointer-events:none;
}
html body [data-site-header] .aa-nav a:focus-visible::after {
  transform:scaleX(1);
}
.atlas-common-footer__nav a {
  text-decoration:underline;
  text-decoration-color:transparent;
  text-underline-offset:4px;
  text-decoration-thickness:1px;
  transition:color var(--atlas-finish-fast) ease,text-decoration-color var(--atlas-finish-fast) ease;
}
.atlas-common-footer__nav a:focus-visible {
  text-decoration-color:currentColor;
}

/* Retain the existing focus rings and native control semantics. */
html body [data-site-header] .aa-account {
  transition:translate 120ms ease,box-shadow var(--atlas-finish-fast) ease;
}
html body [data-site-header] .site-language-button {
  transition:translate 120ms ease;
}
html body [data-site-header] :is(.aa-account,.site-language-button):active:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[inert],[inert] *,[aria-busy="true"] *) {
  translate:0 1px;
}
html body [data-site-header] .site-language-arrow {
  transition:transform var(--atlas-finish-fast) var(--atlas-finish-ease);
}
html body [data-site-header] .site-language-button[aria-expanded="true"] .site-language-arrow {
  transform:translateY(1px) rotate(225deg);
}
html body [data-site-header] .site-language-option {
  transition:background-color 120ms ease,color 120ms ease;
}

/* Only the decorative arrow moves. The label and click target stay still.
   ::before belongs to the existing CTA sheen and is deliberately untouched. */
html body.departure-page #departureResult .route-offer>.departure-primary::after,
.page-help .help-write>svg {
  transform:none;
  transition:transform var(--atlas-finish-fast) var(--atlas-finish-ease);
}
html body.destination-clarity #departureResult .route-offer>.departure-primary {
  transition:background-color var(--atlas-finish-fast) ease,box-shadow var(--atlas-finish-fast) ease,translate 120ms ease!important;
}
html body.destination-clarity #departureResult .route-offer>.departure-primary:active:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[inert],[inert] *,[aria-busy="true"] *) {
  translate:0 1px;
}

/* Native details still open immediately. Animate only their revealed content,
   without height animation, clipping, focus changes or hidden default content. */
:is(.route-document-disclosure,.route-stay-details,.route-fact-detail,.route-more-documents,.route-editorial-sources,.route-fee-conditions)>summary,
.gq-disclosures details>summary {
  transition:background-color var(--atlas-finish-fast) ease,color var(--atlas-finish-fast) ease;
}
:is(.route-document-disclosure,.route-stay-details,.route-fact-detail,.route-more-documents,.route-editorial-sources,.route-fee-conditions)>summary::after,
.gq-disclosures details>summary::after {
  transition:transform var(--atlas-finish-fast) var(--atlas-finish-ease);
}

/* Existing trip placeholders follow the real loading state. The decoration
   never changes a percentage, visibility, request timing or status message. */
html body.atlas-space-page #hubTripsLoading.space-trips-loading>span {
  position:relative;
  overflow:hidden;
  background:#f1f2ef;
  animation:none;
}

@media(hover:hover) and (pointer:fine) {
  html body [data-site-header] .aa-nav a:hover:not([aria-disabled="true"],[inert],[inert] *,[aria-busy="true"] *)::after {
    transform:scaleX(1);
  }
  .atlas-common-footer__nav a:hover {
    text-decoration-color:currentColor;
  }
  html body [data-site-header] .aa-account:hover:not([aria-disabled="true"],[aria-busy="true"],[inert],[inert] *,[aria-busy="true"] *) {
    box-shadow:0 4px 14px #101b301a;
  }
  html body.departure-page #departureResult .route-offer>.departure-primary:hover:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[inert],[inert] *,[aria-busy="true"] *)::after,
  .page-help .help-write:hover:not([aria-disabled="true"],[aria-busy="true"],[inert],[inert] *,[aria-busy="true"] *)>svg {
    transform:translateX(3px);
  }
}

@media(prefers-reduced-motion:no-preference) {
  /* The browser crossfades same-origin pages when supported; no JS interception
     or artificial wait. Unsupported browsers keep ordinary navigation. */
  @view-transition { navigation:auto; }
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration:180ms;
    animation-timing-function:ease-out;
  }
  html body.destination-clarity #departurePhoto:not([hidden]) {
    animation:atlas-finish-photo 420ms ease-out;
  }
  html body.atlas-space-page #hubTripsLoading.space-trips-loading:not([hidden])>span::after {
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:48%;
    background:linear-gradient(110deg,transparent,#ffffff9c 50%,transparent);
    pointer-events:none;
    animation:atlas-finish-loading 4s linear infinite;
  }
  html body [data-site-header] .site-language-options:not([hidden]),
  .route-document-disclosure[open]>.route-document-body,
  .route-stay-details[open]>.route-overview,
  .route-fact-detail[open]>p,
  .route-more-documents[open]>.route-document-list,
  .route-editorial-sources[open]>ul,
  .route-fee-conditions[open]>.route-price-limit,
  .gq-disclosures details[open]>p {
    animation:atlas-finish-enter var(--atlas-finish-fast) var(--atlas-finish-ease);
  }
}
@keyframes atlas-finish-enter {
  from {opacity:0;transform:translateY(3px)}
  to {opacity:1;transform:translateY(0)}
}
@keyframes atlas-finish-photo {
  from {opacity:0}
}
@keyframes atlas-finish-loading {
  0% {transform:translateX(-100%);opacity:1}
  50% {transform:translateX(208.333333%);opacity:1}
  51%,100% {transform:translateX(208.333333%);opacity:0}
}

/* A suspended interaction must not suggest that it can be activated. */
html body [data-site-header] :is(.aa-account,.site-language-button):is(:disabled,[aria-disabled="true"],[aria-busy="true"],[inert]),
html body :is([inert],[aria-busy="true"]) [data-site-header] :is(.aa-account,.site-language-button),
html body [data-site-header] :is([inert],[aria-busy="true"]) :is(.aa-account,.site-language-button) {
  translate:none;
  transition:none;
}
:is([inert],[aria-busy="true"]) :is(.site-language-options,.route-document-body,.route-overview,.route-document-list,.route-price-limit),
:is([inert],[aria-busy="true"]) :is(.route-fact-detail,.gq-disclosures details)>p,
:is([inert],[aria-busy="true"]) .route-editorial-sources>ul {
  animation:none!important;
}

@media(prefers-reduced-motion:reduce) {
  @view-transition { navigation:none; }
  html body [data-site-header] .aa-nav a,
  html body [data-site-header] .aa-nav a::after,
  html body [data-site-header] :is(.aa-account,.site-language-button,.site-language-arrow,.site-language-option),
  .atlas-common-footer__nav a,
  html body.departure-page #departureResult .route-offer>.departure-primary::after,
  .page-help .help-write>svg,
  :is(.route-document-disclosure,.route-stay-details,.route-fact-detail,.route-more-documents,.route-editorial-sources,.route-fee-conditions)>summary,
  :is(.route-document-disclosure,.route-stay-details,.route-fact-detail,.route-more-documents,.route-editorial-sources,.route-fee-conditions)>summary::after,
  .gq-disclosures details>summary,
  .gq-disclosures details>summary::after {
    transition:none!important;
  }
  html body [data-site-header] :is(.aa-account,.site-language-button) {
    translate:none!important;
  }
  html body.destination-clarity #departureResult .route-offer>.departure-primary {
    translate:none!important;
    transition:none!important;
  }
  html body.departure-page #departureResult .route-offer>.departure-primary::after,
  .page-help .help-write>svg {
    transform:none!important;
  }
}
