/* The service pages' shared flow (sp-*): option A of the cold Mercury
   review, built for Websites (Lane G - Websites page, 11-01, issue #8;
   Business: "Agree Q1–Q3") and shared from Brand Identity on
   (Lane B - Brand Identity page, 11-02, issue #10; Business:
   "Agree Q1–Q5"). Only what Home's flow.css doesn't already give. Plain
   labeled shapes, no art and no motion. */

/* 1. Hero: centered words, then one wide shape that starts in the first
   screen. */
.sp-hero.jh-section { padding-top: var(--space-72); }
.sp-hero-words { display: grid; justify-items: center; text-align: center; }
.sp-hero .jh-h1 { max-width: 20ch; text-wrap: balance; }
.sp-hero .jh-lead { margin-inline: auto; text-wrap: balance; }
.sp-hero-shape { --ph-ratio: 16 / 9; margin-top: var(--space-56); }

/* A row: one large shape beside its words, the shape on the side named by
   data-side (Mercury's feature rows). */
.sp-row { display: grid; grid-template-columns: 11fr 9fr; gap: var(--space-72); align-items: center; }
.sp-row[data-side="right"] { grid-template-columns: 9fr 11fr; }
.sp-row[data-side="right"] .sp-row-shape { order: 2; }
.sp-row + .sp-row { margin-top: var(--space-112); }
.sp-row-shape { --ph-ratio: 4 / 3; }
.sp-row-words { display: grid; gap: var(--space-24); align-content: center; }
.sp-row-words > * { margin: 0; }
.sp-row-words .jh-lead { max-width: 26rem; }

/* 2. The self-check: a 4:5 shape; the heading and its questions together,
   in the middle of the shape's height (JH Review 1, A13: the heading at
   the top and the questions at the bottom left about 150 px of nothing
   between them). */
.sp-row--check { align-items: stretch; }
.sp-row--check .sp-row-shape { --ph-ratio: 4 / 5; }
.sp-row--check .sp-row-words { align-content: center; gap: var(--space-40); }
.sp-row-head { display: grid; gap: var(--space-20); }
.sp-row-head > * { margin: 0; }
.sp-questions { margin: 0; padding: 0; list-style: none; border-top: var(--stroke-hairline) solid var(--line); }
.sp-questions > li {
  padding-block: var(--space-24); border-bottom: var(--stroke-hairline) solid var(--line);
  font-family: var(--font-display); font-size: var(--text-heading-sm); line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading); font-weight: var(--weight-display); text-wrap: balance;
}

/* 4. What you get: a tall shape beside the ruled list. */
.sp-row--get { align-items: stretch; }
.sp-row--get .sp-row-shape { aspect-ratio: auto; min-height: 440px; }
.sp-row--get .sp-row-words { align-content: center; gap: var(--space-32); }
.sp-get > li { padding-block: var(--space-24); font-size: var(--text-lead); line-height: var(--leading-body); text-wrap: pretty; }

/* Cards: a shape on top, then a title and one muted line. */
.sp-cards { display: grid; gap: var(--space-40); margin: 0; padding: 0; list-style: none; }
.sp-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-card { display: grid; gap: var(--space-12); align-content: start; }
.sp-card .jh-ph { --ph-ratio: 3 / 2; margin-bottom: var(--space-12); }
.sp-card .jh-h3, .sp-card p { margin: 0; }
.sp-card p { color: var(--text-muted); }
.sp-card--link { color: inherit; text-decoration: none; }
.sp-card--link .jh-link { margin-top: var(--space-8); }

/* 5. The note under the steps. */
.sp-note { margin: var(--space-40) 0 0; color: var(--text-muted); }

/* 6. The statement: light, centered, with room around it. */
.sp-statement .jh-wrap { padding-bottom: var(--space-40); }

