/*
 * FRE Day Trek Departures — scoped entirely under .fre-ud. Same FRE family
 * as Scheduled Expeditions / Huemul (editorial composition, photo-led
 * feature card, departures panel, date blocks, status pills, occupancy
 * indicators, circular arrows, spacing, radii, type hierarchy) but its own,
 * lighter identity: exactly #F7F7F7, no dark card, no outer border/shadow.
 * The section is meant to read as part of the Home page itself, not a
 * widget sitting on top of it — only the inner cards (the feature photo,
 * the panel, each row) carry contrast; the section root does not. Nothing
 * here targets body, h1-h6, button or .elementor-* outside this scope.
 */
.fre-ud {
  --fre-ud-ink: #1c231d;
  --fre-ud-muted: #6d6b5c;
  --fre-ud-paper: #f7f7f7;
  --fre-ud-paper-deep: #ececec;
  --fre-ud-white: #fffdf8;
  --fre-ud-line: rgba(28, 35, 29, 0.12);
  --fre-ud-glacier: #386f87;
  --fre-ud-glacier-deep: #24505f;
  --fre-ud-glacier-soft: #d5e6ea;
  --fre-ud-moss: #55704f;
  --fre-ud-success: #3f6b4a;
  --fre-ud-warning: #93713a;
  --fre-ud-radius-lg: 32px;
  --fre-ud-radius-md: 22px;

  background: var(--fre-ud-paper);
  color: var(--fre-ud-ink);
  font-family: inherit;
  padding: clamp(26px, 4.6vw, 54px);
  position: relative;
}

.fre-ud,
.fre-ud * {
  box-sizing: border-box;
}

/* ---------- Header: eyebrow + heading left, short description right ---------- */

.fre-ud__header {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  justify-content: space-between;
  margin-bottom: clamp(24px, 3.4vw, 40px);
}

.fre-ud__header-main {
  max-width: 640px;
}

