/* Shared Elsewhere and credits surfaces, used by every Place page.
   The section beige matches arcadia13's Photography / Words surface, including
   the stable body colour supplied by quietcation-surfaces.js. Keep page-specific
   article styles out of this component and do not duplicate these rules inline. */
html body .elsewhere {
  --elsewhere-surface: #ddd5c9;
  --elsewhere-card: #f4f1ea;
  --elsewhere-ink: #20231f;
  --elsewhere-muted: #6f716b;
  --elsewhere-line: rgba(32, 35, 31, .16);
  --elsewhere-display: "larken", "Italiana", Georgia, serif;
  --elsewhere-serif: "Newsreader", Georgia, serif;
  --elsewhere-sans: "DM Sans", Arial, sans-serif;
  --elsewhere-gutter: 32px;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 70px max(var(--elsewhere-gutter), calc((100% - 1440px) / 2)) 88px;
  border-top: 1px solid var(--elsewhere-line);
  border-bottom: 1px solid var(--elsewhere-line);
  background: var(--elsewhere-surface);
  color: var(--elsewhere-ink);
  text-align: left;
}

/* The Elsewhere section owns its beige surface on every Place page. */
html body main.qc-place .elsewhere {
  background: #ddd5c9 !important;
}
html body main.qc-place .elsewhere .elsewhere__card {
  background: #f4f1ea !important;
}
html body main.qc-place .elsewhere .elsewhere__copy {
  background-color: #f4f1ea !important;
}

/* Credits conclude the editorial article in the same grid as its content.
   The following Elsewhere module owns the separate full-width beige surface. */
html body main.qc-place > .colophon {
  box-sizing: border-box;
  width: var(--page);
  margin: 0 auto !important;
  padding: 70px 0 38px;
  background: transparent !important;
}

/* A full-width section supplies the background without an overflowing 100vw
   pseudo-element. Images and copy remain aligned to Woodnest's content grid. */
html body .elsewhere::before,
html body .elsewhere::after {
  content: none;
}

html body .elsewhere .elsewhere__title {
  max-width: none;
  margin: 0 0 38px;
  padding: 0;
  color: var(--elsewhere-ink) !important;
  font: 300 clamp(34px, 4vw, 58px)/1.05 var(--elsewhere-display) !important;
  letter-spacing: -.025em;
  text-align: left;
  text-transform: none;
  text-wrap: balance;
}

html body .elsewhere .elsewhere__list {
  display: grid;
  gap: 24px;
  min-width: 0;
  margin: 0;
}

@media screen and (max-width: 900px) {
  html body .elsewhere .elsewhere__list {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-right: calc(var(--elsewhere-gutter) * -1);
    padding-right: var(--elsewhere-gutter);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    touch-action: pan-x pan-y;
  }
  html body .elsewhere .elsewhere__list::-webkit-scrollbar { display: none; }
  html body .elsewhere .elsewhere__list > .elsewhere__card {
    flex: 0 0 min(360px, 88%);
    width: auto;
    scroll-snap-align: start;
  }
}

/* Final mobile rail: keep every Elsewhere page horizontally swipeable even
   when legacy page styles try to restore a stacked list. */
@media screen and (max-width: 900px) {
  html body main.qc-place .elsewhere .elsewhere__list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: calc(100% + max(24px, var(--qc-mobile-gutter, 20px))) !important;
    max-width: none !important;
    gap: 16px !important;
    margin: 0 calc(-1 * max(24px, var(--qc-mobile-gutter, 20px))) 0 0 !important;
    padding: 0 max(24px, var(--qc-mobile-gutter, 20px)) 12px 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    touch-action: pan-x pan-y;
  }
  html body main.qc-place .elsewhere .elsewhere__list::-webkit-scrollbar { display: none; }
  html body main.qc-place .elsewhere .elsewhere__list > .elsewhere__card {
    flex: 0 0 min(360px, 88%) !important;
    width: auto !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    scroll-snap-align: start;
  }
  html body main.qc-place .elsewhere .manna-preview-description--full { display: none !important; }
  html body main.qc-place .elsewhere .manna-preview-description--mobile { display: inline !important; }
}

html body .elsewhere .elsewhere__card {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--elsewhere-card);
  color: var(--elsewhere-ink);
  text-decoration: none;
  transition: opacity .35s ease;
}

