/* ═══════════════════════════════════════════════════════════════════
   hero.css — hero layout and the illustrative fare-result preview
   (built in HTML/CSS, styled after the portal's result cards).
   The faint grid behind the hero is the page's only background
   treatment.
   ═══════════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(48px, 7vw, 104px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(var(--grid-line) / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(var(--grid-line) / 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 72% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 85% at 72% 40%, #000 15%, transparent 72%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

@media (max-width: 519.98px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ── Markets row: every country's flag, each a link to its sign-in ── */
.hero-markets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-top: 4px;
  font-size: 13px;
  color: rgb(var(--fg-muted));
}

.hero-markets-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(var(--fg-subtle));
}

.hero-markets-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.market-flag {
  display: inline-flex;
  border-radius: 4px;
  transition: transform 0.15s ease;
}
.market-flag:hover { transform: translateY(-1px); }
.market-flag .flag { width: 30px; height: 22px; font-size: 14px; }

.hero-markets-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  font-weight: 500;
  color: rgb(var(--fg));
  text-decoration: underline;
  text-decoration-color: rgb(var(--line-strong));
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease;
}
.hero-markets-more:hover { text-decoration-color: currentColor; }
.hero-markets-more svg { width: 14px; height: 14px; }

/* ── Preview ───────────────────────────────────────────────────────── */
.hero-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  justify-self: center;
}

.pv {
  container-type: inline-size;  /* the card adapts to its own width below */
  overflow: hidden;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius-lg);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-ambient);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

.pv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgb(var(--line));
}

.pv-route {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pv-route svg { width: 14px; height: 14px; color: rgb(var(--fg-subtle)); }

/* The market's flag leads the route: JNB → DXB is a South African search. */
.pv-market { width: 24px; height: 18px; margin-inline-end: 2px; font-size: 12px; }

.pv-meta {
  font-size: 12px;
  color: rgb(var(--fg-muted));
}

.pv-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgb(var(--canvas));
  transition: opacity 0.18s ease, transform 0.18s ease;
}

/* preview.js fades the body out, swaps the market, and fades it back. */
.pv-body.is-switching {
  opacity: 0;
  transform: translateY(4px);
}

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

.pv-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius);
  background: rgb(var(--surface));
}

.pv-card.is-selected {
  border-color: rgb(var(--accent));
  box-shadow: 0 0 0 3px rgb(var(--accent) / 0.16);
}

.pv-card.is-compact {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pv-airline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.pv-airline .logo { width: 34px; height: 34px; }

.pv-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pv-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.pv-sub {
  font-size: 11px;
  color: rgb(var(--fg-muted));
  white-space: nowrap;
}

.pv-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}

.pv-total {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pv-total.is-small { font-size: 14px; }

.pv-break {
  font-size: 11px;
  color: rgb(var(--fg-muted));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Times row: 10:05 JNB ── plane ── 20:15 DXB */
.pv-times {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.pv-point {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pv-point.is-end { align-items: flex-end; }

.pv-time {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* Next-day arrival marker, as the portal shows it. */
.pv-time sup {
  margin-inline-start: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 0;
  vertical-align: super;
  color: rgb(var(--fg-muted));
}

.pv-code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgb(var(--fg-muted));
}

.pv-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgb(var(--fg-muted));
  white-space: nowrap;
}

.pv-track {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 14px;
}
.pv-track::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgb(var(--line-strong));
}
.pv-track svg {
  position: relative;
  width: 14px;
  height: 14px;
  padding: 0 3px;
  box-sizing: content-box;
  background: rgb(var(--surface));
  color: rgb(var(--fg-subtle));
  fill: currentColor;
  stroke: none;
  transform: rotate(90deg);
}

.pv-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgb(var(--line));
}

.pv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pv-chips span {
  padding: 3px 9px;
  border: 1px solid rgb(var(--line));
  border-radius: 999px;
  font-size: 11px;
  color: rgb(var(--fg-muted));
  white-space: nowrap;
}

.pv-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.pv-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius-sm);
  background: rgb(var(--surface));
  font-size: 13px;
  font-weight: 600;
}
.pv-btn.is-primary {
  border-color: transparent;
  background: rgb(var(--accent-solid));
  color: rgb(var(--on-accent));
}

.pv-caption {
  font-size: 12px;
  color: rgb(var(--fg-subtle));
  text-align: center;
}

/* Narrow preview (phones, and the two-column hero around 1024px):
   tighten the card and drop one detail chip so rows stay on one line. */
@container (max-width: 440px) {
  .pv-body { padding: 10px; }
  .pv-card { padding: 12px; }
  .pv-time { font-size: 19px; }
  .pv-times { gap: 10px; }
  .pv-chips span:nth-child(3) { display: none; }
}

/* Smallest phones: the cabin is already in the summary bar. */
@container (max-width: 340px) {
  .pv-chips span:nth-child(2),
  .pv-tags .tag-cabin { display: none; }
}
