/* =============================================================================
   case-joyjet.css  —  scoped re-layout for /cases/joyjet (all locales)
   Loaded only on the JoyJet case page (main.case-joyjet). Nothing here leaks
   to other case studies. Built per the yusmp-case-layout skill.

   JoyJet is a MOBILE case (native iOS + Android app) → portrait phone-bezel
   device mockups. Page runs on the dark Quiet-Aurora theme (navy bg, light
   text), so tables/dividers use explicit ruling colours that are actually
   VISIBLE on navy — the theme's --c-border (8%) / --c-border-strong (16%)
   wash out to nothing on the dark surface.
   ========================================================================== */

/* ---- 1. Section rhythm + brand-yellow title accent ------------------------- */
.case-joyjet .section__title { position: relative; }
.case-joyjet .case-detail__section > .container > .section__title::after,
.case-joyjet .case-detail__hero + .case-detail__section .section__title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--c-brand);
}
/* Comfortable measure for lone lead paragraphs (before columnisation). */
.case-joyjet .case-detail__section > .container > .section__lead {
  max-width: 68ch;
  font-size: 1.06rem;
  line-height: 1.72;
}

/* ---- 2. Feature rows: balance the phone against the copy ------------------- */
@media (min-width: 900px) {
  .case-joyjet .case-feature {
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
  }
  .case-joyjet .case-feature__copy { max-width: 60ch; }
}

/* ---- 3. App screens as portrait phone-bezel mockups (MOBILE case) ----------
   Feature images are portrait phone screenshots (≈9:19.5). Wrap each in a soft
   on-brand stage and frame the screenshot in a navy phone bezel with a capped
   height so no single image exceeds roughly one viewport. */
.case-joyjet .case-feature__media {
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 46px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(46, 92, 242, 0.16), rgba(46, 92, 242, 0) 62%),
    linear-gradient(180deg, #f2f6ff 0%, #e9f0ff 100%);
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.case-joyjet .case-feature__media img {
  width: auto;
  height: auto;
  max-width: min(300px, 78%);
  max-height: clamp(430px, 58vh, 560px);
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 34px;
  background: #fff;
  border: 7px solid #0b1020;                 /* device bezel (navy) */
  box-shadow:
    0 34px 60px -26px rgba(11, 16, 32, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: transform var(--dur-3, 480ms) var(--ease-out, ease),
              box-shadow var(--dur-3, 480ms) var(--ease-out, ease);
}
.case-joyjet .case-feature__media:hover img {
  transform: translateY(-6px);
  box-shadow:
    0 44px 70px -24px rgba(11, 16, 32, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ---- 4. Hero cover: lift the composited mockup off the panel --------------- */
.case-joyjet .case-detail__hero-cover { border-radius: var(--radius-xl); overflow: hidden; }
.case-joyjet .case-detail__hero-cover img {
  border-radius: var(--radius-xl);
  filter: drop-shadow(0 30px 50px rgba(11, 16, 32, 0.28));
}

/* ---- 5. "By the numbers" stat cards: quieter cards, louder numbers -------- */
.case-joyjet .card strong[style] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ---- 6. Comparison table — dark-native, visibly ruled ---------------------
   The "Custom native vs React Native vs white-label SDK" table used inline
   borders (rgba(127,127,127,0.2)) that vanish on navy — it read as line-less.
   Restyled dark-native: surface-card panel, clearly visible horizontal AND
   vertical ruling, generous cell air, zebra rows, and a highlighted JoyJet
   column. On phones each row collapses into a labelled card (data-label). */
.case-joyjet .cl-compare {
  margin-top: 1.5rem;
  /* Dedicated ruling colours, tuned to be clearly visible on navy. */
  --cl-line: rgba(255, 255, 255, 0.26);
  --cl-line-soft: rgba(255, 255, 255, 0.14);
}
/* Full-width variant — the comparison table lives as a direct child of the
   .container, NOT inside the narrow .case-feature__copy column. A 4-column
   780px-min table crammed next to a phone mockup scrolls and reads as broken;
   at full container width it renders comfortably with no horizontal scroll on
   desktop. (Rule locked into the yusmp-case-layout skill.) */
.case-joyjet .cl-compare--full {
  margin-top: clamp(32px, 4.5vw, 56px);
}
.case-joyjet .cl-compare__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--cl-line);
  border-radius: var(--radius-lg);
  background: var(--c-surface-card);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.7);
}
.case-joyjet .cl-compare__scroll:focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 3px;
}
.case-joyjet .cl-compare__caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.6rem;
}
.case-joyjet .cl-compare__table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text);
}
.case-joyjet .cl-compare__table th,
.case-joyjet .cl-compare__table td {
  text-align: left;
  vertical-align: top;
  padding: 18px 22px;
  border-bottom: 1px solid var(--cl-line);
  border-right: 1px solid var(--cl-line-soft);
}
.case-joyjet .cl-compare__table th:last-child,
.case-joyjet .cl-compare__table td:last-child { border-right: 0; }
.case-joyjet .cl-compare__table thead th {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-text-muted);
  background: var(--c-bg-dark);
  border-bottom: 2px solid var(--cl-line);
  white-space: nowrap;
}
.case-joyjet .cl-compare__table tbody th {
  font-weight: 700;
  color: var(--c-text);
  width: 22%;
  background: rgba(255, 255, 255, 0.05);
}
.case-joyjet .cl-compare__table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.055);
}
.case-joyjet .cl-compare__table tbody tr:last-child th,
.case-joyjet .cl-compare__table tbody tr:last-child td { border-bottom: 0; }

