/* =========================================================================
   TPC Legal template (/privacy-policy/, /terms/).

   ADOPTED VERBATIM from 05-Rollout-5/hifi/legal.css on 2026-11-17.

   What was here before was a RENAME of this file: every `.tpc-post__content`
   rule rewritten as `.tpc-legal-content`, because legal.php emitted a
   hand-written `.tpc-legal-content` div instead of the design's own
   `.tpc-post__content .tpc-kh-drawer__body .tpc-legal-content` trio. The
   rename was not harmless. The rules it could not reach - the paragraph,
   list, link and measure typography that lives on `.tpc-kh-drawer__body`
   in knowledge-hub.css - had to be re-derived by hand, and with them came
   three inventions that overrode the real components this page already
   loads:

     .tpc-kh-panel { max-width: 760px; ... }   capped the reading card at
         760px where the design's own rule (knowledge-hub.css:57, which
         this page loads and which this theme already carries byte-identical)
         declares no max-width at all. The panel rendered 504px narrower
         than the design and the column inside it sat 252px off centre.
     .tpc-sec.tpc-legal-body-sec { padding-block }   re-stated
         `.tpc-kh-page.band`'s own padding under a different class name.
     .tpc-legal .tpc-visually-hidden   re-stated the utility that
         foundation-shared.css already provides sitewide.

   legal.php now emits the design's classes, so this file is the design's
   file. Nothing is scoped or renamed. The only rules that look unfamiliar
   (.tpc-back-to-top, the .tpc-crumbs phone rules) were always part of this
   sheet; they were dropped in the original port and are back.
   ========================================================================= */

/**
 * The Traffic Plans Company - Legal template (/privacy-policy/, /terms/)
 * Rollout 5 - THEA-716
 *
 * ARCHITECTURE: this page is the Knowledge family (benchmark-knowledge.md),
 * built 1:1 to 04-Rollout-4/hifi/blog-post.html's structure - same hero tier,
 * same red strip, same band-panel_grey/white-panel ground, same 640px
 * reading column. Everything that already exists is linked, not retyped:
 *   design-tokens.css / components.css   - furniture, bands, buttons
 *   homepage.css                         - header, burger menu, dock, footer,
 *                                           splash, .render-placeholder
 *   knowledge-hub.css (04-Rollout-4)     - .tpc-kh-page / .tpc-kh-panel ground,
 *                                           .tpc-kh-drawer__body reading
 *                                           typography, .tpc-shero--orange
 *                                           colour/size base
 *   blog.css (04-Rollout-4)              - .tpc-crumbs breadcrumb, the
 *                                           .tpc-shero--orange.tpc-shero--sub
 *                                           30vh tier, .tpc-post-hero sizing,
 *                                           .tpc-post-reading / .tpc-post__cover
 *                                           / .tpc-post__content layout
 * This file adds ONLY what legal text needs that a blog post does not: a
 * last-updated line, numbered h2 sections with an optional on-page contents
 * list, definition list and table styles, a blockquote style, and a callout
 * treatment for the lo-fi's own .tpc-placeholder-note class so the placeholder
 * state reads as an honest notice rather than body copy. No hero, no breadcrumb,
 * no reading-column rule is restated here - see blog.css for those.
 */

/* ─────────────────────────────────────────────────────────────────────
   LAST-UPDATED LINE - sits above the body copy, inside the reading column.
   Only rendered where a real date exists (the specimen uses a bracketed
   placeholder per the brief; privacy-policy.html and terms.html have no
   date in the locked lo-fi, so they render no line at all rather than
   invent one).
   ───────────────────────────────────────────────────────────────────── */
.tpc-legal__updated {
  margin: 0 0 var(--primitive-space-5);
  font-size: 13.5px;
  color: var(--primitive-ink);
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────────────
   NUMBERED H2 SECTIONS - a legal policy reads as numbered clauses; a blog
   post does not, so .tpc-post__content's own h2 rule (blog.css: 19px/700/
   asphalt) is reused as-is and this only layers a counter in front of it.
   Inert on privacy-policy.html/terms.html today (no h2 in the locked
   placeholder copy), active the day a real policy with sections lands.
   ───────────────────────────────────────────────────────────────────── */
.tpc-legal-content { counter-reset: tpc-legal-section; }
.tpc-legal-content h2 { counter-increment: tpc-legal-section; }
.tpc-legal-content h2::before {
  content: counter(tpc-legal-section) ". ";
  color: var(--primitive-orange);
  font-weight: 800;
}
.tpc-post__content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primitive-asphalt);
  margin: 1.2em 0 0.4em;
}

