/* Service area: opening tweaks, "Street to sink" set piece, Homes and Businesses passages. */

/* Section rhythm on this page: half the shared gap, so the page does not drift. */
.page-area .section { padding-block: calc(var(--sect) / 2); }

.opening--side { --opening-used: 19rem; padding-top: .5rem; padding-bottom: calc(var(--sect) / 2); }
.opening .pair, .passage .pair { margin-top: .5rem; }
.farend .pair { font-size: 1rem; line-height: 1.4; }
.farend .pair p:last-child { margin: 0; }

/* Pair markers: the same on every figure of this page, whatever state the script has reached
   and whatever the motion setting: "You notice" filled, "A plumber checks" hollow. */
.page-area .farend .pair .pair__item:first-child .pair__label::before { background: var(--mint); box-shadow: none; }
.page-area .farend .pair .pair__item:last-child .pair__label::before { background: none; box-shadow: inset 0 0 0 .14rem var(--ink-dim); }

/* Where we work: sits in the opening, under the lead on desk, after the picture on a phone */
.area { display: grid; gap: 1rem; justify-items: start; max-width: 36rem; }
.area h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1; letter-spacing: -.01em; }
.area h2.paint { padding: 1rem 1.5rem; }
.area__copy p { font-size: 1.125rem; }
@media (min-width: 56rem) {
  .opening--side { grid-template-rows: auto 1fr; }
  .opening--side .opening__text { grid-column: 1; grid-row: 1; }
  .opening--side .farend { grid-column: 2; grid-row: 1 / span 2; }
  .opening--side .area { grid-column: 1; grid-row: 2; margin-top: .5rem; }
}

/* STREET TO SINK: mobile first, the line runs down the left */
.street h2 { margin-bottom: .6rem; }
.street__intro { max-width: 44rem; margin-bottom: var(--gap); }
.street__map { display: grid; grid-template-columns: 5rem 1fr; column-gap: .75rem; }
.street__plot { position: relative; isolation: isolate; height: 21rem; }
.street__plot::before {
  content: ""; position: absolute; z-index: -1; inset: 1% 10% 1% -10%;
  background: var(--mulberry); border-radius: var(--blob-a);
}
.street__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.street__svg--h { display: none; }
.street__line { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; stroke-linecap: butt; vector-effect: non-scaling-stroke; }
.street__ground { fill: none; stroke: var(--ink-dim); stroke-width: 2; stroke-dasharray: 6 8; vector-effect: non-scaling-stroke; }
.street__mark {
  position: absolute; width: 2.1rem; height: 2.1rem; background: var(--mint);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  transform: translate(-50%, -50%);
}
[data-i="0"] .street__mark { left: 18%; top: 8.33%; }
[data-i="1"] .street__mark { left: 32%; top: 25%; }
[data-i="2"] .street__mark { left: 50%; top: 41.67%; }
[data-i="3"] .street__mark { left: 86%; top: 58.33%; }
[data-i="4"] .street__mark { left: 56%; top: 75%; }
[data-i="5"] .street__mark { left: 24%; top: 91.67%; }

.street__stops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(6, 3.5rem); }
.street__stops li { height: 3.5rem; }
.street__stops button {
  display: flex; align-items: center; width: 100%; height: 100%; padding: 0 .25rem;
  background: none; border: 0; border-radius: 0; cursor: pointer;
  color: var(--ink); font: 800 1.5rem/1 var(--display); text-align: left;
}
.street__stops button:hover { text-decoration: underline; text-decoration-thickness: .09em; text-underline-offset: .2em; }
.street__stops button[aria-current="true"] { color: var(--mint); text-decoration: underline; text-decoration-thickness: .16em; text-underline-offset: .2em; }

.street__says { list-style: none; margin: var(--gap) 0 0; padding: 0; display: grid; }
.street__says li { max-width: 46rem; font-size: 1.1875rem; line-height: 1.45; margin-bottom: .6rem; }
.js .street__says li { grid-area: 1 / 1; margin: 0; visibility: hidden; }
.js .street__says li.is-on { visibility: visible; }
.street__ctl { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.75rem; margin-top: .75rem; }
.street__count { font-size: 1rem; color: var(--ink-dim); min-width: 6.5rem; }
html:not(.js) .street__ctl, html:not(.js) .street__stops button { pointer-events: none; }
html:not(.js) .street__ctl { display: none; }

@media (min-width: 48rem) {
  .street__map { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .street__plot { height: 15rem; }
  /* The blob covers the whole run: it reaches past both ends of the pipe line and the dashed rule. */
  .street__plot::before { inset: -1rem -1rem -1.25rem -1rem; border-radius: var(--blob-b); }
  .street__svg--v { display: none; }
  .street__svg--h { display: block; }
  .street__mark { width: 2.75rem; height: 2.75rem; }
  .street__stops { grid-template-rows: none; grid-template-columns: repeat(6, 1fr); }
  .street__stops li { height: var(--line); }
  .street__stops button { justify-content: center; text-align: center; font-size: 1.625rem; }
  [data-i="0"] .street__mark { left: 8.33%; top: 81%; }
  [data-i="1"] .street__mark { left: 25%; top: 70%; }
  [data-i="2"] .street__mark { left: 41.67%; top: 52.5%; }
  [data-i="3"] .street__mark { left: 58.33%; top: 18.75%; }
  [data-i="4"] .street__mark { left: 75%; top: 56.25%; }
  [data-i="5"] .street__mark { left: 91.67%; top: 87.5%; }
  .street__says li { font-size: 1.375rem; }
}

/* PASSAGES */
.passage { align-items: center; }
.passage h2 { display: inline-block; margin-bottom: 1.25rem; }
.passage p { max-width: 40rem; }
.passage .farend__blob { width: fit-content; max-width: 100%; }
.passage .farend__blob img { width: auto; max-width: 100%; max-height: 32rem; }
.passage .farend { justify-items: start; }
@media (min-width: 56rem) {
  .passage--rev .farend { justify-items: end; }
}

/* HAND-OFF */
.handoff h2 { margin-bottom: .25rem; }
.handoff p { max-width: 36rem; }
.handoff__links { align-items: center; }
.handoff .link { font-size: 1.125rem; }