/* Highlighted JoyJet (custom native) column — "our" option at a glance. */
.case-joyjet .cl-compare__table thead th.is-joyjet {
  color: #fff;
  background: var(--c-cta);
  border-bottom-color: var(--c-cta);
}
.case-joyjet .cl-compare__table td.is-joyjet {
  background: rgba(46, 92, 242, 0.24);
  font-weight: 600;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--c-cta), inset -3px 0 0 var(--c-cta);
}
.case-joyjet .cl-compare__table tbody tr:nth-child(even) td.is-joyjet {
  background: rgba(46, 92, 242, 0.3);
}
.case-joyjet .cl-compare__refs {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-top: 16px;
  line-height: 1.6;
}

/* Phones: stop shrinking a 4-column table; stack each row as a labelled card. */
@media (max-width: 640px) {
  .case-joyjet .cl-compare__scroll {
    overflow-x: visible;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .case-joyjet .cl-compare__table { min-width: 0; }
  .case-joyjet .cl-compare__table thead {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); border: 0;
  }
  .case-joyjet .cl-compare__table tbody tr {
    display: block;
    margin-bottom: 18px;
    border: 1px solid var(--cl-line);
    border-radius: var(--radius-md);
    background: var(--c-surface-card);
    overflow: hidden;
  }
  .case-joyjet .cl-compare__table tbody th {
    display: block; width: auto;
    font-size: 1rem; padding: 14px 18px;
    background: var(--c-bg-dark);
    border-right: 0; border-bottom: 1px solid var(--cl-line);
  }
  .case-joyjet .cl-compare__table tbody td {
    display: grid;
    grid-template-columns: minmax(0, 42%) 1fr;
    gap: 12px 16px;
    align-items: start;
    padding: 13px 18px;
    border-right: 0; border-bottom: 1px solid var(--cl-line-soft);
  }
  .case-joyjet .cl-compare__table tbody td.is-joyjet { box-shadow: none; }
  .case-joyjet .cl-compare__table tbody td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 0.78rem; line-height: 1.45;
    color: var(--c-text-muted);
  }
  .case-joyjet .cl-compare__table tbody td.is-joyjet::before { color: #8fb0ff; }
  .case-joyjet .cl-compare__table tbody tr td:last-child { border-bottom: 0; }
}

/* ---- 7. Spacing polish — give glued components room to breathe ------------- */
/* Hero layout — the class-mismatch bug. Page markup uses
   .case-detail__hero-grid / -copy / -visual, but the sitewide hero CSS targets
   .case-detail__hero-inner / -cover, so none of it matched: the hero never
   became a grid and the phone mockup dropped flush under the copy. Restore the
   intended two-column layout with a real column gutter. */