/* ─────────────────────────────────────────────────────────────────────
   ON-PAGE CONTENTS LIST - optional (brief), built for a policy long enough
   to need one. A filled panel-grey card, not outlined, consistent with the
   site's no-outline rule.
   ───────────────────────────────────────────────────────────────────── */
.tpc-legal-toc {
  margin: 0 0 var(--primitive-space-6);
  padding: var(--primitive-space-4) var(--primitive-space-5);
  background: var(--primitive-panel-grey);
  border-radius: 16px;
}
.tpc-legal-toc__title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primitive-ink);
  margin: 0 0 8px;
}
.tpc-legal-toc ol { margin: 0; padding-left: 1.2em; }
.tpc-legal-toc li { margin-bottom: 4px; }
.tpc-legal-toc a {
  color: var(--primitive-asphalt);
  text-decoration: underline;
  text-decoration-color: var(--primitive-orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   PLACEHOLDER STATE - the lo-fi's own .tpc-placeholder-note class (present
   verbatim in original-site/privacy-policy/ and /terms/), given a callout
   treatment so it reads as a notice about the copy, not as more of the
   copy. The wording is never touched here, only the box around it.
   ───────────────────────────────────────────────────────────────────── */
.tpc-post__content .tpc-placeholder-note {
  margin: var(--primitive-space-5) 0 0;
  padding: var(--primitive-space-4) var(--primitive-space-5);
  background: var(--primitive-panel-grey);
  border-left: 3px solid var(--primitive-orange);
  border-radius: var(--primitive-radius-lg);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--primitive-ink);
}
.tpc-post__content .tpc-placeholder-note:last-child { margin-bottom: 0; }

/* ─────────────────────────────────────────────────────────────────────
   DEFINITION LIST - for glossary-style terms inside a policy.
   ───────────────────────────────────────────────────────────────────── */
.tpc-post__content dl { margin: 0 0 1.4em; }
.tpc-post__content dt {
  font-weight: 700;
  color: var(--primitive-asphalt);
  margin-top: 0.8em;
}
.tpc-post__content dt:first-child { margin-top: 0; }
.tpc-post__content dd { margin: 2px 0 0; padding-left: 1em; }

/* ─────────────────────────────────────────────────────────────────────
   TABLE - filled header row (panel-grey), hairline rules between rows,
   never a boxed/bordered grid.
   ───────────────────────────────────────────────────────────────────── */
.tpc-post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4em 0 1.4em;
  font-size: 15px;
}
.tpc-post__content th,
.tpc-post__content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--band-hairline);
  vertical-align: top;
}
.tpc-post__content th {
  font-weight: 700;
  color: var(--primitive-asphalt);
  background: var(--primitive-panel-grey);
}
.tpc-post__content tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────────────────────────────
   BLOCKQUOTE - the orange rule the brand already uses on pull-quotes
   elsewhere (homepage.css .tpc-testimonial-feature__quote), restated at
   reading-column scale rather than linked, since that rule lives inside a
   card component this page does not use.
   ───────────────────────────────────────────────────────────────────── */
.tpc-post__content blockquote {
  margin: 1.4em 0;
  padding: var(--primitive-space-4) var(--primitive-space-5);
  border-left: 3px solid var(--primitive-orange);
  background: var(--primitive-panel-grey);
  border-radius: 0 var(--primitive-radius-lg) var(--primitive-radius-lg) 0;
  font-size: 17px;
  font-style: italic;
  color: var(--primitive-asphalt);
}
.tpc-post__content blockquote p { margin: 0; }
.tpc-post__content blockquote cite {
  display: block;
  margin-top: 0.5em;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  color: var(--primitive-ink);
}

/* ─────────────────────────────────────────────────────────────────────
   ORDERED + NESTED LISTS - .tpc-kh-drawer__body only styles ul; a policy
   needs ol too, plus a list nested inside a list item.
   ───────────────────────────────────────────────────────────────────── */
.tpc-post__content ol { margin: 0 0 1em; padding-left: 1.2em; }
.tpc-post__content ol li { margin-bottom: 0.4em; }
.tpc-post__content ul ul,
.tpc-post__content ol ol,
.tpc-post__content ul ol,
.tpc-post__content ol ul { margin: 0.4em 0 0; }

/* ─────────────────────────────────────────────────────────────────────
   INTERNAL SPECIMEN NOTE - legal-specimen.html only. A dashed, tinted
   callout clearly distinct from the placeholder-note treatment above so
   the two meanings ("this copy is a placeholder" vs "this whole page is
   an internal type specimen") never read as the same thing.
   ───────────────────────────────────────────────────────────────────── */
.tpc-legal-specimen-note {
  margin: 0 0 var(--primitive-space-6);
  padding: var(--primitive-space-4) var(--primitive-space-5);
  background: #FFF4E5;
  border: 1px dashed var(--primitive-orange);
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--primitive-asphalt);
}
.tpc-legal-specimen-note strong { color: var(--primitive-asphalt); }

