/* =======================================================================
   JRB HOLIDAY - Home sections (Batch C)
   Destination Discovery (.jrb-disc) + Trending Destinations (.jrb-trend)
   -----------------------------------------------------------------------
   PROTECTION CONTRACT:
   - Scoped: every rule lives under .jrb-disc or .jrb-trend. No bare
     element/global selectors. Legacy sheets (style.css, design-system.css)
     untouched; hero files (jrb-hero.css/js) untouched.
   - Palette: cinematic ink #0d0d14, restrained gold #CFA50F, neutral
     hairlines. No cyan/purple, no neon, no glassmorphism.
   - Type: Fraunces (display, already loaded in index.php) + Inter (body).
   - Continuity: eyebrow + gold-rule grammar mirrors the approved hero.
   - A11y: focus-visible gold rings, reduced-motion kills hover motion,
     images carry alt + dimensions, semantic nav/list structure.
   IMPORT (index.php, after jrb-hero.css):
      jrb-hero.css -> jrb-home.css
   ======================================================================= */

/* ---------- Destination Discovery ---------- */

.jrb-disc {
  --jrb-disc-ink: #0d0d14;
  --jrb-disc-gold: #CFA50F;
  --jrb-disc-gold-line: rgba(207, 165, 15, 0.55);
  --jrb-disc-gold-faint: rgba(207, 165, 15, 0.22);
  --jrb-disc-text: #e0e0e5;
  --jrb-disc-muted: rgba(224, 224, 229, 0.64);
  --jrb-disc-hairline: rgba(224, 224, 229, 0.12);
  position: relative;
  background-color: var(--jrb-disc-ink);
  color: var(--jrb-disc-text);
  padding: clamp(3.5rem, 6vw, 5.75rem) 0;
}

.jrb-disc__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

/* Editorial header: eyebrow (hero grammar) + Fraunces title + gold rule */
.jrb-disc__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
}

.jrb-disc__eyebrow-key {
  letter-spacing: 0.4em;
  color: var(--jrb-disc-gold);
}

.jrb-disc__eyebrow-rule {
  width: 36px;
  height: 1px;
  background: var(--jrb-disc-gold-line);
  flex: 0 0 auto;
}

.jrb-disc__eyebrow-note {
  letter-spacing: 0.3em;
  color: rgba(224, 224, 229, 0.55);
  font-weight: 500;
}

.jrb-disc__title {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.95rem, 1.1rem + 2.6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.06;
  color: #ffffff;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}

.jrb-disc__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  margin-top: 1.1rem;
  background: var(--jrb-disc-gold-line);
}

.jrb-disc__deck {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--jrb-disc-muted);
  max-width: 58ch;
  margin: 1.15rem 0 0;
}

/* Split grid: immersive feature (left) + typographic index (right) */
.jrb-disc__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

/* Feature figure — image + overlapping editorial caption plate */
.jrb-disc__feature {
  margin: 0;
  position: relative;
}

.jrb-disc__feature-media {
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 5 / 4;
  background: #16161f;
}

.jrb-disc__feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jrb-disc__plate {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: -4.5rem 0 0 clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 2.5vw, 2rem) 0;
  background-color: var(--jrb-disc-ink);
  border-top: 1px solid var(--jrb-disc-gold-line);
}

.jrb-disc__plate-name {
  display: block;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: #ffffff;
}

.jrb-disc__plate-tag {
  display: block;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 340;
  font-size: 0.98rem;
  color: rgba(224, 224, 229, 0.8);
  margin-top: 0.4rem;
}

.jrb-disc__plate-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--jrb-disc-muted);
  margin: 0.9rem 0 0;
}

.jrb-disc__plate-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--jrb-disc-gold);
  text-decoration: none;
  margin-top: 1.1rem;
  padding-bottom: 1.4rem;
}

.jrb-disc__plate-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.jrb-disc__plate-link:hover svg,
.jrb-disc__plate-link:focus-visible svg {
  transform: translateX(4px);
}

/* Typographic index — rows divided by subtle gold hairlines */
.jrb-disc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--jrb-disc-gold-faint);
}

.jrb-disc__list li {
  border-top: 1px solid var(--jrb-disc-gold-faint);
}

.jrb-disc__list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0.35rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.25s ease, padding-left 0.25s ease;
}

.jrb-disc__list a:hover {
  background-color: rgba(207, 165, 15, 0.05);
  padding-left: 0.75rem;
}