@media (max-width: 899px) {
  .sp-row, .sp-row[data-side="right"] { grid-template-columns: 1fr; gap: var(--space-32); }
  .sp-row[data-side="right"] .sp-row-shape { order: 0; }
  .sp-row + .sp-row { margin-top: var(--space-72); }
  .sp-row--check .sp-row-shape { --ph-ratio: 4 / 3; }
  .sp-row--get .sp-row-shape { aspect-ratio: 16 / 10; min-height: 0; }
}
@media (max-width: 699px) {
  .sp-hero.jh-section { padding-top: var(--space-40); }
  .sp-hero-shape { --ph-ratio: 4 / 5; margin-top: var(--space-40); }
  .sp-row + .sp-row { margin-top: var(--space-56); }
  .sp-questions > li { padding-block: var(--space-20); }
  .sp-get > li { padding-block: var(--space-20); }
  .sp-cards--3, .sp-cards--2 { grid-template-columns: 1fr; }
}

/* Option B's parts (Brand Identity, Lane B, 11-02; Business:
   "Agree Q1–Q3"). New classes only, so the Websites page is unchanged. */

/* A split hero: the words on the left, one tall shape on the right. */
.sp-hero--split .jh-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-72); align-items: center; }
.sp-hero--split .sp-hero-words { justify-items: start; text-align: left; }
.sp-hero--split .jh-lead { margin-inline: 0; }
.sp-hero--split .sp-hero-shape { --ph-ratio: 4 / 5; width: min(100%, 34rem); margin-top: 0; justify-self: end; }

/* Outcomes as cards: a 4:3 shape on top. */
.sp-cards--outcomes .jh-ph { --ph-ratio: 4 / 3; }

/* The one dark band: the steps as a ruled list beside a tall shape. The
   light band after it starts without its rule. */
.sp-dark + .jh-band > .jh-wrap { padding-top: 0; border-top: 0; }
.sp-row--steps { align-items: stretch; }
.sp-row--steps .sp-row-shape { --ph-ratio: 4 / 5; }
.sp-row--steps .sp-row-words { align-content: center; gap: var(--space-32); }
.sp-steps { margin: 0; padding: 0; list-style: none; border-top: var(--stroke-hairline) solid var(--line); }
.sp-steps > li {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: var(--space-16); row-gap: var(--space-8);
  padding-block: var(--space-24); border-bottom: var(--stroke-hairline) solid var(--line);
}
.sp-steps .jh-how-number { grid-row: span 2; }
.sp-steps .jh-h3, .sp-steps p { grid-column: 2; margin: 0; }
.sp-steps p { color: var(--text-muted); }
.sp-row--steps .sp-note { margin: 0; }

/* A list row whose shape follows the list's height (3:2). */
.sp-row--list .sp-row-shape { --ph-ratio: 3 / 2; }

/* The headline at desktop (JH Review 1, A3: at the display size in a 5/12
   column the eight headlines ran 3 to 5 lines). The words take a little
   over half the row and the headline tops out at 60 px, so each runs 2 or
   3 lines and "follow-ups" stays on one line (a larger size broke it at
   its hyphen). The picture's column is 11/24 of the row, so the picture is
   a little smaller than before. One column (below 900 px) keeps the
   display size. */
@media (min-width: 900px) {
  .sp-hero--split .jh-wrap { grid-template-columns: minmax(0, 13fr) minmax(0, 11fr); }
  .sp-hero--split .jh-h1 { font-size: clamp(40px, min(4.4vw, 10vh), 60px); }
}
@media (max-width: 899px) {
  .sp-hero--split .jh-wrap { grid-template-columns: 1fr; gap: var(--space-40); }
  .sp-hero--split .sp-hero-shape { width: 100%; justify-self: stretch; }
  .sp-row--steps .sp-row-shape { --ph-ratio: 4 / 3; }
}
@media (max-width: 699px) {
  .sp-hero--split .sp-hero-shape { margin-top: 0; }
  .sp-steps > li { padding-block: var(--space-20); }
}

/* Phones and tablets (JH Review 1, A6): the service pages' sections sit a
   step closer, 56 a side up to 520 px (was 72) and 72 from 521 to 900 (was
   96). Set on each section, as Home sets its own (index.astro, #127), so
   the hairline's space and the closing band follow it; wider screens keep
   160, and Home and the other pages are unchanged. */
@media (max-width: 900px) { main > .jh-section { --section-space: var(--space-72); } }
@media (max-width: 520px) { main > .jh-section { --section-space: var(--space-56); } }
