/* css/journey.css — the Journey tab: a live styled map of wherever the car
 * is right now (left card), plus automatic "did you know" facts about the
 * area in a swipeable carousel (right card). */

.journey-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: var(--space-md);
}

@media (orientation: portrait) {
  .journey-layout {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(12rem, 32vh, 20rem) minmax(0, 1fr);
  }
}

/* ---- Left card: the map -------------------------------------------------
 * Full-bleed image, no card padding — the accent wash + motif glyph sit in
 * a corner over the map itself rather than in a text gutter. */

.journey-map-card {
  padding: 0;
  min-height: 0;
  display: flex;
  background: radial-gradient(circle at 30% 0%, var(--color-accent-faint), transparent 60%), var(--color-surface);
}

.journey-map-card__motif {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-accent);
  background: var(--color-scrim);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.journey-map-card__motif svg {
  width: 1.2rem;
  height: 1.2rem;
}

.journey-map-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-map-skeleton {
  width: 100%;
  height: 100%;
}

.journey-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Right card: the facts carousel -------------------------------------
 * Editorial "field notes" motif — a small sparkle-and-label header, then a
 * looping swipe carousel filling the rest of the card. */

.journey-info-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.journey-info-card__label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px dashed var(--color-hairline);
}

.journey-info-card__label-icon {
  width: 1rem;
  height: 1rem;
}

.journey-facts {
  flex: 1;
  min-height: 0;
}

/* Loading skeleton only — replaced entirely once js/components/carousel.js
 * mounts onto #journey-facts. */
.journey-fact-card--skeleton {
  min-height: 5rem;
  margin-bottom: var(--space-sm);
}

/* Tappable — opens the full write-up in the shared detail modal
 * (js/components/detail-modal.js), which is also where any text too long
 * for the extract's clamp below actually gets read in full. */
.journey-fact-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  cursor: pointer;
}

.journey-fact-card__thumb {
  flex: none;
  width: 100%;
  max-height: 40%;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.journey-fact-card__text {
  min-width: 0;
}

.journey-fact-card__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-size: var(--text-title);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.journey-fact-card__pick-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--color-accent);
  flex: none;
}

/* About Your Driver card only — the trivia question, set off from the
 * answer text below it in .journey-fact-card__extract. */
.journey-fact-card__question {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-body);
  color: var(--color-text-primary);
  margin-bottom: 0.35rem;
}

/* Clamped so a longer extract/answer never overflows this small card —
 * the full text is always one tap away in the detail modal. */
.journey-fact-card__extract {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  line-height: var(--leading-body);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- "There's more" affordance --------------------------------------------
 * Only shown when js/utils/dom.js's markTruncatedCards() (run from
 * journey-card.js's recomputeTruncation(), after layout, on every refresh
 * AND on resize/rotation) actually detects clipped text on this specific
 * card — a fixed always-on hint would be wrong as often as it's right
 * across this app's range of tablet screen sizes, since the type scale is
 * viewport-relative (css/theme.css's clamp()-based --text-* tokens). */
.journey-fact-card__continue {
  display: none;
  align-items: center;
  gap: 0.25rem;
  align-self: flex-end;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-faint);
}

.journey-fact-card__continue svg {
  width: 0.75rem;
  height: 0.75rem;
}

.journey-fact-card.is-truncated .journey-fact-card__continue {
  display: inline-flex;
}
