/* Shared mobile case-study navigation and density.
   This is the single phone/tablet behavior for every case study. */

/* The case-study header is an index of the portfolio, not homepage sections. */
.unified-case .case-global-nav .links {
  gap: clamp(7px, .8vw, 13px) !important;
}

.unified-case .case-global-nav .links a {
  padding-inline: 2px !important;
  font-size: clamp(.76rem, .7rem + .12vw, .86rem) !important;
  white-space: nowrap !important;
}

.unified-case .case-global-nav .links a[aria-current="page"] {
  color: #fff !important;
  font-weight: 800 !important;
}

.unified-case .case-global-nav .nav-separator {
  display: block;
  width: 1px;
  height: 22px;
  margin: 0 2px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .22);
}

.unified-case .case-global-nav .menu-panel {
  max-height: calc(100vh - 104px) !important;
  padding: 12px !important;
  overflow-y: auto !important;
  background: #111410 !important;
  box-shadow: 0 24px 60px rgba(17, 20, 16, .38), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  isolation: isolate;
}

.unified-case .case-global-nav .menu-panel a[aria-current="page"] {
  background: rgba(63, 80, 240, .22) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

.unified-case .case-global-nav .menu-home {
  color: #fff !important;
  font-weight: 800 !important;
}

.unified-case .case-global-nav .menu-separator {
  display: block;
  height: 1px;
  margin: 8px 8px;
  background: rgba(255, 255, 255, .16);
}

@media (max-width: 1020px) {
  #ipad-cursor {
    display: none !important;
  }

  html.has-ipad-cursor,
  html.has-ipad-cursor body,
  html.has-ipad-cursor a,
  html.has-ipad-cursor button,
  html.has-ipad-cursor summary {
    cursor: auto !important;
  }
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: 156px !important;
  }

  .unified-case .case-content > section {
    scroll-margin-top: 156px !important;
  }

  /* Dock the chapter strip beneath the floating main navigation. */
  .unified-case .section-nav {
    position: sticky !important;
    top: 90px !important;
    z-index: 990 !important;
    display: block !important;
    width: calc(100vw - 28px) !important;
    max-width: none !important;
    min-height: 52px !important;
    max-height: none !important;
    margin: 8px 0 0 calc(50% - 50vw + 14px) !important;
    padding: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 18px !important;
    background: rgba(17, 20, 16, .9) !important;
    box-shadow: 0 12px 34px rgba(17, 20, 16, .2), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 8px;
    scrollbar-width: none !important;
  }

  .unified-case .section-nav::-webkit-scrollbar {
    display: none !important;
  }

  .unified-case .section-nav > p {
    display: none !important;
  }

  .unified-case .section-nav ol {
    display: flex !important;
    width: max-content !important;
    min-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    gap: 2px !important;
    list-style: none !important;
  }

  .unified-case .section-nav li {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .unified-case .section-nav a {
    display: inline-flex !important;
    min-height: 40px !important;
    padding: 0 11px !important;
    align-items: center !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: .88rem !important;
    font-weight: 650 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .unified-case .section-nav a span {
    color: rgba(255, 255, 255, .38) !important;
    font-size: .74rem !important;
  }

  .unified-case .section-nav a:hover,
  .unified-case .section-nav a:focus-visible,
  .unified-case .section-nav a[aria-current="location"] {
    background: rgba(63, 80, 240, .22) !important;
    color: #fff !important;
    font-weight: 800 !important;
  }

  .unified-case .section-nav a[aria-current="location"] span {
    color: #aeb7ff !important;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 142px !important;
  }

  .unified-case .case-content > section {
    scroll-margin-top: 142px !important;
  }

  .unified-case .section-nav {
    top: 76px !important;
    width: calc(100vw - 20px) !important;
    margin-left: calc(50% - 50vw + 10px) !important;
  }

  /* Preserve the rounded fact cards while giving their copy a clear inset. */
  .unified-case.address-case .project-facts div,
  .unified-case.address-case .project-facts div + div,
  .unified-case.address-case .project-facts div:nth-child(3),
  .unified-case.address-case .project-facts div:nth-child(4) {
    padding: clamp(1.4rem, 5.8vw, 1.75rem) !important;
  }

  /* TravelShop outcomes stay scannable without consuming a full screen. */
  .unified-case.travelshop-case .resultsbar .rb-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 36px 20px 42px !important;
    gap: 32px 18px !important;
  }

  .unified-case.travelshop-case .resultsbar .rb-inner strong {
    margin-bottom: 8px !important;
    font-size: clamp(1.55rem, 7vw, 2rem) !important;
    line-height: 1.05 !important;
  }

  .unified-case.travelshop-case .resultsbar .rb-inner span {
    font-size: .96rem !important;
    line-height: 1.48 !important;
  }
}

@media (max-width: 560px) {
  html {
    scroll-padding-top: 136px !important;
  }

  .unified-case .case-content > section {
    scroll-margin-top: 136px !important;
  }

  .unified-case .section-nav {
    top: 74px !important;
    min-height: 50px !important;
    border-radius: 16px !important;
  }

  .unified-case .section-nav a {
    min-height: 38px !important;
    padding: 0 10px !important;
    font-size: .84rem !important;
  }

  .unified-case .section-nav a span {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .unified-case .section-nav {
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE LEGIBILITY AND TOUCH
   At 390px these ran between 11.5 and 13.8px: table cells, definition lists,
   stat labels and decision labels all carry real content, and the uppercase
   micro-labels were the smallest text on the site.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* content that happens to sit in a small component still reads at 14px */
  .unified-case .case-content :is(
    table td, table th,
    dl > div > dd, dl > div > dt,
    .case-stats span, .participant-grid > div > span,
    .flow-branch i, .flow-linear i,
    .decision-label, .matrix-legend span,
    .section-heading > span, .product-col,
    figure.said cite, figure.said cite b) {
    font-size: 0.875rem !important;   /* 14px */
    line-height: 1.5 !important;
  }

  /* uppercase micro-labels: still labels, no longer 11.5px */
  .unified-case .case-content :is(
    .system-grid > article > span,
    .evidence-panel-header > span,
    .pivot-column > span,
    .case-meta > div > span) {
    font-size: 0.8rem !important;     /* 12.8px */
    line-height: 1.4 !important;
  }

  .unified-case .case-meta > div > span,
  .unified-case .case-hero .case-meta span {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }

  /* standalone navigation links reach the 44px touch target.
     Inline links inside prose are deliberately left alone: stretching them
     would break the line box they sit in. */
  .unified-case footer .footer-links a,
  .unified-case .next-case .next-actions a,
  .unified-case .section-nav a {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
  }
}
