/*
 * ET Group Justice: Services (/justice/services/) only. Loaded after justice.css and subnav.css.
 * Ported from John's Services design (services.css and services/<part>.css, in that order), every selector scoped
 * under .etgj; class prefix sv-. Parts: hero and the five service tabs (js: pages/services.js), the three service
 * lines (one sheet each, Nov 24), Support and maintenance, Managed Services, on-site technician, national reach
 * (stats and team), closing form. Every id on the page carries the etgj- prefix.
 * Reveals use the shared data-etgj-reveal with an inline --i stagger (the design's data-sv-reveal / --sv-i).
 */

/* Shared candidate: the design (v45.css) re-declares --rule-grad on sections after the hero, so their hairlines use that
   section's --line (.12); justice.css declares it once on .etgj, where --line is .13 */
.etgj .etgj-sheet:not(.etgj-sheet--hero) { --rule-grad: linear-gradient(var(--line), var(--line)); }

/* ---------- Number: a plain number in a hairline circle (the homepage flow's), never zero-padded ---------- */
.etgj .sv-num {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  font: 500 13px/1 var(--ff); font-variant-numeric: tabular-nums; color: var(--ink);
}

/* Service eyebrow: the line's number in a small circle, then its name (the service lines and Managed Services) */
.etgj p.sv-line__service { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.etgj .sv-line__service .sv-num { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Icon tile: a Phosphor icon (light weight, as the homepage) in the tile the Courts and Corrections
   managed services use ---------- */
.etgj .sv-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #E3E6EC; }
.etgj .sv-icon svg { width: 24px; height: 24px; }
@media (max-width: 960px) {
  .etgj .sv-icon { width: 40px; height: 40px; }
  .etgj .sv-icon svg { width: 20px; height: 20px; }
}

/* Inline link inside running copy (e.g. "dedicated on-site technician" in Managed Services' roles) */
.etgj .sv-inline-link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .35); }
.etgj .sv-inline-link:hover { text-decoration-color: currentColor; }

/* ---------- Secondary action (Nov 10): the outlined recipe from Corrections (cr-btn--secondary), same size as the
   red primary. Used for the brief's "suggested action" (Discuss a Managed Service Program). */
.etgj .etgj-btn.sv-btn--secondary {
  color: var(--ink); background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32);
  transition: background-color .2s ease, box-shadow .2s ease, transform .14s var(--ease-out);
}
.etgj .etgj-btn.sv-btn--secondary:hover { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }

/* Nov 19 revision round (John): every multi-line heading and paragraph on this page wraps with text-wrap: pretty
 * (no orphaned last words). Doubled class so it also wins over the shared sheet's text-wrap: balance rules. */
.etgj.etgj :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, blockquote, th, td) { text-wrap: pretty; }

/*
 * Services page, 01-hero. The Corrections hero's recipe (assets/css/corrections/hero.css): the homepage hero's type,
 * no photo; the eyebrow across the top; the headline and the brief's opening on 1 to 6; the offer card on 7 to 12,
 * from the headline's lowercase letters to the end of the copy. Phones: eyebrow, headline, copy, then the card.
 * Under it (Nov 24), a hairline, the five services as one row of tabs, then the chosen one: overview and how it
 * connects on 1 to 6, "What it covers" and a link to its section on 7 to 12.
 */
.etgj .sv-hero { padding-bottom: var(--sheet-y); }
.etgj .sv-hero .etgj-hero__title { margin: 0; }
/* Nov 20 (John): the hero intro keeps the system's vertical line (justice.css .etgj-hero__lede: 1px rule, 24px indent) */
.etgj .sv-hero .etgj-hero__lede { margin: 24px 0 0; max-width: 34em; }

/* ---------- The offer card ---------- */
.etgj .sv-hero-offer { padding: 32px; border-radius: var(--radius); background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px var(--line); }
.etgj .sv-hero-offer__text { margin: 0 0 24px; font: 400 var(--fs-body)/1.55 var(--ff); color: var(--ink); text-wrap: pretty; }

