/* =========================================================
   Phone styles: Know Your Loads
   Loaded after css/style.css, only at max-width 768px (the link carries the
   media query), so everything here wins over the desktop and old narrow rules
   by order. Written for phones first: a tile grid, swipe decks, thumb reach,
   not the desktop layout stacked into a column. Tokens come from :root (BASE
   sets the phone values); every var() carries a fallback so this file reads
   correctly on its own. The swipe cards' distance value (--m-d) is
   written by js/m/loads.js; without it each card falls back to its resting
   state.

   1. Hero
   2. Load explorer
   3. Shared: snap carousel and its dots
   4. The Problems These Loads Create (swipe cards)
   5. What Inaction Costs (swipe cards)
   6. Now see it solved (four compact rows)
   ========================================================= */


/* =========================================================
   1. HERO
   The Services phone hero: a photo about 60% of the screen high, the heading
   and line low and left over a darker foot. The two sentences run on and
   balance themselves.
   ========================================================= */
.solution-hero {
  min-height: 0;
  text-align: left;
}

.solution-hero .header-placeholder {
  height: clamp(400px, 60svh, 560px);
  min-height: 0;
}

@supports not (height: 1svh) {
  .solution-hero .header-placeholder {
    height: clamp(400px, 60vh, 560px);
  }
}

.solution-hero .header-placeholder__overlay {
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 0 var(--gutter, 20px) 44px;
}

.solution-hero .header-placeholder__overlay::before {
  background: linear-gradient(180deg,
    rgba(4, 25, 23, 0.18) 0%,
    rgba(4, 25, 23, 0.3) 40%,
    rgba(4, 25, 23, 0.78) 100%);
}

.solution-hero .header-placeholder__overlay h1 {
  margin-bottom: 10px;
}

.solution-hero .header-placeholder__overlay p {
  max-width: 21em;
  margin: 0;
}

/* The two sentences simply run on */
.solution-hero .header-placeholder__overlay p br {
  display: none;
}


/* =========================================================
   2. LOAD EXPLORER
   600 to 768 px uses the tablet layout from style.css (a 4 x 2 grid of load
   tiles above a two-pane sheet). Below 600 px the tiles become a 2 x 4 grid
   with short names and the two panes stack in one card, the connector
   turned to point down between them.
   ========================================================= */
.loads-x {
  padding: var(--section-pad-y, 64px) var(--gutter, 20px);
}

.loads-x h2 {
  margin-bottom: 20px;
}

.loads-x__note {
  margin-top: 24px;
}