.jrb-disc__list a:focus-visible {
  outline: 2px solid var(--jrb-disc-gold);
  outline-offset: -2px;
}

.jrb-disc__item-text {
  min-width: 0;
}

.jrb-disc__item-name {
  display: block;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.08rem, 0.95rem + 0.4vw, 1.25rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--jrb-disc-text);
  transition: color 0.25s ease;
}

.jrb-disc__list a:hover .jrb-disc__item-name {
  color: var(--jrb-disc-gold);
}

.jrb-disc__item-tag {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--jrb-disc-muted);
  margin-top: 0.15rem;
}

.jrb-disc__item-arrow {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--jrb-disc-gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  align-self: center;
}

.jrb-disc__list a:hover .jrb-disc__item-arrow,
.jrb-disc__list a:focus-visible .jrb-disc__item-arrow {
  opacity: 1;
  transform: translateX(0);
}

.jrb-disc__index-note {
  font-size: 0.78rem;
  color: rgba(224, 224, 229, 0.5);
  margin: 1.1rem 0 0;
}

.jrb-disc__index-note a {
  color: var(--jrb-disc-gold);
  text-decoration: none;
}

.jrb-disc__index-note a:hover,
.jrb-disc__index-note a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Trending Destinations ---------- */

.jrb-trend {
  --jrb-trend-ink: #0d0d14;
  --jrb-trend-gold: #CFA50F;
  --jrb-trend-gold-line: rgba(207, 165, 15, 0.55);
  --jrb-trend-muted: rgba(224, 224, 229, 0.64);
  --jrb-trend-text: #e0e0e5;
  position: relative;
  background-color: var(--jrb-trend-ink);
  color: var(--jrb-trend-text);
  padding: 0 0 clamp(3.5rem, 6vw, 5.75rem);
}

.jrb-trend__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.jrb-trend__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
}

.jrb-trend__eyebrow-key {
  letter-spacing: 0.4em;
  color: var(--jrb-trend-gold);
}

.jrb-trend__eyebrow-rule {
  width: 36px;
  height: 1px;
  background: var(--jrb-trend-gold-line);
  flex: 0 0 auto;
}

.jrb-trend__eyebrow-note {
  letter-spacing: 0.3em;
  color: rgba(224, 224, 229, 0.55);
  font-weight: 500;
}

.jrb-trend__title {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.95rem, 1.1rem + 2.6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.06;
  color: #ffffff;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}

.jrb-trend__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  margin-top: 1.1rem;
  background: var(--jrb-trend-gold-line);
}

.jrb-trend__deck {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--jrb-trend-muted);
  max-width: 58ch;
  margin: 1.15rem 0 0;
}

/* Composed mosaic — deliberately unequal panels, staggered depth */
.jrb-trend__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 250px 250px 210px;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: clamp(2.25rem, 4vw, 3.25rem) 0 0;
}

.jrb-trend__item {
  position: relative;
  min-width: 0;
}

.jrb-trend__item a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background-color: #16161f;
  text-decoration: none;
  color: inherit;
}

/* ---------- Light theme: Trending Destinations ----------
   This section keeps its own --jrb-trend-* token block (it predates the
   shared html-level tokens), so it needs a narrow html-scoped override to
   follow the canonical <html data-theme> driver. Card captions stay white
   because they sit on photo scrims in both themes. */
html[data-theme="light"] .jrb-trend {
  --jrb-trend-ink: #F7F7F5;
  --jrb-trend-gold: #7D6404;
  --jrb-trend-muted: #626270;
  --jrb-trend-text: #20202A;
}
html[data-theme="light"] .jrb-trend__title {
  color: #20202A;
}
html[data-theme="light"] .jrb-trend__eyebrow-note {
  color: rgba(32, 32, 42, 0.55);
}

.jrb-trend__item--lead {
  grid-column: 1 / span 4;
  grid-row: 1 / span 2;
  transform: translateY(-14px);
}

.jrb-trend__item--a {
  grid-column: 5 / span 5;
  grid-row: 1;
}

.jrb-trend__item--b {
  grid-column: 10 / span 3;
  grid-row: 1;
}

.jrb-trend__item--c {
  grid-column: 5 / span 8;
  grid-row: 2;
}

.jrb-trend__item--d {
  grid-column: 1 / span 12;
  grid-row: 3;
}

.jrb-trend__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .jrb-trend__item img {
    transition: transform 0.55s ease;
  }

  .jrb-trend__item a:hover img {
    transform: scale(1.04);
  }
}

