/* The active section lines up with the beginning of the panorama. */
body:has(#home-view:not([hidden])) .header {
  background: #fffef9;
  border-bottom-color: #e2e6dc;
}

@media (min-width: 861px) {
  body:has(#home-view:not([hidden])) .header .desktop-nav a {
    border-radius: 5px;
    padding-inline: clamp(8px, 1vw, 15px);
  }
  body:has(#home-view:not([hidden])) .header .desktop-nav .nav-current {
    background: transparent;
    color: #114d41;
  }
  body:has(#home-view:not([hidden])) .header .desktop-nav .nav-current::after {
    content: "";
    left: clamp(8px, 1vw, 15px);
    right: clamp(8px, 1vw, 15px);
    bottom: 2px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }
}

/* The first photograph is visible even before the page scripts run. */
.travel-panorama {
  position: relative;
  isolation: isolate;
  color: #fffdf7;
  --panorama-edge: clamp(9px, 1.15vw, 22px);
}

.panorama-media,
.panorama-media::after {
  position: absolute;
  inset: 0;
}

.panorama-media {
  inset-inline: var(--panorama-edge);
  overflow: hidden;
  border-radius: 18px;
  background: #183d42;
  z-index: -1;
}

.panorama-media .hero-image {
  z-index: 0;
  object-position: 50% 49%;
  transition: opacity .52s ease;
}

.panorama-media .hero-image.shown {
  animation: reveal-coast 3.8s ease-out both;
}

@keyframes reveal-coast {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}

.panorama-media::after {
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgb(10 33 40 / 85%), rgb(11 35 41 / 60%) 31%, transparent 71%),
    linear-gradient(0deg, rgb(8 29 34 / 85%), rgb(10 29 36 / 10%) 40%, transparent 71%),
    radial-gradient(ellipse at 86% 66%, rgb(8 27 31 / 68%), transparent 30%),
    linear-gradient(225deg, rgb(15 35 40 / 67%), transparent 30%);
}

.panorama-inner {
  position: relative;
  min-height: clamp(420px, 34vw, 518px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
  column-gap: 32px;
  padding-block: clamp(42px, 4vw, 64px) 76px;
}

.panorama-intro { align-self: center; }

.panorama-intro h1 {
  margin: 0;
  font: 400 clamp(4.35rem, 6.9vw, 7.1rem)/.99 var(--display);
  letter-spacing: -.052em;
  color: #fffdf7;
}

.panorama-intro h1 span { color: #ffeac5; }

.panorama-intro > p {
  margin-top: 19px;
  max-width: 39ch;
  font-size: clamp(1rem, 1.2vw, 1.18rem);
  line-height: 1.53;
  text-wrap: pretty;
}

.panorama-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin-top: 20px;
}

.panorama-actions > *,
#scene-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: .88rem;
  font-weight: 650;
}

#panorama-search {
  padding: 0 18px;
  color: #183b32;
  background: #ffebc3;
  border-radius: 999px;
}

#panorama-search:hover { background: #fff8e9; }
.panorama-actions .icon, #scene-explore .icon { width: 15px; height: 15px; }
.panorama-actions a:hover, #scene-explore:hover span { text-decoration: underline; }

.panorama-folio {
  position: absolute;
  top: 24px;
  right: 0;
  width: 164px;
}

.panorama-folio .postcard-seal {
  position: static;
  flex-direction: row;
  justify-content: space-between;
  width: auto;
  aspect-ratio: auto;
  border: 0;
  outline: 0;
  background: transparent;
  text-shadow: 0 1px 5px #153138;
}

.panorama-folio .postcard-seal span {
  font: 650 .68rem/1.25 Arial, sans-serif;
  letter-spacing: .10em;
}

.panorama-folio .postcard-seal strong {
  font: 600 .72rem/1.25 ui-monospace, monospace;
  letter-spacing: .015em;
  white-space: nowrap;
}

.panorama-folio .postcard-seal.inked { animation: none; }

.panorama-caption {
  justify-self: end;
  width: min(100%, 310px);
}

.panorama-location {
  padding-left: 13px;
  border-left: 2px solid #ffe9bb;
  text-shadow: 0 1px 6px #162e32;
}

.panorama-region { display: flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; }
.panorama-region .icon { width: 14px; height: 14px; }
#scene-name { display: block; margin-top: 2px; font: 400 clamp(2.1rem, 2.8vw, 2.8rem)/1.08 var(--display); letter-spacing: -.034em; }
#scene-explore { justify-content: start; margin-bottom: -8px; text-shadow: inherit; }

.panorama-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 18px;
}

.panorama-picker button {
  position: relative;
  display: grid;
  align-content: end;
  text-align: left;
  min-height: 54px;
  isolation: isolate;
  overflow: hidden;
  padding: 0 9px 6px;
  border: 1px solid #fff8e29e;
  border-radius: 7px;
  background-color: #25483f;
  color: white;
  font-size: .77rem;
  font-weight: 650;
  text-shadow: 0 1px 4px #102826;
}