@media (min-width: 961px) {
  .etgj .sv-hero { row-gap: 0; }
  .etgj .sv-hero > .sv-hero-brand { grid-column: 1 / -1; grid-row: 1; margin: 0 0 16px; }
  .etgj .sv-hero > .etgj-hero__text { grid-column: 1 / 7; grid-row: 2; }
  .etgj .sv-hero > .sv-hero-offer {
    grid-column: 7 / -1; grid-row: 2; align-self: stretch; margin: calc(var(--fs-display) * 0.35) 0 0 var(--cell-pad);
    display: flex; flex-direction: column; align-items: flex-start;
  }
  .etgj .sv-hero-offer .etgj-btn { margin-top: auto; }
}
@media (min-width: 961px) and (max-width: 1320px) {
  .etgj .sv-hero-offer { padding: 24px 28px; }
  .etgj .sv-hero-offer__text { font-size: var(--fs-small); margin-bottom: 18px; }
}
@media (max-width: 960px) {
  .etgj .sv-hero > * { grid-column: 1 / -1; }
  .etgj .sv-hero-offer { margin-top: 32px; padding: 24px; }
}

/* Hero load: the eyebrow rises first, then the headline and copy (motion.css), then the card */
@media (prefers-reduced-motion: no-preference) {
  .etgj.etgj-js .sv-hero-brand { opacity: 0; translate: 0 20px; animation: etgj-rise 600ms var(--ease) forwards; }
  .etgj.etgj-js .sv-hero-offer { opacity: 0; translate: 0 20px; animation: etgj-rise 600ms var(--ease) 200ms forwards; }
  .etgj.etgj-js .sv-hero-offer .etgj-btn { animation-delay: 420ms; }
}
body[data-a11y-toggle="active"] .etgj :is(.sv-hero-brand, .sv-hero-offer) { opacity: 1 !important; translate: none !important; animation: none !important; }

/* ---------- The five service tabs ---------- */
.etgj .sv-start { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin-top: var(--head-gap); padding-top: 40px; background: var(--rule-grad) left top / 100% 1px no-repeat; scroll-margin-top: calc(var(--subnav-h) + 24px); }

/* the tabs: five equal across the row (a control, not a layout container), an accent underline under the chosen one */
.etgj .sv-start-tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gap); border-bottom: 1px solid var(--line); }
.etgj .sv-start-tabs[hidden] { display: none; }
.etgj .sv-start-tab {
  position: relative; margin: 0; padding: 16px 0 18px; border: 0; background: none; cursor: pointer; text-align: left;
  font: 400 var(--fs-body)/1.35 var(--ff); color: var(--grey); transition: color .2s ease;
}
.etgj .sv-start-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent-grad); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out); }
.etgj .sv-start-tab:hover, .etgj .sv-start-tab[aria-selected="true"] { color: var(--ink); }
.etgj .sv-start-tab[aria-selected="true"]::after { transform: none; }
.etgj .sv-start-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* the chosen service (Nov 24): overview, then how it connects (a step quieter) on 1 to 6; "What it covers" as hairline
   rows (plain text, not links) on 7 to 12, then a link to the service's section */
.etgj .sv-start-panel { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; align-content: start; margin-top: 40px; outline-offset: 8px; }
.etgj .sv-start:not(.is-live) .sv-start-panel + .sv-start-panel { margin-top: var(--head-gap); }
/* Nov 24: the head row folded into the offer card, so the tabs open the block and the panels take row 2 */
.etgj .sv-start.is-live .sv-start-panel { grid-row: 2; transition: opacity .35s var(--ease), visibility 0s linear .35s; }
.etgj .sv-start.is-live .sv-start-panel:not(.is-on) { opacity: 0; visibility: hidden; }
.etgj .sv-start.is-live .sv-start-panel.is-on { transition: opacity .35s var(--ease) .06s, visibility 0s; }
.etgj .sv-start-text { grid-column: 1 / 6; }
.etgj .sv-start-name { margin: 0 0 16px; font: 400 var(--fs-title)/1.1 var(--ff-display); letter-spacing: -0.02em; color: var(--ink); text-wrap: pretty; }
.etgj .sv-start-desc { margin: 0; max-width: 28em; text-wrap: pretty; }
.etgj .sv-start-desc--then { margin-top: 16px; color: var(--ink-2); }
.etgj .sv-start-fit { grid-column: 7 / -1; margin-left: var(--cell-pad); }
.etgj .sv-start-fit__label { margin: 0 0 8px; font: 400 var(--fs-small)/1.4 var(--ff); color: var(--grey); }

