/* Scrub! service pages: the first window, the broken wall of facts, the visit ruler and the way on */

/* One tighter rhythm for every band on these pages */
.body--service { --storey: clamp(1.5rem, 4vh, 2.75rem); }

/* First window */
.front--room { display: grid; grid-template-areas: "words" "frame" "plan"; gap: 1rem; padding-block: clamp(.5rem, 2vh, 1.5rem) var(--storey); }
.front--words { grid-area: words; min-width: 0; }
.front--frame { grid-area: frame; align-self: start; padding: calc(var(--corner-arm) * .6); }
.front--frame a { display: block; }
.front--frame img { height: auto; aspect-ratio: 4 / 3; max-height: 62vh; }
.front--kind { margin: .5rem 0 0; font: 500 1.0625rem var(--plan-lettering); }
.front--back { margin: .8rem 0 0; font-size: 1.0625rem; }
.locate--plan { grid-area: plan; width: min(100%, 14rem); }
.locate--plan .hall--plan { height: auto; aspect-ratio: 170 / 150; }
.locate--name { font: 1rem var(--pen-text); fill: var(--petrol); }
.locate--name[data-here] { fill: var(--biro); font-weight: 700; }
.locate--door a { cursor: pointer; }
.locate--door a:hover .locate--name { text-decoration: underline; fill: var(--biro); }
.locate--door:has(a:hover) .hall--swing { opacity: .6; }
.locate--hit { fill: transparent; }

/* The broken wall of facts */
.wall--band .room--head { max-width: 30ch; }
.wall--run { display: grid; grid-template-areas: "words" "facts"; gap: 1.2rem; }
.wall--words { grid-area: words; max-width: 40rem; }
.wall--quote { font-size: 1.1875rem; }
.wall--facts { grid-area: facts; margin: 0; }
.wall--row { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr); gap: .2rem 1rem; padding: .8rem 0 .7rem; background: repeating-linear-gradient(90deg, var(--petrol) 0 2.5rem, transparent 2.5rem 3.1rem) 0 0 / 100% var(--corner-weight) no-repeat; font-size: 1.0625rem; }
.wall--row dt { font: 500 1rem/1.35 var(--plan-lettering); }
.wall--row dd { margin: 0; }

/* Standard Clean branches */
.branch--list { margin: 0; padding: 0 0 0 1.2rem; list-style: none; border-left: var(--baseboard) solid var(--petrol); }
.branch--list li { --branch-step: 0rem; position: relative; margin-left: var(--branch-step); padding: .5rem 0 .5rem 1rem; }
.branch--list li:nth-child(2) { --branch-step: .75rem; }
.branch--list li:nth-child(3) { --branch-step: 1.5rem; }
.branch--list li::before { content: ""; position: absolute; top: 1.55rem; left: calc(-1.2rem - var(--branch-step)); width: calc(1.2rem + var(--branch-step)); height: var(--corner-weight); background: var(--petrol); }
.branch--list h3 { margin: 0; }
.branch--list h3 a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.branch--list p { margin: 0; max-width: 34rem; }

/* Visit ruler: every week is a doorway drawn as on a plan, leaf and swing, standing on the baseboard; the visits are the open doors in biro */
.visit--intro { min-width: 0; }
.visit--note { margin: .4rem 0 0; max-width: 38rem; font-size: 1.125rem; }
.visit--lines { min-width: 0; }
.visit--line { margin: 1.4rem 0 0; }
.visit--weeks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: .9rem; margin: 0; padding: 0; list-style: none; }
.visit--weeks li { display: grid; grid-template-rows: auto auto; row-gap: .3rem; justify-items: center; border-bottom: var(--baseboard) solid var(--petrol); font: 500 1.0625rem/1.4 var(--plan-lettering); }
.visit--weeks li::after { content: ""; align-self: end; box-sizing: border-box; width: min(82%, 5.5rem); aspect-ratio: 1; border: dashed var(--petrol); border-width: .125rem .125rem 0 0; border-radius: 0 100% 0 0; background: linear-gradient(var(--petrol), var(--petrol)) 0 0 / .1875rem 100% no-repeat; }
.visit--weeks li[data-state="visit"] { color: var(--biro); font-weight: 700; }
.visit--weeks li[data-state="visit"]::after { border-color: var(--biro); border-width: .1875rem .1875rem 0 0; background: linear-gradient(var(--biro), var(--biro)) 0 0 / .375rem 100% no-repeat var(--receipt); }
.visit--caption { margin-top: .8rem; font: 500 clamp(1.375rem, 1.05rem + 1.4vw, 2.125rem)/1.25 var(--plan-lettering); }

/* Close: the call, and the two other doors with their pictures */
.close--run { display: grid; grid-template-areas: "words" "doors"; gap: 1.4rem; }
.close--words { grid-area: words; }
.close--return { max-width: 34rem; font-size: 1.25rem; line-height: 1.45; }
.close--call { --corner-arm: 1.25rem; --corner-weight: .1875rem; display: flex; justify-content: center; box-sizing: border-box; width: 100%; min-height: 4.5rem; padding: 1rem 1.3rem; font-size: clamp(1.25rem, 1rem + .7vw, 1.5rem); text-align: center; }
.close--doors { grid-area: doors; display: grid; gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.close--doors li { min-width: 0; }
.close--picture img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.close--doors h3 { margin: .4rem 0 0; }
.close--doors h3 a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.close--doors p { margin: 0; }

/* Picture opened large */
.loupe--dialog { max-width: min(96vw, 70rem); max-height: 94vh; padding: .75rem; border: 0; background: var(--washed-window); color: var(--petrol); }
.loupe--dialog::backdrop { background: rgba(10, 44, 63, .72); }
.loupe--dialog img { display: block; width: auto; max-width: 100%; height: auto; max-height: 72vh; margin-inline: auto; object-fit: contain; }
.loupe--close { margin-top: .8rem; border: 0; background-color: transparent; cursor: pointer; }

@media (min-width: 48rem) {
  .front--room { grid-template-areas: "words frame" "plan frame"; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; column-gap: clamp(1.5rem, 3vw, 3rem); align-items: start; padding-bottom: .5rem; }
  .front--frame img { aspect-ratio: 3 / 2; }
  .locate--plan { align-self: end; }
  .wall--run { grid-template-areas: "words facts"; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: clamp(1.5rem, 4vw, 4rem); }
  .branch--list li:nth-child(2) { --branch-step: 2rem; }
  .branch--list li:nth-child(3) { --branch-step: 4rem; }
  .visit--weeks { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: 0; }
  .visit--weeks li { font-size: 1.125rem; }
  .close--run { grid-template-areas: "words doors"; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); column-gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
  .close--call { min-height: clamp(6rem, 20vh, 10rem); }
  .close--doors { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .loupe--dialog { transition: none; }
}
