/* tp-fixes.css (c16 design overlay, builds on c15). Loaded AFTER /c/c.css and /tp-consent.css.
   Fixes found by the live QA of 2 Dec 2026, without touching the frozen design files.
   Every rule is scoped to the size range or state where the page is broken today;
   nothing here changes a size that is fine. No new words, no restyle. */

/* ---- 3 (QA 4.1): Home Solutions on a wide but short screen (900 px and up, 480 px tall or less,
   for example a large phone sideways). The desktop stage is one screen tall and its card area is
   150 px, ten cards need 231 px, so half of them sat under the detail panel. The section takes
   the height the cards need and the page scrolls past it. 844x390 (the phone layout) is not
   in this range. */
@media (min-width: 900px) and (max-width: 1199px) and (max-height: 480px) {
  .sf { height: 580px; }
}

/* ---- 8 (QA 1.2): Home Solutions on a first visit at desktop size: the cookie bar covered the
   "Read the case study" link. While the bar is open the stage keeps the bar's height free at its
   foot (the measured height the consent script publishes), so the link stays above the bar. */
@media (min-width: 900px) {
  html.tp-consent-open:has([data-site="c"]) .sf-stage {
    padding-bottom: var(--tp-consent-h, var(--tp-bar, 64px));
  }
}

/* ---- 6 (QA 2.5, 5.8): /cases cards showed three (or four) lines and cut the sentence.
   The whole sentence shows; cards in a row stay the same height (grid stretch). */
.cs-card .cs-cl, .cs-card .cs-ch {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* ---- 7 (QA 5.2, 3.3): accessibility options on the Home Solutions block on phones. */
@media (max-width: 599px) {
  /* Larger text: the tab labels are drawn 1.2 times larger; at 320 and 360 wide MULTIFAMILY and
     DEVELOPERS ran out of their buttons. The label stays larger than the normal 11 px. */
  html.tp-a11y-bigtext .sf-tb {
    letter-spacing: 0;
    font-size: 9.4px;
    padding-left: 2px;
    padding-right: 2px;
  }
}
@media (max-width: 899px) {
  /* "All case studies" sits on the label row, out of the flow; a taller link (larger text, a
     different font, the highlight outline) reached into the line below it. */
  html.tp-a11y-bigtext .sf-eb,
  html.tp-a11y-readable .sf-eb,
  html.tp-a11y-links .sf-eb {
    margin-bottom: 18px;
  }
}

/* ---- 4a (QA 5.1): /contact on phones 548 to 643 px tall (320x640, 360x640, a 360x740 phone with
   the address bar showing). The design builds three screens of height (300svh) and puts one block
   on each, which left empty bands above "Talk to us", inside the card, after Send and under the
   legal note. Here the page is as tall as its content, and the form is one card. The same single
   card is used from 640 to 899 px wide on screens 644 px tall and more (QA 6.1: 768x1024 had two
   blocks with a dark band between them and a broken dotted line). Phones under 640 px wide that
   are 644 px tall or more keep the design's two cards. */
@media (max-width: 899px) {
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .contact {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(96px + 4vh) 0 28px;
  }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct { row-gap: 44px; }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct-l {
    height: auto;
    display: block;
    padding-bottom: 0;
  }
  /* single card: the panel is the card, its inner groups are plain wrappers */
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct-panel {
    display: block;
    box-sizing: border-box;
    border-radius: 6px;
    padding: 28px 46px 24px 50px;
  }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] :is(.ct-g1, .ct-g2, .ct-g3, .ct-g23) {
    display: contents;
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    height: auto;
    border-radius: 0;
  }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] :is(.ct-g1, .ct-g2) .fld { margin-bottom: 24px; }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct-g1 .fld:last-child::after { display: block; }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct-g2 .fld textarea {
    height: clamp(120px, 24svh, 220px);
    min-height: 98px;
  }
  html[data-theme][data-sb~="ct3"] [data-site="c"][data-page="contact"] .ct-done:not([hidden]) {
    display: block;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 6px 0 2px;
    margin: 0;
    height: auto;
  }
}
@media (min-width: 640px) and (max-width: 899px) {
  html[data-theme][data-sb~="ct2"] [data-site="c"][data-page="contact"] .ct-panel {
    display: block;
    box-sizing: border-box;
    border-radius: 6px;
    padding: 28px 46px 24px 50px;
  }
  html[data-theme][data-sb~="ct2"] [data-site="c"][data-page="contact"] :is(.ct-g1, .ct-g2, .ct-g3, .ct-g23) {
    display: contents;
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    height: auto;
    border-radius: 0;
  }
  html[data-theme][data-sb~="ct2"] [data-site="c"][data-page="contact"] .ct-g1 .fld:last-child { margin-bottom: 24px; }
  html[data-theme][data-sb~="ct2"] [data-site="c"][data-page="contact"] .ct-g1 .fld:last-child::after { display: block; }
  html[data-theme][data-sb~="ct2"] [data-site="c"][data-page="contact"] .ct-done:not([hidden]) {
    display: block;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 6px 0 2px;
    margin: 0;
    height: auto;
  }
}