.fre-ud__eyebrow {
  align-items: center;
  color: var(--fre-ud-glacier-deep);
  display: flex;
  font-size: 10px;
  font-weight: 720;
  gap: 10px;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.fre-ud__live-dot {
  background: var(--fre-ud-glacier);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(56, 111, 135, 0.14);
  display: inline-block;
  height: 7px;
  width: 7px;
}

.fre-ud__header h2 {
  color: var(--fre-ud-ink);
  font-size: clamp(30px, 3.9vw, 46px);
  font-weight: 380;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}

.fre-ud__header-desc {
  color: var(--fre-ud-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 4px;
  max-width: 320px;
  text-align: right;
}

.fre-ud__layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  position: relative;
}

/* ---------- Feature card: the one place a photo fills the whole tile ---------- */

.fre-ud__feature {
  background: linear-gradient(155deg, rgba(56, 111, 135, 0.28), transparent 55%), linear-gradient(20deg, #1c2b32, #2d4a55);
  border-radius: var(--fre-ud-radius-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 460px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  position: relative;
}

.fre-ud__feature-media {
  background-position: center;
  background-size: cover;
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 420ms ease;
}

.fre-ud__feature--has-image .fre-ud__feature-media {
  opacity: 1;
}

.fre-ud__feature-shade {
  background: linear-gradient(to top, rgba(10, 15, 12, 0.92) 0%, rgba(10, 15, 12, 0.28) 55%, rgba(10, 15, 12, 0.06) 100%);
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.fre-ud__feature-top,
.fre-ud__feature-badge,
.fre-ud__feature-copy {
  position: relative;
  z-index: 1;
}

.fre-ud__feature-top {
  color: rgba(255, 253, 248, 0.78);
  display: flex;
  font-size: 9px;
  font-weight: 660;
  justify-content: space-between;
  letter-spacing: 0.12em;
  margin-bottom: auto;
  text-transform: uppercase;
}

.fre-ud__feature-badge {
  align-self: flex-start;
  background: rgba(213, 230, 234, 0.16);
  border: 1px solid rgba(213, 230, 234, 0.4);
  border-radius: 999px;
  color: var(--fre-ud-glacier-soft);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
  margin: 18px 0 12px;
  padding: 6px 12px;
  text-transform: uppercase;
  width: fit-content;
}

.fre-ud__feature-copy h3 {
  color: var(--fre-ud-white);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 380;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 18px;
  transition: opacity 220ms ease;
}

.fre-ud__feature-stats {
  border-top: 1px solid rgba(255, 253, 248, 0.18);
  display: flex;
  gap: 22px 26px;
  padding-top: 16px;
}

.fre-ud__feature-stats > div {
  min-width: 0;
  transition: opacity 220ms ease;
}

.fre-ud__feature-stats > div.is-empty {
  display: none;
}

.fre-ud__feature-stats strong {
  color: var(--fre-ud-white);
  display: block;
  font-size: 13px;
  font-weight: 640;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 3px;
}

.fre-ud__feature-stats span {
  color: rgba(255, 253, 248, 0.62);
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fre-ud__feature.is-swapping .fre-ud__feature-copy h3,
.fre-ud__feature.is-swapping .fre-ud__feature-stats > div {
  opacity: 0.32;
}

/* ---------- Panel + nested scroll ---------- */

.fre-ud__panel {
  background: var(--fre-ud-white);
  border-radius: var(--fre-ud-radius-md);
  box-shadow: 0 12px 30px rgba(28, 35, 29, 0.05);
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.6vw, 28px);
}

.fre-ud__panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 32px;
}

.fre-ud__panel-head > div {
  align-items: center;
  display: flex;
  gap: 9px;
}

.fre-ud__panel-head > div > span,
.fre-ud__live {
  color: var(--fre-ud-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fre-ud__panel-head > div > strong {
  align-items: center;
  background: var(--fre-ud-ink);
  border-radius: 999px;
  color: var(--fre-ud-white);
  display: inline-flex;
  font-size: 10px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.fre-ud__live {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.fre-ud__live i {
  background: var(--fre-ud-success);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(63, 107, 74, 0.12);
  display: inline-block;
  height: 7px;
  width: 7px;
}

/*
 * Nested scroll, native only, deliberately WITHOUT overscroll-behavior:
 * `overflow-y: auto` + a fixed `max-height` is the entire mechanism. Every
 * browser's default scroll chaining already does exactly what's wanted:
 * while there's more to scroll inside the panel, the wheel/trackpad scrolls
 * the panel; the instant it hits its top/bottom edge, the SAME physical
 * scroll gesture continues on to scroll the page — no cursor move needed,
 * no JS, no preventDefault().
 *
 * `overscroll-behavior-y: contain` was deliberately tried and reverted: it
 * does the opposite of what's wanted here. `contain` exists specifically to
 * STOP that chaining — it's for modals/dropdowns that must never leak
 * scroll to the page behind them. With `contain`, hitting the bottom of
 * this panel and continuing to scroll would do nothing until the cursor
 * moves off the panel — a mild trap, exactly what this must avoid. Leaving
 * overscroll-behavior at its default (`auto`) is what makes chaining work.
 */
.fre-ud__list {
  border-top: 1px solid var(--fre-ud-line);
  max-height: 470px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.fre-ud__row {
  align-items: center;
  border-bottom: 1px solid var(--fre-ud-line);
  color: var(--fre-ud-ink) !important;
  column-gap: 14px;
  display: grid;
  grid-template-columns: 46px 52px minmax(0, 1fr) auto auto;
  min-height: 44px;
  padding: 15px 6px;
  text-decoration: none !important;
  transition: background-color 180ms ease, padding 180ms ease;
}

.fre-ud__row:hover,
.fre-ud__row:focus-within,
.fre-ud__row.is-active {
  background: var(--fre-ud-paper-deep);
  border-radius: 16px;
  outline: none;
  padding-left: 12px;
  padding-right: 12px;
}

.fre-ud__row:focus-within {
  box-shadow: 0 0 0 2px var(--fre-ud-glacier);
}

/* No CTA at all (no WeTravel trigger, no Spiffy link) — informational only, never a dead link. */
.fre-ud__row--inert {
  cursor: default;
}

.fre-ud__row--inert:hover {
  background: none;
  border-radius: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.fre-ud__row-date {
  align-items: center;
  color: var(--fre-ud-ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
  text-align: center;
}

.fre-ud__row-date small:first-child {
  color: var(--fre-ud-glacier-deep);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.fre-ud__row-date strong {
  font-size: 21px;
  font-weight: 460;
  letter-spacing: -0.02em;
}

.fre-ud__row-date small:last-child {
  color: var(--fre-ud-muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
  margin-top: 3px;
  text-transform: uppercase;
}

.fre-ud__row-photo {
  background-color: var(--fre-ud-paper-deep);
  background-position: center;
  background-size: cover;
  border-radius: 12px;
  height: 52px;
  width: 52px;
}

.fre-ud__row-main {
  display: block;
  min-width: 0;
}

.fre-ud__row-topline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 9px;
  margin-bottom: 6px;
}

.fre-ud__status {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-block;
  font-size: 8px;
  font-style: normal;
  font-weight: 740;
  letter-spacing: 0.08em;
  line-height: 1.25;
  padding: 5px 8px 4px;
  text-transform: uppercase;
}

.fre-ud__status--forming {
  background: rgba(147, 113, 58, 0.09);
  color: var(--fre-ud-warning);
}

.fre-ud__status--confirmed {
  background: rgba(63, 107, 74, 0.09);
  color: var(--fre-ud-success);
}

.fre-ud__status--sold_out {
  color: var(--fre-ud-muted);
}

.fre-ud__row-topline > small {
  color: var(--fre-ud-muted);
  font-size: 9px;
}

.fre-ud__row-name {
  display: block;
  font-size: 16px;
  font-weight: 580;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 3px;
}

.fre-ud__row-date-line {
  color: var(--fre-ud-muted);
  display: block;
  font-size: 10px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.fre-ud__row-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fre-ud__dot {
  background: var(--fre-ud-white);
  border: 1px solid var(--fre-ud-line);
  border-radius: 50%;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.fre-ud__dot.is-filled.fre-ud__dot--forming {
  background: var(--fre-ud-warning);
  border-color: var(--fre-ud-warning);
}

.fre-ud__dot.is-filled.fre-ud__dot--confirmed {
  background: var(--fre-ud-success);
  border-color: var(--fre-ud-success);
}

.fre-ud__dot.is-filled.fre-ud__dot--sold_out {
  background: var(--fre-ud-muted);
  border-color: var(--fre-ud-muted);
}

.fre-ud__row-price {
  min-width: 64px;
  text-align: right;
}

.fre-ud__row-price small {
  color: var(--fre-ud-muted);
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fre-ud__row-price strong {
  color: var(--fre-ud-ink);
  display: block;
  font-size: 13px;
  font-weight: 640;
  margin-top: 3px;
  white-space: nowrap;
}

.fre-ud__row-arrow {
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  background: var(--fre-ud-ink);
  border: 0;
  border-radius: 50%;
  color: var(--fre-ud-white) !important;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 34px;
  font: inherit;
  font-size: 15px;
  height: 34px;
  justify-content: center;
  margin: 0;
  padding: 0;
  text-decoration: none !important;
  transition: background-color 180ms ease, transform 180ms ease;
  width: 34px;
}

.fre-ud__row-cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 5px var(--fre-ud-glacier);
  outline: none;
}

.fre-ud__row-arrow--disabled {
  background: transparent;
  cursor: default;
  border: 1px solid var(--fre-ud-line);
  color: var(--fre-ud-muted);
}

.fre-ud__row:hover .fre-ud__row-arrow,
.fre-ud__row:focus-within .fre-ud__row-arrow,
.fre-ud__row.is-active .fre-ud__row-arrow {
  background: var(--fre-ud-glacier);
  transform: translateX(2px);
}

/* ---------- Panel footer: optional "explore all" link ---------- */

.fre-ud__panel-all {
  align-items: center;
  color: var(--fre-ud-ink) !important;
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 16px 6px 2px;
  text-decoration: none !important;
}

.fre-ud__panel-all span {
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fre-ud__panel-all i {
  align-items: center;
  border: 1px solid var(--fre-ud-line);
  border-radius: 50%;
  display: inline-flex;
  font-size: 14px;
  font-style: normal;
  height: 32px;
  justify-content: center;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
  width: 32px;
}

.fre-ud__panel-all:hover i,
.fre-ud__panel-all:focus-visible i {
  background: var(--fre-ud-glacier);
  border-color: var(--fre-ud-glacier);
  color: var(--fre-ud-white) !important;
  transform: translate(1px, -1px);
}

/* ---------- Empty state ---------- */

.fre-ud__empty {
  background: var(--fre-ud-white);
  border-radius: var(--fre-ud-radius-md);
  padding: clamp(30px, 5vw, 56px);
  position: relative;
}

.fre-ud__empty h3 {
  color: var(--fre-ud-ink);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 400;
  margin: 0 0 10px;
}

.fre-ud__empty p {
  color: var(--fre-ud-muted);
  margin: 0;
}

/* ---------- Responsive: mobile becomes a purpose-built vertical flow ---------- */

@media (max-width: 920px) {
  .fre-ud__header {
    align-items: start;
  }

  .fre-ud__header-desc {
    max-width: 100%;
    text-align: left;
  }

  .fre-ud__layout {
    grid-template-columns: 1fr;
  }

  .fre-ud__feature {
    min-height: 300px;
  }

  .fre-ud__list {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 560px) {
  .fre-ud {
    padding: 22px 15px;
  }

  .fre-ud__header h2 {
    font-size: clamp(26px, 9vw, 34px);
  }

  .fre-ud__feature {
    min-height: 260px;
    padding: 18px;
  }

  .fre-ud__feature-stats {
    flex-wrap: wrap;
    gap: 14px 22px;
  }

  .fre-ud__panel {
    padding: 16px 12px;
  }

  .fre-ud__row {
    column-gap: 10px;
    grid-template-columns: 40px 46px minmax(0, 1fr) auto;
    min-height: 44px;
    padding: 14px 4px;
    row-gap: 6px;
  }

  .fre-ud__row-price {
    display: none;
  }

  .fre-ud__row-date strong {
    font-size: 18px;
  }

  .fre-ud__row-photo {
    height: 46px;
    width: 46px;
  }

  .fre-ud__row-arrow {
    height: 32px;
    width: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fre-ud__feature-media,
  .fre-ud__feature-copy h3,
  .fre-ud__feature-stats > div,
  .fre-ud__row,
  .fre-ud__row-arrow,
  .fre-ud__panel-all i {
    transition: none;
  }
}
