/* Technical due diligence pages (/technical-due-diligence/…): the hero with its sheet, the series navigation,
   ruled schedules, route cards, steps, the service note and the request form.
   Values come from tokens.css. Loaded after service.css, whose FAQ list these pages reuse; the request page
   also loads promo.css for the shared form fields. */

/* ---------- hero: text on the left, one sheet on the right ---------- */
.dd-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: var(--space-8);
  align-items: center;
}

.dd-hero .tagline {
  max-width: 36rem;
}

.dd-hero .tagline + .tagline {
  margin-top: var(--space-4);
}

.dd-hero .cta-group {
  margin-top: var(--space-6);
}

/* Where the column is too narrow for both, the second link goes under the button: neither label is broken
   in two. (Up to 600px buttons.css stacks them at full width.) */
@media (min-width: 601px) {
  .dd-hero .cta-group {
    flex-wrap: wrap;
    row-gap: var(--space-4);
  }

  .dd-hero .cta-group > a {
    flex-shrink: 0;
    max-width: 100%;
  }
}

/* Three short credentials under the buttons, each led by a watch-index tick. */
.dd-proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-6) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  font-size: var(--text-sm, 0.9375rem);
  color: var(--text-secondary);
}

.dd-proof li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dd-proof li::before {
  content: "";
  flex-shrink: 0;
  width: 1px;
  height: 14px;
  background: var(--text-primary);
}

/* ---------- the sheet: a page of a report, set beside the hero text ---------- */
.dd-sheet {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--surface);
  /* The edge of a second page underneath. */
  box-shadow: 7px 7px 0 -1px var(--bg-warm), 7px 7px 0 0 var(--border);
}