@media (prefers-reduced-motion: reduce) {
  .tpc-post__content { scroll-behavior: auto; }
}

/* ─────────────────────────────────────────────────────────────────────
   THEA-834 - MOBILE PARITY, GLOSSARY TABLE. table-layout's default auto
   split gives the "Term" and "Meaning" columns roughly equal width
   regardless of what each actually needs. Measured live at 390px (CDP
   computed styles, not eyeballed): a 278px-wide table split ~139/139
   wraps a 2-3 word term across 3 lines AND squeezes a full sentence into
   the same 139px, pushing one glossary row to 585px tall - the table as
   a whole ran 1616px for 6 rows. That is the brief's exact "overflow is
   not the same as legible" case: THEA-798 already confirmed zero
   horizontal overflow, but the auto layout is still unreadable.
   Fix: below 699px the table drops the rigid 2-column grid and stacks
   each row as a term-over-meaning block, identical in spirit to the
   .tpc-post__content dl immediately below it on legal-specimen.html
   (bold dt, plain dd, both full width, no printed "Term:"/"Meaning:"
   label) - confirmed that pattern already reads cleanly at this width.
   The header row is kept in the DOM for screen readers (sr-only clip,
   not display:none) since the per-row bold term alone carries the
   visual label. Scoped to .tpc-post__content so it cannot reach any
   other table on the site; this file is linked only by the 3 legal
   pages, and only legal-specimen.html has a table today. */
@media (max-width: 699px) {
  .tpc-post__content table,
  .tpc-post__content tbody,
  .tpc-post__content tr,
  .tpc-post__content td {
    display: block;
    width: 100%;
  }
  .tpc-post__content thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .tpc-post__content tr {
    padding: var(--primitive-space-3) 0;
    border-bottom: 1px solid var(--band-hairline);
  }
  .tpc-post__content tr:last-child { border-bottom: none; }
  .tpc-post__content td {
    padding: 0;
    border-bottom: none;
  }
  .tpc-post__content td:first-child {
    font-weight: 700;
    color: var(--primitive-asphalt);
    background: none;
    margin-bottom: 4px;
  }
  .tpc-post__content td + td { margin-top: 2px; }
}


/* ─────────────────────────────────────────────────────────────────────
   FOUNDER 2026-10-22: "fix the 3 service hero sections for mobile, the
   breadcrumb trail doesn't feel balanced."

   CAUSE: .tpc-crumbs is a flex row holding two items, the circular back
   control and the <ol> trail. Once the hero copy centres on mobile, the
   trail's TEXT centres inside the <ol> but the row itself still starts at
   the left edge - so the back button hangs off to one side of a centred
   block of text and the whole unit reads lopsided.

   Centring the ROW keeps the button and the trail together as one group on
   the hero's centre line. align-items: flex-start is kept from the existing
   fix so the button still sits beside the FIRST line when a long page title
   wraps, rather than floating against the middle of the wrapped block.
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 699px) {
  .tpc-crumbs {
    justify-content: center;
    align-items: flex-start;
    text-align: center;
  }
  .tpc-crumbs__list { justify-content: center; flex-wrap: wrap; }
}

/* ─────────────────────────────────────────────────────────────────────
   BREADCRUMB BALANCE, corrected twice. 2026-10-22.

   Attempt 1 set justify-content: center. No effect - .tpc-crumbs__back is
   `position: absolute` here, so a flex alignment on its parent cannot reach
   it. Attempt 2 forced it back into flow; the row then centred correctly but
   STILL looked wrong, and the real-device render showed why: the trail is two
   full-width lines, so [back][trail] already fills the row and "centred as a
   group" puts the button hard against the left edge anyway.

   The fix is to stop showing a redundant control at phone width. The back
   chevron's own markup comment says it "goes to the same place the first
   crumb does" - and the first crumb, "Our services", is a link to exactly
   that. On a 390px screen it is a second tap target for a destination already
   one tap away, bought at the cost of the balance the founder asked for.
   Hidden below 699px, leaving a clean centred trail. Desktop keeps it.
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 699px) {
  .tpc-crumbs {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    text-align: center;
  }
  .tpc-crumbs__back { display: none; }
  .tpc-crumbs__list {
    justify-content: center;
    flex-wrap: wrap;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
  }

  /* The separator dot. With the trail stacked on two centred lines it ends
     up orphaned on its own row at the left - visible in the 390px render as
     a stray bullet. Each crumb now takes its own centred line and the
     separator is dropped, which is what divides them instead. */
  .tpc-crumbs__list { flex-direction: column; align-items: center; gap: 2px; }
  .tpc-crumbs__item + .tpc-crumbs__item::before { content: none; }
  .tpc-crumbs__item { justify-content: center; text-align: center; }
}

