/* header.css: moved out of src/components/Header.astro on 2026-10-27, so a style fix is a single file upload. */

/* --fg is the text color, --bgc the background, --edge the hairline under the bar and
   --inv the text color of a button filled with --fg. They change when the header floats over a photo. */
.hd {
  --fg: #fff;
  --bgc: var(--night);
  --edge: rgb(255 255 255 / 0.1);
  --inv: var(--night);
  position: sticky;
  top: 0;
  z-index: 60;
  color: var(--fg);
  background: var(--bgc);
  box-shadow: inset 0 -1px 0 var(--edge);
  transition: background 0.4s, box-shadow 0.4s;
}

.hd[data-over] {
  --bgc: transparent;
  --edge: rgb(255 255 255 / 0.18);
  position: fixed;
  left: 0;
  right: 0;
}

html.scrolled .hd[data-over],
html.menu-open .hd[data-over],
.hd[data-over]:has(.has:hover, .has:focus-within) {
  --bgc: var(--night);
  --edge: rgb(255 255 255 / 0.1);
}

html.menu-open .hd {
  --bgc: var(--night-deep);
}

:is(.hd, .ov) .bar {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100% - 2 * var(--gutter), 1320px);
  height: var(--header);
  margin-inline: auto;
}

:is(.hd, .ov) .brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

:is(.hd, .ov) .brand img {
  width: 48px;
  height: 48px;
}

/* "Inca" above "Outdoors". */
:is(.hd, .ov) .word {
  display: grid;
  font: 500 1.4rem/0.98 var(--display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Destinations in a row */
:is(.hd, .ov) .nav {
  margin-inline: auto;
}

:is(.hd, .ov) .nav > ul {
  display: flex;
  align-items: center;
}

:is(.hd, .ov) .has {
  display: flex;
  align-items: center;
  height: var(--header);
}

:is(.hd, .ov) .link {
  position: relative;
  padding: 10px clamp(9px, 1vw, 18px);
  font: 700 0.76rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

:is(.hd, .ov) .link::after {
  content: '';
  position: absolute;
  left: clamp(9px, 1vw, 18px);
  right: clamp(9px, 1vw, 18px);
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s;
}

:is(.hd, .ov) .has:hover .link::after,
:is(.hd, .ov) .has:focus-within .link::after {
  transform: none;
}

:is(.hd, .ov) .link[aria-current]::after {
  background: var(--accent);
  transform: none;
}

/* Dark panel of trip photos. Closed panels skip rendering, so their photos load only when opened. */
:is(.hd, .ov) .drop {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: 36px 0 40px;
  background: var(--night-deep);
  color: #fff;
  box-shadow: 0 30px 50px -30px rgb(0 0 0 / 0.55);
  opacity: 0;
  visibility: hidden;
  content-visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, content-visibility 0.25s allow-discrete;
}

:is(.hd, .ov) .has:hover > .drop,
:is(.hd, .ov) .has:focus-within > .drop {
  opacity: 1;
  visibility: visible;
  content-visibility: visible;
  transform: none;
}

:is(.hd, .ov) .drop-in {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  width: min(100% - 2 * var(--gutter), 1320px);
  margin-inline: auto;
}

:is(.hd, .ov) .intro .name {
  margin: 0 0 12px;
  font: 400 2rem/1.05 var(--display);
}

:is(.hd, .ov) .intro .card {
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgb(255 255 255 / 0.7);
}

:is(.hd, .ov) .count {
  font: 700 0.74rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}

:is(.hd, .ov) .count::after {
  content: ' \2192';
}

:is(.hd, .ov) .drop ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}

:is(.hd, .ov) .drop li a {
  display: grid;
  gap: 12px;
  text-decoration: none;
}

:is(.hd, .ov) .thumb {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: rgb(255 255 255 / 0.06);
}

:is(.hd, .ov) .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s;
}

:is(.hd, .ov) .drop li a:hover .thumb img {
  transform: scale(1.05);
}

:is(.hd, .ov) .txt,
:is(.hd, .ov) .ov-txt {
  display: grid;
  gap: 6px;
}

:is(.hd, .ov) .txt > span {
  font: 600 1rem/1.3 var(--body);
}

:is(.hd, .ov) .txt small,
:is(.hd, .ov) .ov-txt small {
  font: 700 0.68rem/1 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.55);
}

/* Language and call to action */
:is(.hd, .ov) .end {
  display: flex;
  align-items: center;
  gap: 22px;
}

:is(.hd, .ov) .lang {
  position: relative;
  display: flex;
  align-self: stretch;
}

:is(.hd, .ov) .lang button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 700 0.76rem/1 var(--body);
  letter-spacing: 0.12em;
  cursor: pointer;
}

:is(.hd, .ov) .lang ul {
  position: absolute;
  right: -14px;
  top: calc(100% + 8px);
  display: grid;
  min-width: 180px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 40px -18px rgb(0 0 0 / 0.35);
  opacity: 0;
  visibility: hidden;
  content-visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, content-visibility 0.2s allow-discrete;
}