@media (max-width: 599px) {
  .loads-x__board {
    gap: 14px;
  }

  .loads-x__head {
    margin-bottom: 10px;
  }

  .loads-x__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Every tile is one line with the label centred: the four rows are equal */
  .loads-x__load {
    align-content: center;
    min-height: 52px;
    padding: 8px 10px 8px 14px;
  }

  .loads-x__load:active:not(.is-active) {
    background: color-mix(in srgb, var(--teal, #34b6af) 14%, transparent);
  }

  .loads-x__num,
  .loads-x__name {
    display: none;
  }

  .loads-x__short {
    display: block;
  }

  .loads-x__panel {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(26, 65, 70, 0.08);
  }

  .loads-x__col {
    padding: 20px 20px 22px;
  }

  .loads-x__col--fix {
    padding: 36px 20px 22px;
    border-left: 0;
    border-top: 1px solid var(--line, #bcc9c7);
    border-radius: 0 0 15px 15px;
  }

  /* The node points down, on the line between Problem and Solution */
  .loads-x__link {
    top: -16px;
    left: 50%;
    margin-left: -16px;
    transform: rotate(90deg);
  }

  /* Body copy keeps the Body tier's line height (base.css lists every
     .loads-x__item p at the Small one) */
  .loads-x__item > p {
    line-height: 1.6;
  }

  .loads-x__lead {
    gap: 14px;
    margin-bottom: 16px;
  }

  .loads-x__art {
    width: 88px;
    height: 64px;
  }

  .loads-x__icon {
    height: 30px;
  }

  .loads-x__chips {
    margin-top: 14px;
  }

  .loads-x__links a {
    min-height: 48px;
  }
}


/* =========================================================
   3. SHARED: SNAP CAROUSEL
   One pattern for the two card rows on this page: a full-bleed track, the
   card in view sits on the gutter and the next one peeks in from the right.
   --m-d is each card's distance (0 to 1) from the snapped position, so cards
   ease down and dim slightly as they leave, scroll-linked.
   ========================================================= */
.problems .problems__stack,
.inaction__grid {
  position: relative;
  display: flex;
  gap: 12px;
  max-width: none;
  width: auto;
  margin: 0 calc(-1 * var(--gutter, 20px));
  /* Room under the cards for their shadows, which the track would clip */
  padding: 24px var(--gutter, 20px) 46px;
  margin-top: -16px;
  margin-bottom: -30px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter, 20px);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.problems .problems__stack::-webkit-scrollbar,
.inaction__grid::-webkit-scrollbar {
  display: none;
}

/* Progress dots, injected by the script under each carousel. The button is
   the tap area; the dot is drawn inside it and stretches when active. */
.m-dots {
  display: flex;
  justify-content: center;
  margin-top: 0;
  color: var(--petrol, #1a4146);
}

.m-dots button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.m-dots button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.28;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.7s ease, background-color 0.7s ease;
}

.m-dots button.is-active::before {
  width: 22px;
  opacity: 1;
  background: var(--orange, #ff8c40);
}

.m-dots button:focus-visible {
  outline: 2px solid var(--teal, #34b6af);
  outline-offset: -4px;
  border-radius: 8px;
}


/* =========================================================
   4. THE PROBLEMS THESE LOADS CREATE
   The desktop petrol cards (style.css) in a swipe row on the cream section,
   each about 85% of the screen so the next one peeks in. The number sits top
   right and the drawing top left, as on the Home deck.
   ========================================================= */
.problems {
  text-align: left;
}

.problems .problems__sticky {
  padding: var(--section-pad-y, 64px) 0 calc(var(--section-pad-y, 64px) - 14px);
  overflow: visible;
}

.problems h2 {
  margin-bottom: 20px;
}

.problems .problems__stack .problem-card {
  flex: 0 0 min(85%, 340px);
  gap: 16px;
  padding: 22px 22px 26px;
  box-shadow: 0 12px 24px rgba(26, 65, 70, 0.22);
  transform: none;
  opacity: calc(1 - var(--m-d, 0) * 0.32);
  scale: calc(1 - var(--m-d, 0) * 0.045);
  transition: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.problems .problems__stack .problem-card__icon {
  --h: 72;
}

.problems .problems__stack .problem-card__num {
  top: 26px;
  right: 22px;
}

/* Icons: the card in view draws its icon (data-m-front, set by the script).
   Without it every icon rests fully drawn. */
@media (prefers-reduced-motion: no-preference) {
  .problems.m-swipe .problem-card[data-m-front] .anim-draw-wave { animation: pqDraw 1.6s cubic-bezier(0.35, 0, 0.5, 1) both; }

  .problems.m-swipe .problem-card[data-m-front] .anim-dial   { animation: pqDraw 1.2s cubic-bezier(0.4, 0, 0.55, 1) both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-band   { animation: pqFadeIn 0.3s ease-out 1.05s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick   { animation: pqPopIn 0.25s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick-1 { animation-delay: 0.08s; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick-2 { animation-delay: 0.34s; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick-3 { animation-delay: 0.6s; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick-4 { animation-delay: 0.86s; }
  .problems.m-swipe .problem-card[data-m-front] .anim-tick-5 { animation-delay: 1.1s; }
  .problems.m-swipe .problem-card[data-m-front] .anim-hub    { animation: pqPopIn 0.3s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-needle { animation: pqExtend 1s cubic-bezier(0.25, 1.15, 0.4, 1) 0.15s both; }

  .problems.m-swipe .problem-card[data-m-front] .anim-origin { animation: pqPopIn 0.3s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-h      { animation: pqStretch 0.55s cubic-bezier(0.3, 0, 0.4, 1) 0.1s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-h-head { animation: pqFadeIn 0.2s ease-out 0.6s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-swing  { animation: pqSwingUp 0.5s cubic-bezier(0.35, 0, 0.3, 1.1) 0.7s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-d-head { animation: pqFadeIn 0.2s ease-out 1.15s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-pf-arc { animation: pqDraw 0.4s ease-out 1.1s both; }
  .problems.m-swipe .problem-card[data-m-front] .anim-phi    { animation: pqPopIn 0.3s cubic-bezier(0.3, 1.5, 0.6, 1) 1.3s both; }
}


/* =========================================================
   5. WHAT INACTION COSTS
   The desktop full-photo cards (style.css) in a swipe row, each about 80% of
   the screen. The section is ivory, like the desktop one, between the cream
   Problems and the cream "Now see it solved".
   ========================================================= */
.inaction {
  padding: var(--section-pad-y, 64px) var(--gutter, 20px) calc(var(--section-pad-y, 64px) - 14px);
  text-align: left;
}

.inaction__inner > p {
  margin-bottom: 24px;
}

.inaction-card {
  flex: 0 0 min(80%, 320px);
  aspect-ratio: 4 / 5;
  max-height: 440px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scale: calc(1 - var(--m-d, 0) * 0.045);
  opacity: calc(1 - var(--m-d, 0) * 0.32);
}

.inaction-card__row {
  padding: 0 20px 8px;
}

.inaction-card__tag {
  top: 16px;
  left: 16px;
}

.inaction-card p {
  padding: 0 20px 22px;
}


/* =========================================================
   6. NOW SEE IT SOLVED (match the fix)
   One column: the line, four compact rows, then the way in. The copy block
   is dissolved (display: contents) so the button can close the section
   under the rows. Each row is a whole-card link: the tag, the title with
   its Explore arrow beside it, then the text.
   ========================================================= */
.pq-entry {
  padding: var(--section-pad-y, 64px) var(--gutter, 20px) calc(var(--section-pad-y, 64px) - 8px);
}

.pq-entry__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.pq-entry__copy {
  display: contents;
}

.pq-entry__eyebrow {
  order: 0;
  margin-bottom: 10px;
}

.pq-entry h2 {
  order: 1;
  margin-bottom: 12px;
}

.pq-entry__lead {
  order: 2;
  margin-bottom: 0;
}

.pq-entry__cards {
  order: 3;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 28px 0 28px;
}

.pq-entry__cta {
  order: 4;
  align-self: stretch;
  min-height: 56px;
  box-shadow: 0 16px 34px rgba(255, 140, 64, 0.28);
}

.pq-entry .glimpse {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  padding: 14px 16px 16px;
  border-radius: 9px;
  -webkit-tap-highlight-color: transparent;
}

/* No hover lift on touch; a press tints the card */
.pq-entry .glimpse:hover {
  transform: none;
  box-shadow: none;
  border-color: #a6cdd3;
}

.pq-entry .glimpse:active {
  border-color: var(--teal, #34b6af);
  background: color-mix(in srgb, var(--teal, #34b6af) 8%, var(--ivory-card, #fffefa));
}

.pq-entry .glimpse:hover h3 {
  transform: none;
}

.pq-entry .glimpse__tag {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.pq-entry .glimpse h3 {
  grid-column: 1;
  margin: 0;
  padding-bottom: 0;
}

.pq-entry .glimpse h3::after {
  display: none;
}

.pq-entry .glimpse__go {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  padding: 0;
  border: 0;
}

.pq-entry .glimpse p {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  line-height: 1.5;
}


/* Reduced motion: no scale or dimming on the swipe cards */
@media (prefers-reduced-motion: reduce) {
  .problems .problems__stack .problem-card,
  .inaction-card {
    scale: none;
    opacity: 1;
  }
}
