/**
 * Single service pages (V4 board "Services", service view), single service and editor only (inc/services.php).
 * Spacing, borders, radii, colours of blocks and type sizes are set in the Kadence blocks of Element "Single Service".
 * This file holds only what no Kadence control can express; each section says why. Colours read the Kadence palette,
 * except the fixed V4 dark workflow panel (#151515 family) and the brand orange (docs/v4/color-system.md).
 * Values come from design-reference/v4/project/tv.css (line numbers given).
 */

/* S1. "Who this is for" list (tv.css .card ul, 17px rows 12px apart). Why CSS: the list is Core's computed HTML in a
   Dynamic HTML block, which styles headings and links but not list items. Reuses the package check list. */
.tv-who-list.tv-pkg-features { gap: 12px; font-size: 16.5px; color: var(--global-palette4); }

/* S2. Sitemap tree (tv.css Services 03: mono rows behind a 2px rule, "├" before each page and "└" before the last).
   Why CSS: the branch characters depend on the row's position in the Repeater, which no block setting knows. */
.tv-tree .wp-block-kadence-repeatertemplate > li { display: flex; gap: 8px; align-items: baseline; }
.tv-tree .wp-block-kadence-repeatertemplate > li::before { content: "├"; flex: none; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--global-palette5); }
.tv-tree .wp-block-kadence-repeatertemplate > li:last-child::before { content: "└"; }

/* S3. Stage numbers (tv.css .num "Stage 1"). Why CSS: the Repeater has no row index to print. */
.tv-stages .wp-block-kadence-repeatertemplate { counter-reset: tvstage; }
.tv-stages .wp-block-kadence-repeatertemplate > li { counter-increment: tvstage; }
.tv-stages .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col::before { content: "Stage " counter(tvstage); display: block; margin-bottom: 4px; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--global-palette10); }

/* S4. Label and text list (tv.css 1064-1069 .scope: label column 150 to 220px, rows divided by hairlines, no line
   above the first row). Why CSS: a Section's children cannot get a clamped fixed width beside a flexible one, and the
   first row of a Repeater cannot have its own border. Used by "Typical engagement" and the review-areas visual. */
