/* Book a call in the Signature design (docs/SIGNATURE-PAGES.md). The form's own markup is EnquiryForm's and is not
   changed: everything here is the page around it and the card it sits in. */
html[data-look="signature"]{
  /* Heading and the ways to reach us on the left, the form on the right. In the HTML the form comes second, so on a
     phone it follows the heading directly. */
  .ct-top{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-areas:"intro form" "aside form" "photo form";grid-template-rows:auto auto minmax(0,1fr);column-gap:clamp(2rem,5vw,5rem);row-gap:3rem;--ct-pad:clamp(2.5rem,5vw,4.5rem);padding-block:var(--ct-pad) clamp(3.5rem,6vw,5.5rem)}
  .ct-intro{grid-area:intro}
  .ct-form{grid-area:form}
  .ct-aside{grid-area:aside}
  /* The closing panel's photo fills the rest of the column beside the form, cropped as the closing panel crops it */
  .ct-ph{grid-area:photo;position:relative;min-height:20rem;overflow:hidden;border-radius:var(--r-lg);background:var(--grey)}
  .ct-ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 62%}

  /* Opened for a named person or from an office (?person=, ?office=; assets/sig-contact.js): their picture, name and role
     or address under the heading, the enquiry pages' portrait pattern. The portrait's frame has its size before the image arrives, so nothing moves. */
  .ct-who{display:grid;gap:1rem;margin:1.5rem 0 0}
  .ct-who[hidden]{display:none}
  .ct-who-ph{width:min(100%,22rem);aspect-ratio:4/5;overflow:hidden;border-radius:var(--r-lg);background:var(--grey)}
  .ct-who-ph img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 0}
  .ct-who figcaption{display:grid;gap:0.25rem}
  .ct-who-name{justify-self:start;font:300 clamp(1.5rem,2.3vw,2.125rem)/1.18 var(--serif);letter-spacing:-.015em;text-decoration:underline;text-decoration-color:transparent;text-decoration-thickness:1px;text-underline-offset:0.2em}
  .ct-who-name:hover{text-decoration-color:currentColor}
  .ct-who figcaption span{font-size:0.9375rem;line-height:1.5;color:var(--mid)}
  /* their portrait is in place of the photo of two other people */
  &[data-ct-view="photo"] .ct-ph{display:none}
  /* an office: its page's hero picture, landscape; a photo's credit stays with it */
  .ct-who-office .ct-who-ph{width:100%;aspect-ratio:4/3}
  .ct-who-office .ct-who-ph img{object-position:50% 50%}
  .ct-who-credit{font-size:0.75rem;line-height:1.4;color:var(--mid)}

  /* Computers: the whole block (picture, name, role or address) is on the first screen whatever the window's height
     (Dieter, 24 Nov 2026). The intro is no taller than the window under the header, and the picture is the part that
     gives: it takes its size from the height left over, never from the column's width. */
  @media (min-width:56.26em) and (min-height:35em){
    &[data-ct-view] .ct-intro{display:flex;flex-direction:column;max-height:calc(100svh - var(--mast) - var(--ct-pad) - 1rem)}
    &[data-ct-view] .ct-intro>h1,&[data-ct-view] .ct-intro>.s-sub{flex:none}
    .ct-who{display:flex;flex-direction:column;flex:0 1 auto;min-height:0}
    .ct-who-ph{flex:0 1 27.5rem;width:auto;max-width:100%;min-height:7rem;align-self:flex-start}
    .ct-who-office .ct-who-ph{flex-basis:20rem;width:auto}
    .ct-who figcaption{flex:none}
  }
  /* a short window: the name sits beside the picture, not under it, so the picture keeps what height there is */
  @media (min-width:56.26em) and (min-height:35em) and (max-height:50em){
    .ct-who{flex-direction:row;align-items:flex-end;flex:0 1 27.5rem;min-height:7rem}
    .ct-who-office{flex-basis:20rem}
    .ct-who-ph,.ct-who-office .ct-who-ph{flex:0 0 auto;align-self:stretch;min-height:0}
    .ct-who-office .ct-who-ph{max-width:55%}
    .ct-who figcaption{flex:1 1 0;min-width:0}
  }

  /* The form's card: the same Stone card as the guide form on the homepage */
  .ct-form{padding:clamp(1.5rem,2.6vw,2.25rem);border-radius:var(--r-lg);background:var(--stone)}
  .ct-form .form,.ct-form .two{gap:1.5rem}

  /* What a first call costs and how it happens: the closing panel's three points */
  .ct-points{display:grid;gap:0.625rem;margin:0;padding:0;list-style:none}
  .ct-points li{display:grid;grid-template-columns:0.5rem minmax(0,1fr);gap:0.75rem;align-items:baseline;font-size:1.0625rem;line-height:1.45}
  .ct-points li::before{content:"";width:0.5rem;height:0.5rem;border-radius:50%;background:var(--forest);transform:translateY(-0.125rem)}

  /* Phone and email under a rule */
  .ct-reach{display:grid;justify-items:start;margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--rule)}
  .ct-reach .s-eyebrow{margin-bottom:0.5rem}
  .ct-tel{font:300 clamp(1.5rem,2.3vw,2.125rem)/1.18 var(--serif);letter-spacing:-.015em;white-space:nowrap}
  .ct-reach .line{display:inline-block;margin-top:1rem;max-width:100%;hyphens:none}

  /* A question still to be answered, once a send has been tried: red, with the browser's own message under it */
  .ct-form .field[data-ct-err]>span{color:#9a2b1f}
  .ct-form .field[data-ct-err] .input{border-bottom-color:#9a2b1f}
  .ct-form .field[data-ct-err]::after{content:attr(data-ct-err);display:block;margin-top:0.5rem;font-size:0.875rem;line-height:1.4;color:#9a2b1f}
  /* the consent box, left unticked: the same, with the message on its own line under the wording */
  .ct-form .check[data-ct-err]{flex-wrap:wrap;color:#9a2b1f}
  .ct-form .check[data-ct-err]>span{flex:1 1 0;min-width:0}
  .ct-form .check[data-ct-err]::after{content:attr(data-ct-err);flex:0 0 100%;font-size:0.875rem;line-height:1.4}

  /* After a successful enquiry the card holds the confirmation; the line asking for details goes */
  .ct-top.sent .ct-intro .s-sub{display:none}
  .ct-form .done{gap:1rem}
  .ct-form .done .d2{font:300 clamp(1.875rem,3vw,2.5rem)/1.1 var(--serif);letter-spacing:-.02em}
  .ct-form .done .lede{font-size:clamp(1.0625rem,1.3vw,1.1875rem);line-height:1.5}
  .ct-form .done .book{margin-top:0.5rem}
  /* the urgent number stays whole, and the full stop after it stays with it */
  .ct-form .done .lede .line{display:inline;white-space:nowrap}

  /* The offices: the page's ending, in place of a closing panel that would only lead back here */
  .ct-offices .s-head{align-items:end}
  .ct-offices .s-sub{margin:0}
  .ct-ofc{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.5rem;margin:1.5rem 0 0;padding:0;list-style:none}
  .ct-ofc li{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name tel" "addr addr";gap:0.75rem 1rem;align-items:baseline;padding:1.5rem;border-radius:var(--r-lg);background:#fff}
  .ct-ofc h3{grid-area:name}
  .ct-ofc h3 a{text-decoration:underline;text-decoration-color:transparent;text-decoration-thickness:1px;text-underline-offset:0.2em}
  .ct-ofc h3 a:hover{text-decoration-color:currentColor}
  .ct-ofc-tel{grid-area:tel;padding-block:0.25rem;font-size:1rem;color:var(--forest);white-space:nowrap;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:0.2em}
  .ct-ofc address{grid-area:addr;font-style:normal;font-size:0.9375rem;line-height:1.5;color:var(--mid)}

  /* Tablet: one column. The form follows the heading; the points and the phone number share a row under it */
  @media (max-width:56.25em){
    .ct-top{grid-template-columns:minmax(0,1fr);grid-template-areas:"intro" "form" "aside" "photo";grid-template-rows:auto;row-gap:1.5rem;padding-bottom:0}
    .ct-aside{position:static;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem clamp(1.5rem,4vw,4rem);align-items:start;margin-top:1.5rem}
    .ct-reach{margin-top:0;padding-top:0;border-top:0}
    /* the photo runs edge to edge under the form, 3:2, as the closing panel's does */
    .ct-ph{margin:1.5rem calc(var(--gut) * -1) 0;min-height:0;aspect-ratio:3/2;border-radius:0}
    .ct-ofc{grid-template-columns:repeat(2,minmax(0,1fr))}
    /* a named person: a compact row with the heading, above the form (as on the enquiry pages), so the form stays on
       the first screen; with the page's photo gone the section keeps its own space at the foot */
    .ct-who{grid-template-columns:3.5rem minmax(0,1fr);align-items:center}
    .ct-who-solo{grid-template-columns:minmax(0,1fr)}
    .ct-who-ph,.ct-who-office .ct-who-ph{width:3.5rem;aspect-ratio:1/1;border-radius:50%}
    .ct-who-ph img{object-position:50% 12%}
    .ct-who figcaption{gap:0.125rem}
    .ct-who-name{font:500 1.0625rem/1.3 var(--sans);letter-spacing:0;text-decoration-color:currentColor}
    .ct-who figcaption span{line-height:1.4}
    &[data-ct-view="photo"] .ct-top{padding-bottom:clamp(3.5rem,6vw,5.5rem)}
  }
  /* Tablet: the card is wide enough for the form's paired fields to sit side by side again (site.css stacks them below 64em) */
  @media (min-width:44em) and (max-width:56.25em){
    .ct-form .two{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  }
  /* Phone: everything stacks; less space above the heading, so the form's first fields are on the first screen */
  @media (max-width:35em){
    .ct-top{padding-top:2rem}
    .ct-aside{grid-template-columns:minmax(0,1fr)}
    .ct-reach{padding-top:1.5rem;border-top:1px solid var(--rule)}
    .ct-ofc{grid-template-columns:minmax(0,1fr);gap:1rem}
    .ct-ofc li{padding:1.25rem}
  }
  /* Small phone: the send button runs the full width */
  @media (max-width:30em){
    .ct-form .acts .book{flex:1 1 100%;justify-content:center}
  }
  @media (max-width:22.5em){
    .ct-form{padding:1rem}
    .ct-form select{font-size:0.875rem}
  }
  /* Very large text on a small phone: numbers and the confirmation heading stay whole */
  @media (max-width:17.5em){
    /* the card runs edge to edge, so the form's labels and consent wording get the width */
    .ct-form{margin-inline:calc(var(--gut) * -1);padding-inline:var(--gut);border-radius:0}
    main .ct-form .acts .book{padding-inline:0.5rem}
    .ct-form .acts .book svg{display:none}
    .ct-who{grid-template-columns:minmax(0,1fr);gap:0.5rem}
    .ct-tel{font-size:1.0625rem}
    /* the email address breaks only after its @ (site.css lets links break anywhere at this size) */
    .ct-reach .line{padding-inline:0;font-size:0.8125rem;overflow-wrap:normal;word-break:normal;text-align:left}
    .ct-ofc li{padding:0.75rem}
    .ct-ofc h3{hyphens:none}
    .ct-form .done .d2{font-size:clamp(1.125rem,11.5vw,1.75rem)}
    .ct-ofc li{grid-template-columns:minmax(0,1fr);grid-template-areas:"name" "tel" "addr";gap:0.375rem}
    .ct-ofc-tel{justify-self:start}
  }
}