/* Scrim keeps captions legible without glass panels */
.jrb-trend__item a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 13, 20, 0) 42%, rgba(13, 13, 20, 0.88) 100%);
  pointer-events: none;
}

.jrb-trend__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1rem 1.15rem 1.05rem;
}

.jrb-trend__name {
  display: block;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.6rem);
  font-weight: 400;
  line-height: 1.1;
  color: #ffffff;
}

.jrb-trend__item--lead .jrb-trend__name {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.05rem);
}

.jrb-trend__tag {
  display: block;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 340;
  font-size: 0.88rem;
  color: rgba(224, 224, 229, 0.78);
  margin-top: 0.3rem;
}

.jrb-trend__caption::before {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: var(--jrb-trend-gold-line);
  margin-bottom: 0.7rem;
}

.jrb-trend__item a:focus-visible {
  outline: 2px solid var(--jrb-trend-gold);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
  .jrb-trend__grid {
    grid-template-rows: 300px 240px 230px 190px;
  }

  .jrb-trend__item--lead {
    grid-column: 1 / span 12;
    grid-row: 1;
    transform: none;
  }

  .jrb-trend__item--a {
    grid-column: 1 / span 7;
    grid-row: 2;
  }

  .jrb-trend__item--b {
    grid-column: 8 / span 5;
    grid-row: 2;
  }

  .jrb-trend__item--c {
    grid-column: 1 / span 12;
    grid-row: 3;
  }

  .jrb-trend__item--d {
    grid-row: 4;
  }
}

@media (max-width: 991.98px) {
  .jrb-disc__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .jrb-disc__plate {
    max-width: 560px;
  }
}

@media (max-width: 767.98px) {
  .jrb-trend__grid {
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 12px;
  }

  .jrb-trend__item {
    aspect-ratio: 16 / 10;
    grid-column: 1 / span 12 !important;
    grid-row: auto !important;
  }

  .jrb-trend__item--lead {
    aspect-ratio: 4 / 3;
  }

  .jrb-trend__item--d {
    aspect-ratio: 21 / 9;
  }

  .jrb-disc__feature-media {
    aspect-ratio: 16 / 11;
  }

  .jrb-disc__plate {
    margin-top: -3rem;
    margin-left: clamp(0.75rem, 4vw, 1.5rem);
    padding-top: 1.15rem;
  }

  .jrb-disc__list a {
    padding: 0.95rem 0.2rem;
  }
}

@media (max-width: 479.98px) {
  .jrb-disc__eyebrow-note,
  .jrb-trend__eyebrow-note {
    display: none;
  }

  .jrb-disc__eyebrow-rule,
  .jrb-trend__eyebrow-rule {
    width: 24px;
  }

  .jrb-disc__plate {
    margin-left: 0.65rem;
  }

  .jrb-trend__caption {
    padding: 0.85rem 0.9rem 0.95rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .jrb-disc__list a,
  .jrb-disc__plate-link svg,
  .jrb-disc__item-name,
  .jrb-disc__item-arrow,
  .jrb-trend__item img {
    transition: none !important;
  }

  .jrb-disc__list a:hover {
    padding-left: 0.35rem;
  }

  .jrb-disc__item-arrow,
  .jrb-disc__plate-link:hover svg,
  .jrb-disc__plate-link:focus-visible svg {
    transform: none;
  }
}

/* ==========================================================================
   Flight search widget (React island, source in flight-widget/)
   The widget brings its own glass card, so the legacy .search-engine frame is
   only kept for the tab strip. Two things need adjusting: the engine must stop
   clipping (its overflow:hidden cuts the airport dropdown and the travellers
   popover), and the panel padding shrinks so the widget sits inside the frame.
   The widget keeps its own dark card on purpose: the homepage light theme
   turns the engine panel white, and a bare widget would be white-on-white.
   ========================================================================== */

/* (0,3,0) so it also beats .jrb-find .search-engine { overflow: hidden } in
   jrb-home-sections.css, which loads after this file. */
.jrb-find .search-engine.is-flights { overflow: visible; }

.search-engine.is-flights #panel-flights { padding: 12px; }

/* No min-height here: the widget paints as soon as the module runs, and a
   reserved height left a permanent gap under the search button. */

@media (max-width: 767.98px) {
    .search-engine.is-flights #panel-flights { padding: .5rem; }
}