.tv-scope .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 20px; }
.tv-scope .wp-block-kadence-repeatertemplate > li:first-child > .wp-block-kadence-column { border-top: 0 !important; }
@media (max-width: 560px) { .tv-scope .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* S5. Example workflow (tv.css 965-971 .fl-card): numbered chips and the dashed orange wire between steps. Why CSS:
   the number comes from the row position and the wire sits between rows, outside any block. Chips use orange tints
   only (brand rule: no blue or purple accents); V4 draws the fourth chip green, kept here for "email". */
.tv-flow .wp-block-kadence-repeatertemplate { counter-reset: tvflow; }
.tv-flow .wp-block-kadence-repeatertemplate > li { counter-increment: tvflow; position: relative; }
.tv-flow .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col::before { content: counter(tvflow); flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #3A2018; color: #FF9A80; }
.tv-flow .wp-block-kadence-repeatertemplate > li:nth-child(4) > .wp-block-kadence-column > .kt-inside-inner-col::before { background: #1D3326; color: #7EE2A8; }
.tv-flow .wp-block-kadence-repeatertemplate > li + li::before { content: ""; position: absolute; left: 21px; top: -10px; width: 2px; height: 10px; background: repeating-linear-gradient(#F05A35 0 3px, transparent 3px 6px); }
.tv-flow .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col > :last-child { margin-left: auto !important; }

/* S6. Process timeline (tv.css 1017-1024 .proc): numbered 48px circles on an orange-to-grey line, one column per step;
   vertical with the line on the left below 980px. Why CSS: the Repeater has a fixed column count while services have
   four or five steps, and the circles, numbers and line are drawn around the rows. */
.tv-proc .wp-block-kadence-repeatertemplate { position: relative; counter-reset: tvproc; }
@media (min-width: 981px) {
	.tv-proc .wp-block-kadence-repeatertemplate { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 0 !important; }
	.tv-proc .wp-block-kadence-repeatertemplate::before { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 2px; background: linear-gradient(90deg, var(--global-palette1), var(--global-palette7)); }
	.tv-proc .wp-block-kadence-repeatertemplate > li { padding-right: 18px; }
}
.tv-proc .wp-block-kadence-repeatertemplate > li { counter-increment: tvproc; position: relative; }
.tv-proc .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col::before { content: counter(tvproc, decimal-leading-zero); position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--global-palette9); border: 2px solid var(--global-palette1); font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 600; color: var(--global-palette3); }
@media (max-width: 980px) {
	.tv-proc .wp-block-kadence-repeatertemplate::before { content: ""; position: absolute; left: 23px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--global-palette1), var(--global-palette7)); }
	.tv-proc .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col { display: grid !important; grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; }
	.tv-proc .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col::before { grid-row: 1 / span 4; margin: 0; }
	.tv-proc .wp-block-kadence-repeatertemplate > li > .wp-block-kadence-column > .kt-inside-inner-col > * { grid-column: 2; }
}

/* S7. FAQ accordion (tv.css 692-699 .faq): details and summary from Core (Kadence's Accordion cannot repeat over ACF
   rows). Why CSS: the markup is computed HTML, so no block holds these settings. */
.tv-faq { display: grid; gap: 10px; }
.tv-faq details { border: 1px solid var(--global-palette7); border-radius: 16px; background: var(--global-palette9); transition: border-color .2s, box-shadow .2s; }
.tv-faq details[open] { border-color: var(--global-palette6); box-shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 10px 30px -8px rgba(20, 20, 20, .12); }
.tv-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--global-palette3); }
.tv-faq summary::-webkit-details-marker { display: none; }
.tv-faq summary:focus-visible { outline: 3px solid var(--global-palette3); outline-offset: 2px; border-radius: 16px; }
.tv-faq-pm { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--global-palette8); transition: transform .25s, background .25s; }
.tv-faq-pm::before, .tv-faq-pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: currentColor; }
.tv-faq-pm::after { transform: rotate(90deg); }
.tv-faq details[open] .tv-faq-pm { transform: rotate(45deg); background: var(--global-palette1); color: #1A1A1A; }
.tv-faq-a { padding: 0 22px 20px; max-width: 68ch; color: var(--global-palette4); font-size: 16px; line-height: 1.6; }
.tv-faq-a p { margin: 0; }

/* S8. Band colours when the related-work band is hidden (tv.css .sec / .sec.alt alternate). Why CSS: Conditional
   Display removes the band, and a Row Layout cannot change its background based on its neighbour. */
.tv-band-pk + .tv-band-proc { background: var(--global-palette9) !important; }
.tv-band-pk + .tv-band-proc + .tv-band-faq { background: var(--global-palette8) !important; }

/* S9. Mobile action bar (approved addition, 21 Nov 2026): a fixed bar with the main button after the hero buttons
   scroll away, hidden again at the closing band (assets/js/services.js). Why CSS and JS: Kadence has no fixed bottom
   bar and no scroll-position condition. Without the script the bar stays hidden; every button it repeats is on the page. */
.tv-mbar { display: none; }
@media (max-width: 767px) {
	.tv-mbar.is-ready { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--global-palette9) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--global-palette7); transform: translateY(110%); visibility: hidden; transition: transform .25s, visibility 0s .25s; }
	.tv-mbar.is-ready.is-on { transform: none; visibility: visible; transition: transform .25s; }
	.tv-mbar .wp-block-kadence-advancedbtn { flex-wrap: nowrap !important; }
	.tv-mbar .wp-block-kadence-singlebtn:first-child { flex: 1; }
	body.single-service { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { .tv-mbar.is-ready, .tv-faq details, .tv-faq-pm { transition: none; } }