:is(.hd, .ov) .lang:hover ul,
:is(.hd, .ov) .lang:focus-within ul {
  opacity: 1;
  visibility: visible;
  content-visibility: visible;
}

:is(.hd, .ov) .lang li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.94rem;
  text-decoration: none;
}

:is(.hd, .ov) .lang li a:hover,
:is(.hd, .ov) .lang li a[aria-current] {
  background: #f1f3f4;
}

:is(.hd, .ov) .ping {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--night);
  isolation: isolate;
  transition: background 0.25s;
}

:is(.hd, .ov) .ping.mail {
  --ring: #fff;
  background: #fff;
}

:is(.hd, .ov) .ping:hover {
  background: #fff;
}

:is(.hd, .ov) .ping.mail:hover {
  background: var(--accent);
}

:is(.hd, .ov) .ping::before,
:is(.hd, .ov) .ping::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1.5px solid var(--ring, var(--accent));
  border-radius: 50%;
  opacity: 0;
  animation: ping-ring 2.8s ease-out infinite;
}

/* The Andean Moments ripple: two thin rings, the second half a cycle behind, growing slowly
   and fading out. Both discs move in step. */
:is(.hd, .ov) .ping::after {
  animation-delay: 1.4s;
}

@keyframes ping-ring {
  from {
    transform: scale(1);
    opacity: 0.55;
  }
  to {
    transform: scale(var(--spread, 1.7));
    opacity: 0;
  }
}

:is(.hd, .ov) .plan {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--night);
  font: 700 0.74rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s, border-color 0.25s;
}

:is(.hd, .ov) .plan:hover {
  border-color: #fff;
  background: #fff;
}

/* Menu pill, phones and tablets only: three bars and the word "Menu". When the menu opens the bars
   turn into an X and the word slides to "Close". It fills with the header ink under a real pointer. */
:is(.hd, .ov) .menu-btn {
  display: none;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 18px 0 16px;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.07);
  backdrop-filter: blur(10px);
  color: inherit;
  font: 700 0.72rem/1 var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

/* Only with a real pointer: on touch screens :hover sticks after the tap. */
@media (hover: hover) {
  :is(.hd, .ov) .menu-btn:hover {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--inv);
  }
}

/* Hamburger after adamgiebl's toggle on Uiverse: the two <i> are the outer bars (80 % wide),
   ::before is the middle bar. Open: the middle bar shrinks away, the outer ones cross into an X
   and the whole icon turns half a circle. */
:is(.hd, .ov) .lines {
  position: relative;
  flex: none;
  width: 22px;
  height: 14px;
  transition: transform 0.5s;
}

:is(.hd, .ov) .lines i,
:is(.hd, .ov) .lines::before {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.5s, width 0.5s, left 0.5s;
}

:is(.hd, .ov) .lines i:first-child {
  top: 0;
}

:is(.hd, .ov) .lines i:last-child {
  bottom: 0;
}

:is(.hd, .ov) .lines::before {
  content: '';
  top: 6px;
  left: 0;
  width: 100%;
  transition-duration: 0.8s;
}

html.menu-open :is(.hd, .ov) .lines {
  transform: rotate(180deg);
}

html.menu-open :is(.hd, .ov) .lines::before {
  transform: scaleX(0);
  transition-duration: 0.5s;
}

html.menu-open :is(.hd, .ov) .lines i {
  left: 0;
  width: 100%;
}

html.menu-open :is(.hd, .ov) .lines i:first-child {
  transform: translateY(6px) rotate(45deg);
}

html.menu-open :is(.hd, .ov) .lines i:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

:is(.hd, .ov) .label {
  display: grid;
  overflow: hidden;
}

:is(.hd, .ov) .label > span {
  grid-area: 1 / 1;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s;
}

:is(.hd, .ov) .l-close,
html.menu-open :is(.hd, .ov) .l-open {
  opacity: 0;
  transform: translateY(110%);
}

html.menu-open :is(.hd, .ov) .l-open {
  transform: translateY(-110%);
}

html.menu-open :is(.hd, .ov) .l-close {
  opacity: 1;
  transform: none;
}

/* Full screen phone menu */
.ov {
  display: none;
}

/* The language list and the call to action leave first, then the destinations make way for the menu pill. */
@media (max-width: 1380px) {
  :is(.hd, .ov) .lang {
    display: none;
  }
}

@media (max-width: 1300px) {
  :is(.hd, .ov) .plan {
    display: none;
  }
}