/* ---- 4b (QA 4.6): /contact on a wide but short screen: the form card is taller than the screen
   and the left column was centred against it, so the first screen showed an empty left half.
   The left column now starts at the top of the card. */
@media (min-width: 900px) and (max-width: 1099px) and (max-height: 600px) {
  .page-contact .ct-l { align-self: start; }
}

/* ---- 11c (QA 5.5): /contact at 320: the placeholder "Company name, optional" was cut. */
@media (max-width: 334px) {
  #f-company::placeholder { font-size: 16px; }
}

/* ---- 11a (QA 6.2): /about at 768x1024: the team rows were 673, 558 and 454 px tall, because the
   design splits the page into screens sized for a phone (rows of 50svh + 46 px and 50svh - 58 px).
   From 640 to 899 px wide the rows take the height of their own content, so the gaps are equal. */
@media (min-width: 640px) and (max-width: 899px) {
  html[data-theme][data-sb~="tm2"] [data-site="c"] .page-company .people,
  html[data-theme][data-sb~="tm3"] [data-site="c"] .page-company .people {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: 64px;
  }
  html[data-theme][data-sb~="tm2"] [data-site="c"] .team,
  html[data-theme][data-sb~="tm3"] [data-site="c"] .team {
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  html[data-theme][data-sb~="tm2"] [data-site="c"] .team,
  html[data-theme][data-sb~="tm3"] [data-site="c"] .team { row-gap: 48px; }
  html[data-theme][data-sb~="tm2"] [data-site="c"] .team li,
  html[data-theme][data-sb~="tm3"] [data-site="c"] .team li { padding-top: 22px; }
  html[data-theme][data-sb~="tm2"] [data-site="c"] .team li::before,
  html[data-theme][data-sb~="tm3"] [data-site="c"] .team li::before { top: -1px; }
}

/* ---- 11b (QA 6.6): the footer logo is centred at 768 although the design sets the footer row
   to left aligned below 900 px (c.css, "footer .row"); the inline style on the row wins over it. */
@media (min-width: 640px) and (max-width: 899px) {
  footer .row { align-items: flex-start !important; }
}

/* ---- 2 (c16, QA R3): /contact, a failed send focuses the first wrong field and the browser scrolled it
   just into view, under the fixed header (96 px on phones and tablets, 72 px on desktop), with its message
   below the fold. The field's label sits above it, so the margin covers header + label; the margin at the
   foot keeps the message line (and the cookie bar, while it is open) in view. Only affects scrolling that
   is triggered by focus; nothing is drawn differently. */
.fld input, .fld textarea {
  scroll-margin-top: 140px;
  scroll-margin-bottom: 120px;
}
@media (min-width: 900px) {
  .fld input, .fld textarea { scroll-margin-top: 116px; }
}
html.tp-consent-open .fld input,
html.tp-consent-open .fld textarea {
  scroll-margin-bottom: calc(var(--tp-consent-h, var(--tp-bar, 80px)) + 110px);
}

/* ---- 3a (c16, QA R7): the measured height for Solutions on a wide screen that is too short for the cards
   (set by tp-fixes.js, which finds the least height at which no card is under the detail panel). */
@media (min-width: 900px) {
  html.tp-sf-tall .sf { height: var(--tp-sf-h, 580px); }
}