.case-joyjet .case-detail__hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4.5vw, 56px);
  align-items: center;
}
@media (min-width: 900px) {
  .case-joyjet .case-detail__hero-grid { grid-template-columns: 57fr 43fr; }
}
.case-joyjet .case-detail__hero-visual { margin-top: clamp(8px, 1.5vw, 16px); }
.case-joyjet .case-detail__hero-meta {
  gap: 20px 44px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--c-border);
}
.case-joyjet .case-feature__text p { margin-bottom: 16px; }
.case-joyjet .case-feature__text p:last-child { margin-bottom: 0; }
.case-joyjet .case-highlights { gap: 14px; margin-top: 28px; }
.case-joyjet .grid { gap: clamp(20px, 2.4vw, 32px); }
.case-joyjet .grid .card { padding: clamp(22px, 2.4vw, 30px); }
.case-joyjet .section__lead + .section__lead { margin-top: 20px; }

/* ---- 8. FAQ — sitewide accordion component, flush-left --------------------
   Use the REAL .faq / .faq__item / .faq__q / .faq__a component (circular +/×
   pictogram + open-state feedback) — never bare <details>, which drops the
   pictograms and the hover cue. Pin the list flush-left under the (left-
   aligned) section heading, give each item card styling so they don't read as
   a glued run, and add an explicit hover state (border + icon) so hovering a
   question gives clear feedback. Mirrors limp 1:1. */
.case-joyjet .faq {
  gap: 12px;
  margin-left: 0;
  max-width: 900px;
}
.case-joyjet .faq__item {
  border: 1px solid var(--cl-faq, rgba(255, 255, 255, 0.16));
  border-radius: var(--radius-md);
  background: var(--c-surface-card);
  overflow: hidden;
  transition: border-color var(--dur-2, 220ms) var(--ease, ease),
              background var(--dur-2, 220ms) var(--ease, ease);
}
/* Hover cue: highlight the card edge and light up the +/× pictogram. */
.case-joyjet .faq__item:hover { border-color: var(--c-cta); }
.case-joyjet .faq__item:hover .faq__q::after {
  background: var(--c-cta);
  color: #fff;
}
.case-joyjet .faq__item[open] { border-color: var(--c-cta); }

/* ---- 9. Long-form prose sections → two readable columns -------------------
   The narrative walls ("The brief", the JJPremium economy, "Launching across
   the US and EU", the roadmap) were single essay-length paragraphs run
   full-width. Wrap the prose in .cl-prose and columnise the WRAPPER only —
   never put a <h2> with column-span:all (WebKit collapses the multicol back to
   a wall), and never let .cl-prose wrap a grid/table (multicol fragments it).
   Guard with :not(:has(.grid)). Applied 1:1 across all four locales. */
.case-joyjet .cl-prose { max-width: 1000px; }
.case-joyjet .cl-prose > .section__lead {
  font-size: 1.06rem;
  line-height: 1.72;
  max-width: 68ch;
}
@media (min-width: 761px) {
  .case-joyjet .cl-prose:not(:has(.grid)) {
    column-count: 2;
    column-gap: clamp(40px, 4.5vw, 72px);
  }
  .case-joyjet .cl-prose:not(:has(.grid)) > .section__lead {
    max-width: none;
    margin-top: 0;
    orphans: 3;
    widows: 3;
  }
  .case-joyjet .cl-prose:not(:has(.grid)) > .section__lead + .section__lead { margin-top: 1.05rem; }
  .case-joyjet .cl-prose:has(.grid) > .section__lead { max-width: 68ch; }
}

/* ---- Gap after the hero (first block) ------------------------------------
   Same as limp: hero padding-bottom (≤104px) + first section padding-top
   (≤88px) ≈ up to 192px of dead air under the fold. Cap to ≤120px (64 + 56). */
.case-joyjet .case-detail__hero { padding-bottom: clamp(40px, 5vw, 64px); }
.case-joyjet .case-detail__hero + .case-detail__section { padding-top: clamp(36px, 4.5vw, 56px); }