@media (min-width: 901px) {
  html body .elsewhere .elsewhere__card {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    height: clamp(420px, 30vw, 460px);
    min-height: 0;
  }

  html body .elsewhere .elsewhere__media {
    height: 100%;
    min-height: 0;
  }

  html body .elsewhere .elsewhere__copy {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

html body .elsewhere .elsewhere__card:hover { opacity: .82; }
html body .elsewhere .elsewhere__card:focus-visible {
  outline: 2px solid var(--elsewhere-ink);
  outline-offset: 5px;
}

html body .elsewhere .elsewhere__media {
  position: relative;
  min-width: 0;
  min-height: 440px;
  margin: 0;
  overflow: hidden;
}

/* On desktop the media column must stay inside the fixed card height.
   The mobile minimum is intentionally kept below. */
@media (min-width: 901px) {
  html body .elsewhere .elsewhere__media {
    height: 100%;
    min-height: 0;
  }
}

html body .elsewhere .elsewhere__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

html body .elsewhere .elsewhere__media > img[src$="manna-hero-image.webp"] {
  object-position: 61% 50%;
}

@media (min-width: 901px) {
  html body .elsewhere .elsewhere__media > img[src$="manna-hero-image.webp"] {
    transform: translateY(2%) scale(1.12) !important;
  }

  html body main .elsewhere .elsewhere__media > img[src*="/st-moritz/web/st-moritz-285-"],
  html body main .elsewhere .elsewhere__media > img[src$="StMoritz_Nimke_285.webp"] {
    transform-origin: center center !important;
    transform: scale(1.46) !important;
  }
}

html body .elsewhere .manna-preview-description--mobile { display: none; }

/* Centre the existing St. Moritz zoom vertically so the boat sits higher.
   Listing previews and the article hero keep their current crop. */
html body main .elsewhere .elsewhere__media > img[src*="/st-moritz/web/st-moritz-285-"],
html body main .elsewhere .elsewhere__media > img[src$="StMoritz_Nimke_285.webp"] {
  transform-origin: center center;
}

html body .elsewhere .elsewhere__credit {
  position: absolute;
  right: 14px;
  bottom: 12px;
  margin: 0;
  color: #f5f1e8 !important;
  font: 400 8px/1 var(--elsewhere-sans) !important;
  letter-spacing: .1em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
  text-transform: uppercase;
}

@media (min-width: 901px) {
  html body .elsewhere .elsewhere__credit {
    font-size: 6px !important;
    letter-spacing: .08em;
  }
}

html body .elsewhere .elsewhere__copy {
  align-self: center;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: clamp(42px, 6vw, 86px);
  background: var(--elsewhere-card);
  text-align: left;
}

html body .elsewhere .elsewhere__meta {
  margin: 0 0 17px;
  color: var(--elsewhere-muted) !important;
  font: 500 9px/1.4 var(--elsewhere-sans) !important;
  letter-spacing: .16em;
  text-align: left;
  text-transform: uppercase;
}

html body .elsewhere .elsewhere__name {
  margin: 0 0 20px;
  color: var(--elsewhere-ink) !important;
  font: 300 clamp(36px, 4.4vw, 66px)/.96 var(--elsewhere-display) !important;
  letter-spacing: -.025em;
  text-align: left;
  text-transform: none;
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}

html body .elsewhere .elsewhere__description {
  max-width: 430px;
  margin: 0;
  color: var(--elsewhere-muted) !important;
  font: 300 16px/1.52 var(--elsewhere-serif) !important;
  letter-spacing: normal;
  text-align: left;
  text-align-last: auto;
  text-transform: none;
  hyphens: manual;
}

@media (max-width: 900px) {
  html body .elsewhere { --elsewhere-gutter: 20px; }
}

@media (max-width: 580px) {
  html body .elsewhere {
    --elsewhere-gutter: 14px;
    padding-top: 54px;
    padding-bottom: 64px;
  }
  html body .elsewhere .elsewhere__title {
    margin-bottom: 25px;
    font-size: 37px !important;
  }
  html body .elsewhere .elsewhere__card { grid-template-columns: minmax(0, 1fr); }
  html body .elsewhere .manna-preview-description--full { display: none; }
  html body .elsewhere .manna-preview-description--mobile { display: inline; }
  html body .elsewhere .elsewhere__media {
    /* A real box before lazy loading, also in mobile Grid implementations.
       The image is absolutely positioned and cannot supply intrinsic height. */
    box-sizing: content-box;
    width: 100%;
    height: 0;
    min-height: 0;
    padding-top: 125%;
    aspect-ratio: auto;
    align-self: start;
  }
  html body .elsewhere .elsewhere__copy { padding: 24px 20px 26px; }
  html body .elsewhere .elsewhere__meta { margin-bottom: 12px; }
  html body .elsewhere .elsewhere__name {
    margin-bottom: 13px;
    font-size: 39px !important;
  }
  html body .elsewhere .elsewhere__description { font-size: 16.5px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html body .elsewhere .elsewhere__card { transition: none; }
}

/* Mobile recommendations use the Places card geometry and surfaces.
   Typography is already shared with Places through qc-type-roles. */
@media screen and (max-width: 900px) {
  html[data-qc-mobile-page] body main.qc-place .elsewhere {
    padding-inline: max(24px, var(--qc-mobile-gutter, 20px));
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__card {
    --elsewhere-card: #f1eee7;
    --elsewhere-ink: #15231c;
    width: min(360px, 88%);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start !important;
    overflow: hidden;
  }
  /* A single recommendation fills the available mobile content width. */
  html[data-qc-mobile-page] body main.qc-place .elsewhere > .elsewhere__card:only-of-type {
    width: 100%;
    max-width: none;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__card:is(:hover, :focus-visible) {
    opacity: .78;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__media {
    /* The absolute photo needs a definite 4:5 box before lazy loading. */
    position: relative !important;
    box-sizing: content-box !important;
    width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 125% 0 0 !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__media > img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    filter: saturate(.82) contrast(1.02);
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__media > img[src$="StMoritz_Nimke_285.webp"] {
    transform-origin: center top;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__credit {
    right: 13px;
    bottom: 11px;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__copy {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100%;
    padding: 20px 18px 22px;
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__meta {
    margin: 0 0 12px;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__name {
    margin: 0 0 14px;
    text-wrap: wrap;
  }
  html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__name::before {
    content: none;
  }
  @layer qc-type-roles {
    html[data-qc-mobile-page] body main.qc-place .elsewhere .elsewhere__meta {
      color: rgba(21, 35, 28, .58) !important;
    }
  }
}
