/* Shared styles for the technical guide pages (2026-08-06):
   actuator-sizing-guide, hydraulic-vs-pneumatic-actuators,
   fail-safe-esd-actuator-selection. Prefix .sg- = 'site guide'.

   THEMING: this site switches themes with a manual toggle that sets
   [data-theme="dark"] on the root element (see css/dark-mode.css) — it does
   NOT rely on prefers-color-scheme. An earlier version of this file used a
   @media (prefers-color-scheme: dark) block, which was wrong twice over: it
   never fired when a visitor used the site's own toggle, and it DID fire for
   OS-dark visitors who had the site in light mode. All dark rules below are
   therefore keyed to [data-theme="dark"].

   Boxes that set their own background must also set their own text colour.
   Inheriting it means the body colour flips with the theme while the panel
   background does not — which is exactly how the draft banner ended up with
   near-white text on pale yellow.
*/

/* ---------- hero ---------- */
.sg-hero{background:linear-gradient(135deg,#0f1729 0%,#1a2332 50%,#141c2b 100%);padding:56px 0;color:#fff;}
.sg-hero .container{max-width:900px;margin:0 auto;padding:0 24px;}
.sg-hero h1{font-size:2.3rem;font-weight:700;margin:0 0 14px;line-height:1.2;color:#fff;}
.sg-hero p{font-size:1.06rem;opacity:.9;margin:0;max-width:700px;line-height:1.6;}

/* ---------- body ---------- */
.sg-body{max-width:900px;margin:0 auto;padding:44px 24px 70px;}
.sg-body h2{font-size:1.5rem;margin:44px 0 14px;padding-top:8px;}
.sg-body h3{font-size:1.1rem;margin:26px 0 8px;}
.sg-body p,.sg-body li{line-height:1.7;font-size:1rem;}
.sg-body ul,.sg-body ol{padding-left:22px;}
.sg-body li{margin-bottom:8px;}

/* ---------- table of contents ---------- */
.sg-toc{background:#f6f7f9;color:#1a1a2e;border:1px solid #e3e5e9;border-radius:10px;
        padding:20px 24px;margin:0 0 34px;}
.sg-toc h2{margin:0 0 10px;font-size:.8rem;text-transform:uppercase;letter-spacing:.07em;color:#6b7280;}
.sg-toc ol{margin:0;padding-left:20px;}
.sg-toc li{margin-bottom:5px;}
/* :link and :visited are both stated explicitly. These are in-page anchors, so
   every one of them becomes :visited the moment the reader uses the contents
   list — and an unstyled visited link falls back to the browser's dark purple,
   which is unreadable on the dark panel. */
.sg-toc a,.sg-toc a:link,.sg-toc a:visited{color:#0a2540;text-decoration:none;
        display:inline-block;}
.sg-toc a:hover,.sg-toc a:focus{color:#c8102e;text-decoration:underline;}

/* ---------- jump-link behaviour ----------
   Clicking an entry glides to the section rather than teleporting, so the
   reader keeps their bearings on a long page.

   Two things have to be right for this to work:

   1. The selector must be :root, not html. The guides don't load theme.css
      today, but other templates do, and it declares
      @media (prefers-reduced-motion: no-preference){ :root{scroll-behavior:auto} }
      — same specificity, so only a later :root rule beats it. `html{...}` is
      weaker and loses silently. Matching the same media query is deliberate:
      it keeps the reduced-motion opt-out that theme.css was honouring, and
      readers who ask for less motion still get an instant jump.

   2. The site header is position:sticky;top:0 (~96px tall), so a heading
      scrolled to 0 sits *behind* it. scroll-margin-top parks each heading
      clear of the header instead. */
@media (prefers-reduced-motion: no-preference){
    :root{scroll-behavior:smooth;}
    .sg-toc a{transition:transform .18s ease,color .18s ease;}
    .sg-toc a:hover,.sg-toc a:focus{transform:translateX(3px);}
}
.sg-body h2[id]{scroll-margin-top:112px;}

/* Confirms where the glide ended — the accent fades out on its own so it
   marks the landing without permanently restyling the heading. */
.sg-body{--sg-land:200,16,46;}
.sg-body h2[id]:target{animation:sg-land 1.6s ease-out;}
@keyframes sg-land{
    from{box-shadow:inset 4px 0 0 rgba(var(--sg-land),1);padding-left:14px;}
    to  {box-shadow:inset 4px 0 0 rgba(var(--sg-land),0);padding-left:0;}
}
@media (prefers-reduced-motion: reduce){
    .sg-body h2[id]:target{animation:none;}
}

/* ---------- callouts ---------- */
.sg-callout{border-left:4px solid #c8102e;background:rgba(200,16,46,.05);padding:16px 20px;
            margin:22px 0;border-radius:0 8px 8px 0;}
.sg-callout strong{color:#c8102e;}

/* ---------- tables ---------- */
.sg-table{width:100%;border-collapse:collapse;margin:22px 0;font-size:.94rem;}
.sg-table th,.sg-table td{border:1px solid #e0e0e0;padding:10px 12px;text-align:left;vertical-align:top;}
.sg-table th{background:#f4f5f7;font-weight:700;font-size:.84rem;text-transform:uppercase;letter-spacing:.03em;}
.sg-table td a{color:#c8102e;font-weight:600;text-decoration:none;}
.sg-table td a:hover{text-decoration:underline;}

/* Model-selection table: keep each model designation on one line. Paired names
   like "HX / HXN" and "EX / EXE" are one product page, not two, and a line
   break after the slash reads as two separate models. Browsers treat "/" as a
   break opportunity, so nowrap is what stops it — the names are short enough
   that holding them together costs the other columns nothing. */
.sg-models td:first-child{white-space:nowrap;}

/* ---------- numbered steps ---------- */
.sg-steps{counter-reset:sgstep;list-style:none;padding:0;}
.sg-steps>li{counter-increment:sgstep;position:relative;padding-left:52px;margin-bottom:26px;}
.sg-steps>li::before{content:counter(sgstep);position:absolute;left:0;top:0;width:34px;height:34px;
    border-radius:50%;background:#c8102e;color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center;}

/* ---------- closing CTA (dark by design in both themes) ---------- */
.sg-cta{background:#0f1729;color:#fff;border-radius:12px;padding:32px;margin:48px 0 0;text-align:center;}
.sg-cta h2{margin:0 0 10px;color:#fff;}
.sg-cta p{opacity:.88;max-width:600px;margin:0 auto 22px;}

/* ---------- FAQ ---------- */
.sg-faq dt{font-weight:700;margin-top:20px;}
.sg-faq dd{margin:6px 0 0;padding:0;line-height:1.7;}

/* ---------- internal draft banner ---------- */
.sg-review{background:#fff8e1;color:#4a3708;border:2px solid #f5a623;border-radius:8px;
           padding:16px 20px;margin:0 0 26px;font-size:.92rem;line-height:1.6;}
.sg-review strong{color:#8a5a00;}
.sg-review code{background:rgba(0,0,0,.07);color:#4a3708;padding:1px 5px;border-radius:4px;
                font-size:.9em;}

/* =========================================================================
   DARK THEME — keyed to the site's own toggle, not the OS preference.
   ========================================================================= */
[data-theme="dark"] .sg-toc{background:#1a1f28;color:#e6e8ec;border-color:#39404d;}
[data-theme="dark"] .sg-toc h2{color:#9aa3b2;}
[data-theme="dark"] .sg-toc ol li a,
[data-theme="dark"] .sg-toc ol li a:link,
[data-theme="dark"] .sg-toc ol li a:visited{color:#eef1f6;text-decoration:none;}
[data-theme="dark"] .sg-toc ol li a:hover,
[data-theme="dark"] .sg-toc ol li a:focus{color:#ff8b9d;text-decoration:underline;}

/* Landing accent tracks the dark palette's lighter red — the light-mode
   #c8102e is nearly invisible against #1a1f28. */
[data-theme="dark"] .sg-body{--sg-land:255,107,129;}

[data-theme="dark"] .sg-callout{background:rgba(255,107,129,.10);border-left-color:#ff6b81;}
[data-theme="dark"] .sg-callout strong{color:#ff8b9d;}

[data-theme="dark"] .sg-table th{background:#222732;}
[data-theme="dark"] .sg-table th,[data-theme="dark"] .sg-table td{border-color:#3a4150;}
[data-theme="dark"] .sg-table td a{color:#ff8b9d;}

/* Amber-on-dark rather than a bright panel: keeps the "this is a draft"
   signal without a glaring block, and gives the copy real contrast instead
   of near-white text sitting on pale yellow. */
[data-theme="dark"] .sg-review{background:#2b2418;color:#f0e3c6;border-color:#9c7b32;}
[data-theme="dark"] .sg-review strong{color:#f7c565;}
[data-theme="dark"] .sg-review code{background:rgba(255,255,255,.10);color:#f0e3c6;}