@media (max-width: 1080px) {
  :is(.hd, .ov) .nav {
    display: none;
  }
  :is(.hd, .ov) .bar {
    gap: 12px;
  }
  :is(.hd, .ov) .end {
    gap: 14px;
    margin-left: auto;
  }
  :is(.hd, .ov) .menu-btn {
    display: inline-flex;
  }
  .ov {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    padding-top: var(--header);
    background: var(--night-deep);
    color: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    content-visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s, content-visibility 0.4s allow-discrete;
  }
  html.menu-open .ov {
    opacity: 1;
    visibility: visible;
    content-visibility: visible;
  }
  html.menu-open {
    overflow: hidden;
  }
  :is(.hd, .ov) .ov-in {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: min(100% - 2 * var(--gutter), 720px);
    min-height: calc(100dvh - var(--header));
    margin-inline: auto;
    padding-block: clamp(28px, 5vh, 56px) 40px;
  }
  :is(.hd, .ov) .ov-list > li {
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
  }
  /* The whole row is the button that unfolds the trips. */
  :is(.hd, .ov) .ov-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 17px 0;
    border: 0;
    background: none;
    color: inherit;
    font: 400 1.3rem/1.2 var(--display);
    letter-spacing: -0.01em;
    text-align: left;
    cursor: pointer;
  }
  :is(.hd, .ov) .ov-name::after {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    margin: -4px 4px 0 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s, margin 0.3s;
  }
  :is(.hd, .ov) .ov-name[aria-expanded='true']::after {
    margin-top: 4px;
    transform: rotate(-135deg);
  }
  :is(.hd, .ov) .ov-trips {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.35s, visibility 0.35s;
  }
  :is(.hd, .ov) .ov-name[aria-expanded='true'] + .ov-trips {
    grid-template-rows: 1fr;
    visibility: visible;
  }
  :is(.hd, .ov) .ov-trips ul {
    min-height: 0;
    overflow: hidden;
  }
  :is(.hd, .ov) .ov-trips li a {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    text-decoration: none;
  }
  /* Last link of each list: the destination page. */
  :is(.hd, .ov) .ov-trips .ov-all a {
    display: inline-flex;
    gap: 8px;
    padding: 12px 0 18px;
    font: 700 0.74rem/1.3 var(--body);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
  }
  :is(.hd, .ov) .ov-trips .ov-all a::after {
    content: '\2192';
  }
  :is(.hd, .ov) .ov-thumb {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: rgb(255 255 255 / 0.06);
  }
  :is(.hd, .ov) .ov-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  :is(.hd, .ov) .ov-txt > span {
    font: 600 0.98rem/1.3 var(--body);
  }
  :is(.hd, .ov) .ov-foot {
    display: grid;
    gap: 18px;
    margin-top: auto;
    font-size: 0.92rem;
  }
  :is(.hd, .ov) .ov-company,
  :is(.hd, .ov) .ov-reach {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
  }
  /* Languages: two even columns, flag and name. */
  :is(.hd, .ov) .ov-langs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 16px;
    padding-top: 18px;
    border-top: 1px solid rgb(255 255 255 / 0.12);
  }
  :is(.hd, .ov) .ov-langs a {
    gap: 10px;
    padding: 7px 0;
  }
  :is(.hd, .ov) .ov-langs svg {
    flex: none;
    border-radius: 2px;
  }
  :is(.hd, .ov) .ov-foot a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: rgb(255 255 255 / 0.78);
  }
  :is(.hd, .ov) .ov-foot a:hover,
  :is(.hd, .ov) .ov-langs a[aria-current] {
    color: #fff;
  }
  :is(.hd, .ov) .ov-company a {
    font: 700 0.76rem/1 var(--body);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
  }
  :is(.hd, .ov) .ov-langs a[aria-current] {
    font-weight: 700;
  }
  :is(.hd, .ov) .ov-foot .ov-plan {
    justify-content: center;
    min-height: 52px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--night);
    font: 700 0.8rem/1 var(--body);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

/* The destinations rise in one after another when the menu opens. */
@media (max-width: 1080px) and (prefers-reduced-motion: no-preference) {
  :is(.hd, .ov) .ov-list > li,
  :is(.hd, .ov) .ov-foot {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
  }
  html.menu-open :is(.hd, .ov) .ov-list > li,
  html.menu-open :is(.hd, .ov) .ov-foot {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(100ms + var(--i, 5) * 55ms);
  }
}

@media (max-width: 640px) {
  :is(.hd, .ov) .brand {
    gap: 10px;
  }
  :is(.hd, .ov) .brand img {
    width: 42px;
    height: 42px;
  }
  :is(.hd, .ov) .word {
    font-size: 1.3rem;
  }
  /* WhatsApp and email discs 10 % smaller on phones, icons too; their rings spread less and
     have room between them, so the header does not look crowded. */
  :is(.hd, .ov) .end {
    gap: 18px;
  }
  :is(.hd, .ov) .ping {
    --spread: 1.4;
    width: 36px;
    height: 36px;
  }
  /* The menu is only its three bars on phones, no pill around it; the word stays for screen readers. */
  :is(.hd, .ov) .menu-btn {
    padding: 0 2px;
    border-color: transparent;
    background: none;
    backdrop-filter: none;
  }
  :is(.hd, .ov) .menu-btn .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  :is(.hd, .ov) .ping svg {
    width: 18px;
    height: 18px;
  }
}