.dd-sheet__title {
  font-family: var(--font-heading);
  font-size: var(--text-h3, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.dd-sheet__lead {
  margin-top: var(--space-2);
  font-size: var(--text-sm, 0.9375rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.dd-sheet dl {
  margin: var(--space-4) 0 0;
}

.dd-sheet__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-light);
}

/* French labels are longer (« Nous examinons »): beside the text they need a wider column to stay on one line. */
@media (min-width: 1201px) {
  html:lang(fr) .dd-sheet__row {
    grid-template-columns: 8.25rem minmax(0, 1fr);
  }
}

.dd-sheet dt {
  padding-top: 3px;
  font-size: var(--text-2xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dd-sheet dd {
  margin: 0;
  font-size: var(--text-sm, 0.9375rem);
  line-height: 1.6;
  color: var(--text-primary);
}

/* A closing line under the rows: what the report states beside them. */
.dd-sheet__foot {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm, 0.9375rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---------- series navigation, directly under the hero ---------- */
.dd-subnav {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.dd-subnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dd-subnav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  font-size: var(--text-sm, 0.9375rem);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.dd-subnav a:hover {
  color: var(--text-primary);
}

.dd-subnav a[aria-current="page"] {
  font-weight: 600;
  color: var(--text-primary);
}

.dd-subnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--gold);
}

/* ---------- running text ---------- */
.dd-prose > h2 {
  max-width: var(--measure, 42rem);
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
}

.dd-prose p {
  max-width: var(--measure, 42rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

.dd-prose p + p {
  margin-top: var(--space-4);
}

/* Several text blocks in one section: one gap between them. */
.dd-prose + .dd-prose,
.dd-pair + .dd-prose {
  margin-top: var(--space-8);
}

.dd-prose a,
.dd-related a,
.dd-schedule a,
.dd-note a,
.dd-request a:not(.cta-primary, .cta-secondary) {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.dd-prose a:hover,
.dd-related a:hover,
.dd-schedule a:hover,
.dd-note a:hover,
.dd-request a:not(.cta-primary, .cta-secondary):hover {
  color: var(--accent);
}

/* One line of links to neighbouring services, under a pair of text blocks. */
.dd-related {
  margin-top: var(--space-6);
  font-size: var(--text-sm, 0.9375rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.dd-related + .dd-prose {
  margin-top: var(--space-8);
}

/* Two text blocks side by side; the second column may stack two short ones. */
.dd-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8) var(--space-9);
  align-items: start;
}

.dd-pair > .dd-prose + .dd-prose {
  margin-top: 0;
}

/* ---------- schedule: what is examined, one ruled row per area ---------- */
.dd-schedule {
  border-bottom: 1px solid var(--border);
}

.dd-schedule__row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: var(--space-3) var(--space-8);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
}

.dd-schedule__row h3 {
  line-height: 1.3;
}

.dd-schedule__row p {
  max-width: var(--measure, 42rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

/* The first sentence of a row lists what is examined; the rest says what is assessed. */
.dd-schedule__scope {
  color: var(--text-primary);
}

.dd-schedule__row .dd-schedule__more {
  margin-top: var(--space-3);
  font-size: var(--text-sm, 0.9375rem);
  font-weight: 600;
}

/* A second schedule in the same section (the IT coverage under the cybersecurity coverage). */
.dd-schedule + .section-header {
  margin-top: var(--space-9);
}

/* ---------- three parallel options, ruled above ---------- */
.dd-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-7);
}

.dd-col {
  padding-top: var(--space-5);
  border-top: 1px solid var(--text-primary);
}

.dd-col h3 {
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.dd-col p {
  font-size: var(--text-sm, 0.9375rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

/* ---------- route cards: each one leads to a page ---------- */
.dd-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.dd-route {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) 28px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--surface);
  transition: transform 0.3s, border-color 0.3s;
}

.dd-route::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: rgb(var(--gold-rgb) / 70%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.dd-route:hover,
.dd-route:focus-within {
  border-color: var(--text-muted);
  transform: translateY(-4px);
}

.dd-route:hover::before,
.dd-route:focus-within::before {
  transform: scaleX(1);
}

.dd-route h3 {
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.dd-route p {
  margin-bottom: var(--space-5);
  font-size: var(--text-sm, 0.9375rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

.dd-route a {
  margin-top: auto;
  font-size: var(--text-sm, 0.9375rem);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

/* The link covers its card, so the whole card can be clicked. */
.dd-route a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.dd-route:hover a {
  color: var(--accent);
}

/* ---------- deliverables: a ruled list in two columns ---------- */
.dd-deliverables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-8);
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dd-deliverables li {
  position: relative;
  padding: var(--space-4) 0 var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  line-height: 1.6;
  color: var(--text-primary);
}

.dd-deliverables li::before {
  content: "";
  position: absolute;
  top: calc(var(--space-4) + 0.3em);
  left: 0;
  width: 1px;
  height: 1em;
  background: var(--text-primary);
}

/* ---------- steps of an engagement ---------- */
.dd-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
}

.dd-step {
  position: relative;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

/* A tick on the rule above each step, as on the section dividers. */
.dd-step::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 1px;
  height: 20px;
  background: var(--text-primary);
}

.dd-step h3 {
  margin-bottom: var(--space-3);
  padding-left: var(--space-4);
  line-height: 1.3;
}

.dd-step__num {
  color: var(--accent);
}

.dd-step p {
  padding-left: var(--space-4);
  font-size: var(--text-sm, 0.9375rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

.dd-step p + p {
  margin-top: var(--space-3);
}

/* ---------- FAQ on a plain section: the items need their own surface ---------- */
.dd-faq:not(.section-alt) .faq-list details {
  background: var(--surface);
}

/* ---------- service note: the terms every page of the series carries ---------- */
.dd-note {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-light);
}

.dd-note p {
  max-width: var(--measure, 42rem);
  font-size: var(--text-xs, 0.8125rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-muted);
}

/* ---------- request page ---------- */
/* The form continues the page's opening lines, so its section has no padding above. */
.dd-request {
  padding: 0 0 var(--section-y, var(--space-10));
}

.dd-request__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--space-8);
  align-items: start;
}

/* One height for every single-line field. Safari draws a native select at its own height whatever the
   stylesheet asks for, so the selects give up the native appearance and get a drawn arrow. */
.dd-request .promo-field :is(input[type="text"], input[type="email"], input[type="date"], select) {
  height: 52px;
}

.dd-request .promo-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-primary) 50%),
    linear-gradient(135deg, var(--text-primary) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

/* A label that runs onto a second line on a narrow phone must not squeeze its box. */
.dd-request .promo-checks input {
  flex-shrink: 0;
}

.dd-request .promo-form textarea {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: var(--space-3) 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-base, 1.0625rem);
  line-height: 1.5;
  color: var(--text-primary);
  resize: vertical;
}

.dd-request .promo-form textarea:hover {
  border-color: var(--text-muted);
}

.dd-request :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* One line under a field, saying what to leave out or what happens with the answer. */
.dd-hint {
  margin-top: var(--space-2);
  font-size: var(--text-xs, 0.8125rem);
  line-height: 1.5;
  color: var(--text-muted);
}

/* The answer under the form opens with a heading of the page's second level (there is none above it). */
.dd-request .promo-result h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-h3, 1.25rem);
  line-height: 1.3;
  color: var(--text-primary);
}

.dd-request .promo-result p:last-of-type {
  margin-bottom: var(--space-4);
}

.dd-request .promo-result p:only-child {
  margin-bottom: 0;
}

.dd-request__aside {
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--text-primary);
}

.dd-request__aside h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-h3, 1.25rem);
  line-height: 1.3;
}

.dd-request__aside h2:not(:first-child) {
  margin-top: var(--space-6);
}

.dd-request__aside p {
  font-size: var(--text-sm, 0.9375rem);
  line-height: var(--leading-body, 1.65);
  color: var(--text-secondary);
}

.dd-request__aside p + p {
  margin-top: var(--space-3);
}

/* ---------- responsive ---------- */
/* On a small laptop the headline needs the room: the sheet narrows and sets its labels above the text. */
@media (max-width: 1200px) {
  .dd-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
    gap: var(--space-7);
  }

  .dd-sheet {
    padding: var(--space-5) var(--space-5) var(--space-3);
  }

  .dd-sheet__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}

@media (max-width: 1000px) {
  .dd-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-7);
  }

  .dd-sheet {
    max-width: 34rem;
  }

  .dd-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .dd-cols,
  .dd-routes {
    grid-template-columns: minmax(0, 1fr);
  }

  .dd-cols {
    gap: var(--space-6);
  }

  .dd-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7) var(--space-6);
  }

  .dd-request__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-7);
  }
}

@media (max-width: 760px) {
  .dd-schedule__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .dd-deliverables {
    grid-template-columns: minmax(0, 1fr);
  }

  .dd-subnav ul {
    gap: 0 var(--space-5);
  }

  .dd-subnav a {
    min-height: 44px;
  }

  .dd-subnav .container {
    padding-block: var(--space-2);
  }
}

@media (max-width: 600px) {
  .dd-sheet {
    padding: var(--space-4) var(--space-5) var(--space-3);
    box-shadow: 5px 5px 0 -1px var(--bg-warm), 5px 5px 0 0 var(--border);
  }

  .dd-route {
    padding: var(--space-5);
  }

  .dd-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }

  .dd-schedule + .section-header {
    margin-top: var(--space-8);
  }

  .dd-note {
    padding: var(--space-5) 0;
  }
}