.etgj .sv-start-covers { margin: 0 0 28px; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.etgj .sv-start-covers li { padding: 12px 0; border-top: 1px solid var(--line); font: 400 var(--fs-body)/1.45 var(--ff); color: var(--ink); text-wrap: pretty; }

@media (max-width: 960px) {
  .etgj .sv-start { padding-top: 32px; }
  /* phones and tablets: the tabs scroll sideways, each its own width */
  .etgj .sv-start-tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .etgj .sv-start-tabs::-webkit-scrollbar { display: none; }
  .etgj .sv-start-tab { flex: none; padding: 12px 0 14px; font-size: var(--fs-small); white-space: nowrap; }
  .etgj .sv-start-tab:last-child { margin-right: 48px; }
  .etgj .sv-start-panel { margin-top: 28px; row-gap: 28px; }
  .etgj .sv-start-text, .etgj .sv-start-fit { grid-column: 1 / -1; margin-left: 0; }
  .etgj .sv-start-name { font-size: var(--fs-subtitle); }
}
@media (prefers-reduced-motion: reduce) {
  .etgj .sv-start-panel, .etgj .sv-start-tab::after { transition: none !important; }
}
body[data-a11y-toggle="active"] .etgj :is(.sv-start-panel, .sv-start-tab::after) { transition: none !important; }

/*
 * Services page, 03-lines. Nov 24: the three project service lines (strategy, design, integration), one sheet each, built
 * from the Support and maintenance sheet's classes: the case (managed.css below) and the capability cells. This part
 * keeps the pieces the lines and Support share: the capability row, the example engagement (a quiet inset panel) and
 * the foot under the row.
 */
/* Example engagement: the brief's generic scenario, set apart so it never reads as a named case study */
.etgj .sv-example { margin: 0 0 28px; padding: 20px 24px; border-radius: 12px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.etgj .sv-example p { margin: 0; }
.etgj .sv-example .sv-example__label { margin: 0 0 6px; font: 400 var(--fs-small)/1.4 var(--ff); color: var(--grey); }

@media (max-width: 960px) {
  .etgj .sv-example { padding: 16px 18px; }
}

/* Nov 24 (John: "match Support exactly"): "What you can engage us to do" is a row of capability cells, as Support and
   Managed Services: an icon tile, a short name and the item. Strategy and Design have four (3 + 3 + 3 + 3), Integration
   five, one row of equal fifths. Under the row, the example engagement at full width, then the Approach link. */
.etgj .sv-managed-head + .sv-line-caps { margin-top: 32px; }
.etgj .sv-line-caps p { margin: 0; }
@media (min-width: 961px) {
  .etgj .sv-line-caps--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gap); }
  .etgj .sv-line-caps--5 > * { grid-column: auto; }
}
.etgj .sv-line-foot { grid-column: 1 / -1; margin-top: 40px; }
.etgj .sv-line-foot .sv-example { margin: 0; }
.etgj .sv-line-foot .sv-example p:not(.sv-example__label) { max-width: 56em; }
.etgj .sv-line-foot > .etgj-link { display: inline-flex; margin-top: 24px; }
@media (max-width: 960px) {
  .etgj .sv-line-foot { margin-top: 28px; }
  .etgj .sv-line-foot > .etgj-link { display: inline-block; }   /* the shared phone link: the arrow follows a wrapped label */
}
/* Support (4): its step up to Managed Services sits between the example and the link */
.etgj .sv-line-foot .sv-line__next { margin: 24px 0 0; max-width: 56em; }
.etgj .sv-line-foot .sv-line__next + .etgj-link { margin-top: 12px; }
@media (min-width: 961px) {
  /* the photo and the text start on one top line */
  .etgj :is(#etgj-strategy, #etgj-design, #etgj-integration) .etgj-case { align-items: start; }
  /* Integration's text runs taller than its photo: the photo fills the text's height (cover crop) */
  .etgj #etgj-integration .etgj-case__img { align-self: stretch; height: 100%; aspect-ratio: auto; object-fit: cover; }
}

/*
 * Services page, 035-support (Nov 20): Support and maintenance as its own section, ahead of Managed Services. It reuses
 * the Managed Services sheet's classes: the case and the capability cells. Only what differs lives here: two
 * capability cells (6 + 6) instead of six.
 */
/* two cells, one row: the first opens flush on column 1, the second has the divider */
@media (min-width: 961px) {
  .etgj .sv-support-caps > :nth-child(2) { padding-right: 0; }
}

/*
 * Services page, 04-managed (navy feature glass). 1. PROOF's case. 2. The six capabilities as hairline cells, 3 x 2,
 * each with an icon tile (the Courts and Corrections managed services recipe). 3. A pair: rooms and locations on
 * 1 to 5; the three roles on 7 to 12, joined by a line through their icon tiles, ET Group's tile in the accent.
 */
.etgj .sv-managed-case .etgj-case__text p:not(.etgj-eyebrow) { margin-bottom: 20px; }
.etgj .sv-managed-case .etgj-case__text .etgj-link { margin-top: 8px; }

.etgj .sv-managed-head { margin: var(--head-gap) 0 0; }
.etgj .sv-managed-head .etgj-feature__title { margin: 0; }
.etgj .sv-managed-head + .sv-managed-caps { margin-top: 32px; }
.etgj .sv-managed-cap__name { margin: 0 0 10px; font: 400 var(--fs-heading)/1.25 var(--ff-display); color: var(--ink); text-wrap: pretty; }
.etgj .sv-managed-caps p { margin: 0; }

/* Two rows of three: each row opens flush on column 1 with no divider; the second row gets a rule across it */
@media (min-width: 961px) {
  .etgj .sv-managed-caps > :nth-child(3n+1) { padding-left: 0; }
  .etgj .sv-managed-caps > :nth-child(3n+1)::before { display: none; }
  .etgj .sv-managed-caps > :nth-child(3n+1):nth-child(n+4)::before {
    display: block; top: 0; bottom: auto; width: calc(300% + 2 * var(--gap)); height: 1px; transform: none;
  }
  .etgj .sv-managed-caps > :nth-child(3n) { padding-right: 0; }
}

/* ---------- Rooms and locations | Clear responsibilities ---------- */
.etgj .sv-managed-pair { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; margin-top: var(--head-gap); }
.etgj .sv-managed-across { grid-column: 1 / 6; }
.etgj .sv-managed-roles { grid-column: 7 / -1; padding-left: var(--cell-pad); }
.etgj .sv-managed-pair .etgj-feature__title { margin: 0 0 20px; }
.etgj .sv-managed-across p { margin: 0 0 16px; }
.etgj .sv-managed-roles__intro { margin: 0 0 28px; }

.etgj .sv-roles { margin: 0; padding: 0; list-style: none; }
.etgj .sv-role { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 20px; padding-bottom: 28px; }
/* the line joining the three tiles */
.etgj .sv-role:not(:last-child)::before { content: ""; position: absolute; left: 21.5px; top: 52px; bottom: 8px; width: 1px; background: var(--line); }
.etgj .sv-role .sv-icon { margin: 0; }
.etgj .sv-icon--accent { background: var(--accent-grad); color: #fff; }
.etgj .sv-role__who { margin: 0 0 2px; font: 400 var(--fs-small)/1.4 var(--ff); color: var(--grey); }
.etgj .sv-role__name { margin: 0 0 6px; font: 400 var(--fs-heading)/1.25 var(--ff-display); color: var(--ink); }
.etgj .sv-role p:not(.sv-role__who) { margin: 0; }
.etgj .sv-managed-roles__note { margin: 4px 0 0 64px; padding-top: 16px; border-top: 1px solid var(--line); font: 400 var(--fs-small)/1.45 var(--ff); color: var(--grey); }


@media (max-width: 960px) {
  .etgj .sv-managed-across, .etgj .sv-managed-roles { grid-column: 1 / -1; padding-left: 0; }
  .etgj .sv-managed-roles { margin-top: 40px; }
  .etgj .sv-role { grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; }
  .etgj .sv-role:not(:last-child)::before { left: 19.5px; top: 48px; }
  .etgj .sv-managed-roles__note { margin-left: 0; }
}

/*
 * Services page, 05-technician. PROOF's case with the technician photo; the four responsibilities as hairline rows
 * (the Corrections range's spec rows: label in grey, the line in ink-2).
 */
.etgj .sv-tech { align-items: stretch; }
.etgj .sv-tech .etgj-case__text p:not(.etgj-eyebrow) { margin-bottom: 20px; }
.etgj .sv-tech__duties { margin: 12px 0 0; border-bottom: 1px solid var(--line); }
.etgj .sv-tech__duties > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); column-gap: 20px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); }
.etgj .sv-tech__duties dt { font: 400 var(--fs-body)/1.4 var(--ff); color: var(--ink); }
.etgj .sv-tech__duties dd { margin: 0; color: var(--ink-2); }