.panorama-picker button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, #091e20eb, transparent 87%),
              url("assets/postkort-mini.webp") left center / 300% 100%;
  transition: transform .22s ease;
}
.panorama-picker button:nth-child(2)::before { background-position: center; }
.panorama-picker button:nth-child(3)::before { background-position: right center; }
.panorama-picker button:hover::before { transform: scale(1.06); }
.panorama-picker button[aria-pressed=true] { outline: 2px solid #ffebc3; outline-offset: 2px; }

.panorama-arrows { display: none; gap: 5px; }
.panorama-arrows button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  border: 1px solid rgb(255 250 230 / 75%);
  border-radius: 50%;
  background: rgb(12 34 36 / 62%);
}
.panorama-arrows button:hover { background: #fff4de; color: #183e3b; }

.travel-panorama :is(a,button):focus-visible {
  outline: 3px solid #ffdfa1;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #163f3a;
}

/* Keep trip types and search fields together at every viewport width. */
.travel-panorama + .search-wrap { margin-top: -42px; }
#soeg.search-panel {
  border: 1px solid #c9d3cb;
  border-radius: 16px;
  padding: 0 clamp(14px, 1.6vw, 24px) 16px;
  box-shadow: 0 12px 30px -15px rgb(20 43 43 / 38%);
}
#soeg .search-top { min-height: 52px; padding-block: 0; }
#soeg .mode-group {
  align-self: stretch;
  gap: clamp(10px, 1.8vw, 28px);
  padding: 0;
  background: none;
  border: 0;
}
#soeg .mode {
  position: relative;
  padding: 0 2px;
  border-radius: 0;
  color: #465f57;
  background: none;
  box-shadow: none;
}
#soeg .mode.active { color: #124c3f; }
#soeg .mode.active::after {
  content: "";
  display: block;
  position: absolute;
  inset: auto 0 5px;
  height: 2px;
  background: currentColor;
}
#soeg .search-fields {
  gap: 0;
  align-items: stretch;
  border: 1px solid #b4c5bc;
  border-radius: 11px;
  background: #fafbf8;
}
#soeg .field {
  position: relative;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding-inline: clamp(9px, 1.1vw, 17px);
  background: transparent;
}
#soeg .field + .field { border-inline-start: 1px solid #cad6ce; }
#soeg .field:hover { background: #eaf1ea; }
#soeg :is(#origin, .hotel #destination) { border-start-start-radius: 10px; border-end-start-radius: 10px; border-inline-start: 0; }
#soeg .field:focus-visible { z-index: 1; }
#soeg .search-button { margin: 4px; border-radius: 8px; }

@media (max-width: 860px) {
  .panorama-inner { column-gap: 18px; min-height: 405px; }
  .panorama-intro h1 { font-size: clamp(3.8rem, 7.5vw, 4.6rem); }
  .panorama-caption { max-width: 265px; }
}

@media (max-width: 760px) {
  #soeg .search-fields { background: transparent; border: 0; gap: 0; }
  #soeg .field {
    padding: 9px 10px;
    min-height: 54px;
    background: #f8faf6;
    border-bottom: 1px solid #d2ddd3;
  }
  #soeg .search-fields :is(#origin, #destination, #dates, #guests) { border-radius: 0; }
  #soeg .search-fields #origin { border-top-left-radius: 7px; }
  #soeg .search-fields #destination { border-top-right-radius: 7px; }
  #soeg .search-fields.hotel #destination { border-top-left-radius: 7px; }
  #soeg .search-fields #dates, #soeg .hotel #destination { border-inline-start: 0; }
  #soeg .search-button { min-height: 46px; margin: 9px 0 0; }
}

@media (max-width: 680px) {
  .travel-panorama { --panorama-edge: 0; }
  .panorama-media { border-radius: 0; }
  .panorama-media picture .hero-image { object-position: 59% 50%; }
  .panorama-media::after {
    background:
      linear-gradient(90deg, rgb(9 32 38 / 82%), rgb(12 37 42 / 53%) 50%, rgb(12 37 42 / 5%) 96%),
      linear-gradient(0deg, rgb(9 29 35 / 92%), rgb(11 30 35 / 12%) 55%, transparent 80%);
  }
  .panorama-inner {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 13px;
    padding-block: 25px 33px;
  }
  .panorama-intro h1 { font-size: clamp(3.05rem, 11.7vw, 4.65rem); }
  .panorama-intro > p { max-width: 35ch; margin-top: 10px; font-size: .94rem; line-height: 1.42; }
  .panorama-actions { margin-top: 11px; gap: 0 13px; }
  #panorama-search { padding-inline: 12px; }
  .panorama-actions > * { font-size: .84rem; gap: 6px; }
  .panorama-folio, .panorama-picker { display: none; }
  .panorama-caption {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    border-top: 1px solid #fff4d957;
    padding-top: 9px;
  }
  .panorama-location { border: 0; padding: 0; }
  .panorama-region { font-size: .73rem; }
  #scene-name { font-size: 1.4rem; }
  #scene-explore { font-size: .79rem; margin: -4px 0 -6px; }
  .panorama-arrows { display: flex; }
  .travel-panorama + .search-wrap { margin-top: -20px; }
  #soeg.search-panel { padding: 0 11px 11px; border-radius: 12px; }
  #soeg .mode-group { gap: clamp(9px, 3.3vw, 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .panorama-media .hero-image,
  .panorama-media .hero-image.shown,
  .panorama-picker button::before { animation: none; transition: none; }
  .panorama-picker button:hover::before { transform: none; }
}
