/* Pill case study only: reuse the approved project, gallery and FAQ patterns. */
.pill-page .project-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pill-page .pill-partner-link { display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; }
/* Scale the children, not their parent: keep the logo blending into the banner. */
.pill-page .pill-partner-link :is(img, span) { transform-origin: left center; transition: transform .2s ease; }
.pill-page .pill-partner-link:is(:hover, :focus-visible) :is(img, span) { transform: scale(1.04); }
.pill-page .pill-partner-link img { display: block; flex: none; width: 72px; height: 48px; object-fit: contain; background: transparent; filter: invert(1); mix-blend-mode: screen; }
.pill-page .pill-partner-link:hover span { color: var(--hover-solid); }
.pill-page .project-lead-image > a { display: block; min-height: 0; height: 100%; }
.pill-page .project-intro-copy .pill-role { margin-top: 16px; max-width: 540px; }
.pill-page .pill-role strong { display: block; margin-bottom: 8px; font-weight: 600; }
.pill-page .pill-role strong a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pill-page .chapter-heading strong { font-weight: 600; }
.pill-page .pill-survey-grid { display: grid; grid-template-columns: minmax(0, .5621fr) minmax(0, .7382fr); gap: 24px; max-width: 960px; margin-inline: auto; align-items: start; }
.pill-page .pill-figure { min-width: 0; margin: 0; }
.pill-page .pill-figure a { display: block; text-decoration: none; }
.pill-page .pill-figure img { display: block; width: 100%; height: auto; }
.pill-page .pill-design-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 48px; align-items: stretch; }
.pill-page .pill-design-grid > .pill-figure { align-self: end; }
.pill-page .pill-visualisations { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.pill-page .pill-figure figcaption { margin: 8px 0 0; letter-spacing: 0; font-style: normal; text-align: left; }
/* Trim only the elevation sheet's trailing blank paper; retain every blue note. */
.pill-page #planning-drawings .pill-figure > a { aspect-ratio: 2590 / 1300; overflow: hidden; }
.pill-page #planning-drawings .pill-figure img { max-height: none; }
/* Same shared dark viewer, image sizing and arrows as Eco/Bathrooms projects. */
.pill-page dialog.pill-lightbox { margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; box-sizing: border-box; background: transparent; }
.pill-page dialog.pill-lightbox:not([open]) { display: none; }
.pill-page dialog.pill-lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.pill-page .pill-lightbox .project-lightbox-image { background: transparent; }
.pill-page .pill-lightbox .project-lightbox-image.is-drawing { background: white; }
.pill-page .pill-note { margin-top: 24px; }
.pill-page main section { scroll-margin-top: var(--project-masthead-height); }
.pill-page #process .process-step.is-selected { border: 1px solid var(--hover-solid); background: var(--g5-color-selection, #FFF8ED); }
.pill-page #planning-package .wf-package { border-radius: 24px; }
.pill-page #planning-package .wf-package-light { background: var(--g5-color-selection, #FFF8ED); color: var(--heading); }
.pill-page #planning-package .wf-package li { line-height: 1.6; margin-bottom: 12px; }
.pill-page #planning-package .wf-package-grid { margin-top: 32px; }
.pill-page #pill-faq .wf-faq { max-width: none; display: grid; gap: 16px; padding: 32px; background: transparent; }
.pill-page #pill-faq details { min-width: 0; padding: 0; border: 1px solid var(--g5-color-border, #949895); border-radius: 24px; background: white; transition: border-color .15s ease; }
.pill-page #pill-faq summary { min-height: 44px; box-sizing: border-box; align-items: center; padding: 12px 16px; border-radius: 24px; font-weight: 400; }
.pill-page #pill-faq summary::-webkit-details-marker { display: none; }
.pill-page #pill-faq summary::after { color: var(--text); flex: none; }
.pill-page #pill-faq details:is(:hover, [open], :focus-within) { border-color: var(--hover-solid); }
.pill-page #pill-faq details:is(:hover, [open]) summary::after { color: var(--hover-solid); }
.pill-page #pill-faq details > div { max-width: none; padding: 0 16px 16px; }
.pill-page #pill-faq .wf-faq p { max-width: 1050px; }
.pill-page :is([data-image-preview], summary):focus-visible { outline: 2px solid var(--hover-solid); outline-offset: 4px; }
.pill-page .pill-enquiry { background: var(--g5-color-stone, #F2F0EB); color: var(--text); }
.pill-page .pill-enquiry > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.pill-page .pill-enquiry h2 { color: var(--heading); border-bottom-color: var(--rule); }
.pill-page .pill-enquiry p { max-width: 750px; }
.pill-page .pill-enquiry .btn { flex: none; color: var(--heading); }
/* Document-folder headings: preserve flow and match the scroll exactly.
   Only folded strips are links; expanded decorative copies are inert. */
.pill-page.pill-has-document-stack #survey { padding-top: 8px; }
.pill-page.pill-has-document-stack .chapter-heading { overflow-anchor: none; }
.pill-page .pill-document-anchor { display: block; height: 0; margin: 0; padding: 0; pointer-events: none; }
/* Bridge the native-to-copy handover in the browser's scroll compositor.
   Match the copy's 8px label inset; never let the original pass under the menu. */
.pill-page.pill-has-document-stack .chapter-heading:not(.is-document-pinned) { position: sticky; top: calc(var(--project-masthead-height) + var(--pill-document-offset, 0px) + 8px - var(--pill-heading-label-inset, 0px)); background: var(--background, white); }
.pill-page .project-chapter .chapter-heading { grid-template-columns: 96px minmax(300px, .8fr) minmax(300px, .7fr); gap: 16px; }
.pill-page :is(.chapter-number, .pill-document-number) { display: inline-flex; align-items: flex-start; gap: 8px; }
.pill-page :is(.chapter-number, .pill-document-number)::before { content: 'Stage'; font-size: var(--g5-type-12, 12px); font-weight: 400; line-height: 1; }
.pill-page .pill-document-measure { position: fixed; top: 0; left: 0; visibility: hidden; pointer-events: none; margin: 0; }
.pill-page .pill-document-measure.pill-document-label { display: block; }
.pill-page .pill-document-stack { position: fixed; inset-inline: 0; top: var(--project-masthead-height); z-index: 50; overflow: hidden; }
.pill-page .pill-document-stack[hidden], .pill-page .pill-document-tab[hidden] { display: none; }
.pill-page .pill-document-tab { display: block; position: relative; isolation: isolate; box-sizing: border-box; overflow: hidden; color: inherit; text-decoration: none; background: var(--background, white); border: 0; pointer-events: none; }
.pill-page .pill-document-tab.is-document-collapsed { pointer-events: auto; cursor: pointer; background: var(--g5-color-stone, #F2F0EB); }
.pill-page .pill-document-tab.is-document-collapsed:is(:hover, :focus-visible) { background: var(--g5-color-selection, #FFF8ED); }
.pill-page .pill-document-tab:focus-visible { outline: 2px solid var(--hover-solid); outline-offset: -2px; }
.pill-page .pill-document-tab-inner { position: relative; height: 100%; }
.pill-page .pill-document-tab :is(.pill-document-number, .pill-document-label, .pill-document-title) { position: absolute; margin: 0; transform-origin: top left; }
.pill-page .pill-document-tab :is(.pill-document-number, .pill-document-label) { z-index: 1; }
.pill-page .pill-document-title { transition: none; }
.pill-page .pill-document-tab.is-document-collapsed .pill-document-title { display: none; }
.pill-page .pill-document-rule { position: absolute; bottom: 0; height: 1px; background: var(--rule); pointer-events: none; }
.pill-page .pill-document-title strong { font-weight: 600; }
.pill-page .chapter-heading.is-document-pinned > :is(.chapter-number, div) { opacity: 0; }
.pill-page.pill-has-document-stack main section { scroll-margin-top: calc(var(--project-masthead-height) + var(--pill-document-offset, 0px)); }
@media (prefers-reduced-motion: reduce) {
  .pill-page :is(.pill-document-tab, .pill-document-title) { transition: none; }
}
@media print {
  .pill-page .pill-document-stack { display: none; }
  .pill-page.pill-has-document-stack .chapter-heading:not(.is-document-pinned) { position: static; }
  .pill-page .chapter-heading.is-document-pinned > :is(.chapter-number, div) { opacity: 1; }
  .pill-page .chapter-heading > p { opacity: 1 !important; }
}
@media (min-width: 1101px) {
  .pill-page .chapter-heading h2 { margin-bottom: 0; }
  .pill-page .chapter-heading > div { align-self: end; }
  .pill-page .chapter-heading > p { align-self: end; margin: 0; }
  .pill-page #process .process-step { border: 1px solid transparent; border-radius: 12px; padding: 42px 12px 12px; }
  .pill-page #process .process-step::before { top: 6px; left: 12px; }
  .pill-page #process .process-step.is-selected { border-color: var(--hover-solid); }
}
@media (max-width: 1100px) {
  html body.pill-page .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill-page .pill-design-grid { gap: 32px; }
  .pill-page .project-chapter .chapter-heading { grid-template-columns: 96px minmax(0, 1fr); gap: 24px; }
  .pill-page .chapter-heading > p { grid-column: 2; margin: 0; }
}
@media (min-width: 601px) and (max-width: 1100px) and (min-height: 501px) {
  .pill-page #pill-faq summary { min-height: 48px; font-size: 14px; }
  html body.pill-page .project-facts > div { border: 0; }
  html body.pill-page .project-facts > div:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.2); }
  html body.pill-page .project-facts > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.2); }
}
@media (max-width: 860px) {
  .pill-page .pill-design-grid { grid-template-columns: minmax(0, 1fr); }
  .pill-page .pill-design-grid > .pill-figure { max-width: 640px; margin-inline: auto; }
  .pill-page .pill-visualisations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pill-page .pill-enquiry > .wrap { flex-direction: column; align-items: flex-start; gap: 24px; }
}
@media (max-width: 600px), (max-width: 1100px) and (max-height: 500px) and (orientation: landscape) {
  .pill-page .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill-page .project-chapter .chapter-heading { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .pill-page .pill-survey-grid { gap: 16px; }
  .pill-page .pill-partner-link { gap: 8px; }
  .pill-page .pill-partner-link img { width: 60px; height: 40px; }
  .pill-page .pill-visualisations { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pill-page #pill-faq .wf-faq { padding: 0; gap: 12px; }
  .pill-page #pill-faq summary { font-size: var(--g5-phone-body-size); line-height: 1.5; }
  .pill-page .pill-role strong { margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .pill-page .pill-partner-link :is(img, span) { transition: none; }
  .pill-page #pill-faq details { transition: none; }
}