@media (max-width: 960px) {
  .etgj .sv-tech__duties > div { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
}

/* "The role can include:" over the duties (the brief's wording), and the Managed Services action closing the block */
.etgj .sv-tech .etgj-case__text p.sv-tech__lead { margin: 4px 0 0; font: 400 var(--fs-small)/1.4 var(--ff); color: var(--grey); }
.etgj .sv-tech__lead + .sv-tech__duties { margin-top: 8px; }
.etgj .sv-tech__action { margin-top: 28px; }

/* Nov 20: the technician photo is cropped tall here; keep the technician (at the left of the frame) in view */
.etgj .sv-tech img.etgj-case__img { object-position: 4% 50%; }

/*
 * Services page, 06-reach. Two hairline cells (6 + 6) of one shape; then the homepage's people grid, one row of four,
 * each with a line on their part in an engagement under the role.
 */
.etgj .sv-reach__title { margin: 0 0 12px; font: 400 var(--fs-subtitle)/1.15 var(--ff-display); letter-spacing: -0.02em; color: var(--ink); }
.etgj .sv-reach p { margin: 0 0 20px; max-width: 34em; }
.etgj .sv-reach p:last-child { margin-bottom: 0; }

/* Nov 19: the hub's stats row (.etgj-stats, four across, as on Courts) between the two reach cells and the team.
   It continues the reach cells' hairline grid: no gap, and no top rule of its own (the cells' bottom rule is shared). */
.etgj .sv-reach-stats { margin-top: 0; background: var(--rule-grad) left bottom / var(--rule-w, 100%) var(--rule-h) no-repeat; }

.etgj .sv-team-head { margin: var(--head-gap) 0 0; }
.etgj .sv-team-head .etgj-feature__title { margin: 0; }
.etgj .sv-team-head + .sv-team { margin-top: 32px; }
.etgj .sv-team__line { margin: 12px 0 0; font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }

/*
 * Services page, 07-closing. Nov 30 (Robbie): the enquiry form is gone and the page ends like the others: the shared
 * centred closing in a sheet of its own (spacing as on Corrections), with an invite line under the headline (as on Why ET Group).
 */
.etgj .sv-closing .etgj-closing { padding-top: calc(var(--sheet-y) - var(--sheet-top)); }
.etgj .sv-closing .etgj-closing__title { margin-bottom: 20px; }
.etgj .sv-closing__invite { max-width: 36em; margin: 0 0 32px; font: 400 var(--fs-body)/1.55 var(--ff); color: var(--ink-2); text-wrap: pretty; }

@media (max-width: 960px) {
  .etgj .sv-closing .etgj-closing { padding-top: 0; }
}

/* Nov 27: the Overview links straight to a service section (#etgj-managed); keep its top clear of the sticky sub-nav. */
.etgj section[id] { scroll-margin-top: calc(var(--subnav-h, 64px) + 24px); }