/* ─────────────────────────────────────────────────────────────────────
   THEA-869 - MOBILE REDESIGN PASS: TOC CARVE-OUT + BACK-TO-TOP.

   1. .tpc-legal-toc never made it into the sitewide "all text centres
   below 699px" carve-out (homepage.css ~6965+): that carve-out only
   reaches .tpc-legal-content and its descendants, and the TOC nav is a
   SIBLING of .tpc-legal-content, not inside it, so .band__inner's
   text-align:center inherits straight through it uncontested. Confirmed
   live on legal-specimen.html (the only page carrying a real TOC today,
   until the client's reviewed policy gives privacy-policy.html/terms.html
   real headings to index): a numbered <ol> with its digits pinned to the
   left edge but its own text centred reads as a ransom note, not an
   index - the opposite of the scannable "find a clause" job this
   component exists to do. Left-aligned here on the same carve-out
   pattern already used for .tpc-legal-content (doubled class beats
   .band__inner's text-align:center on cascade order - legal.css loads
   after homepage.css on every page that links it - so no !important is
   needed). legal-specimen.html's own internal type-specimen callout
   gets the identical fix for the identical reason, even though that page
   itself is not in this task's scope.

   2. A BACK-TO-TOP CONTROL, phone only. The template already gives a
   reader a way to jump IN to a clause (the numbered h2s, and the "On
   this page" index once real copy supplies headings) - there was
   nothing to jump back OUT with once they had scrolled past it, which is
   the other half of "is there a way to find a clause" on a document long
   enough to need one. Shown only once the hero has scrolled off screen
   (no reason to show it above its own target) and hidden again the
   moment the footer appears - the dock's fixed bottom strip climbs to
   rest ON the footer right at that point (homepage.css's
   dockMeetsFooter), and THEA-838 already flagged that strip as a
   standing tap-target collision risk for anything else anchored to the
   viewport bottom. Sitting the button above that strip at rest
   (bottom: 74px = the dock's own closed-state 58px plus 16px clearance)
   and one z-index layer below it (80 vs the dock's 90) means an opened
   dock panel always sits on top of this control, never the reverse.
   Markup + the show/hide script live in privacy-policy.html and
   terms.html only (THEA-869 scope); not added to legal-specimen.html or
   404.html.
   ───────────────────────────────────────────────────────────────────── */
.tpc-back-to-top { display: none; }

@media (max-width: 699px) {
  .tpc-legal-toc.tpc-legal-toc,
  .tpc-legal-toc.tpc-legal-toc *,
  .tpc-legal-specimen-note.tpc-legal-specimen-note,
  .tpc-legal-specimen-note.tpc-legal-specimen-note * {
    text-align: left;
  }

  .tpc-back-to-top {
    display: flex;
    position: fixed;
    right: 14px;
    bottom: 74px;
    z-index: 80;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 10px 14px;
    background: var(--primitive-asphalt);
    color: var(--primitive-white);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(34, 34, 34, 0.28);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--primitive-duration-fast) var(--primitive-easing-out),
                transform var(--primitive-duration-fast) var(--primitive-easing-out);
  }
  .tpc-back-to-top[data-visible] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .tpc-back-to-top svg { flex: none; }
}

/* ─────────────────────────────────────────────────────────────────────
   SELF-NUMBERED POLICIES - v12.80. The numbered-h2 counter above assumes
   the source copy has NO numbers of its own and the CSS supplies them.
   TPC's real privacy policy does carry them ("1. What is personal
   information?"), ported verbatim from the live site, and its only h2 is
   the document's own title. Left alone, the counter renders that title as
   "1. WEBSITE PRIVACY POLICY" in orange, and double-numbers any policy
   whose clauses are already numbered.

   This opt-in class turns the counter off and sizes the clause headings
   instead. The generic numbered-h2 system is untouched for terms.html or
   any future policy that does need CSS to do the numbering.

   Clause headings are h3 here because h2 is the document title, which
   mirrors the live page's own hierarchy exactly. 17px with body text also
   at 17px left them doing no work, so they step up to 19px - the same
   size .tpc-post__content h2 uses - and keep the asphalt/700 treatment.
   ───────────────────────────────────────────────────────────────────── */
.tpc-legal-content--self-numbered { counter-reset: none; }
.tpc-legal-content--self-numbered h2 { counter-increment: none; }
.tpc-legal-content--self-numbered h2::before { content: none; }

.tpc-legal-content--self-numbered h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primitive-asphalt);
  margin: 1.9em 0 0.5em;
}
