/* ============================================================
   DiagMyPCHub — BSOD from overheating / hardware instability
   Local stylesheet. Depends on the site design tokens from
   ../../../css/style.css (loaded first in <head>). All tutorial
   styles are namespaced with the "heat-" prefix so nothing leaks
   into the rest of the site.
   ============================================================ */

/* ---------- Reading progress ---------- */
.heat-progress{ position:fixed; top:0; left:0; right:0; height:3px; z-index:120; background:transparent; pointer-events:none; }
.heat-progress span{ display:block; height:100%; width:0; background:linear-gradient(90deg, var(--blue), var(--warn)); }

/* ---------- Grid: TOC + article ---------- */
.heat-grid{ display:grid; grid-template-columns:1fr; gap:40px; padding-top:clamp(32px,5vw,56px); padding-bottom:clamp(56px,8vw,96px); }

.heat-toc{ display:none; }
.heat-toc-title{ font:500 .7rem var(--font-mono); text-transform:uppercase; letter-spacing:.14em; color:var(--ink-3); margin:0 0 12px; }
.heat-toc ul{ display:grid; gap:1px; border-left:1px solid var(--line); }
.heat-toc a{ display:block; padding:6px 14px; margin-left:-1px; border-left:2px solid transparent; color:var(--ink-2); text-decoration:none; font-size:.85rem; transition:color .2s, border-color .2s; }
.heat-toc a:hover{ color:var(--ink); }
.heat-toc a[aria-current="true"]{ color:var(--blue); border-left-color:var(--blue); font-weight:500; }

/* ---------- Article head ---------- */
.heat-article{ max-width:820px; }
.heat-head h1{ font-size:clamp(1.8rem, 1.2rem + 2.4vw, 2.7rem); font-weight:700; letter-spacing:-.02em; line-height:1.12; margin:0 0 20px; }
.heat-intro{ font-size:1.05rem; color:var(--ink-2); line-height:1.7; margin:0 0 16px; }

/* ---------- Warning / callouts ---------- */
.heat-warn{ display:flex; gap:14px; align-items:flex-start; background:#fdf3e6; border:1px solid #f0d6a8; border-radius:var(--radius); padding:16px 18px; margin:28px 0; }
.heat-warn-ico{ flex:none; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; background:var(--warn); color:#3a2a00; font:700 .95rem/1 var(--font-display); }
.heat-warn-title{ margin:0 0 6px; font-weight:600; font-size:.98rem; }
.heat-warn-text{ margin:0; font-size:.92rem; color:#6b5320; }

.heat-callout{ border-left:3px solid var(--blue); background:var(--tint); border-radius:0 var(--radius) var(--radius) 0; padding:14px 18px; margin:24px 0; font-size:.95rem; color:var(--ink-2); }
.heat-callout a{ color:var(--blue); }
.heat-callout p{ margin:0 0 8px; }
.heat-callout p:last-child{ margin-bottom:0; }
.heat-callout strong{ color:var(--ink); }
.heat-callout.bsd-tip{ border-left-color:var(--ok); background:#eafaf3; }
.heat-callout.bsd-note{ border-left-color:var(--cyan); background:#eafaf7; }
.heat-quick{ margin:6px 0 0; padding-left:20px; }
.heat-quick li{ margin-bottom:6px; }

/* ---------- Static image placeholder (hidden until an image exists) ---------- */
.heat-figure{ margin:0 0 8px; }
.heat-figure img{ width:100%; height:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); display:block; }
.heat-figure figcaption{ margin-top:10px; font:400 .78rem var(--font-mono); color:var(--ink-3); }
.heat-figure[data-empty="true"]{ display:none; }

/* ---------- Sections ---------- */
.heat-sec{ margin-top:clamp(48px, 7vw, 72px); scroll-margin-top:calc(var(--header-h) + 16px); }
.heat-sec-head{ display:flex; align-items:flex-start; gap:16px; margin-bottom:18px; }
.heat-sec-index{ font:600 .95rem var(--font-mono); color:var(--line-2); flex:none; padding-top:4px; }
.heat-sec-kicker{ font:500 .7rem var(--font-mono); text-transform:uppercase; letter-spacing:.16em; color:var(--blue); margin:0 0 4px; }
.heat-sec-head h2{ font-size:clamp(1.3rem, 1rem + 1.2vw, 1.7rem); font-weight:600; letter-spacing:-.01em; margin:0; }
.heat-sec-lede{ color:var(--ink-2); font-size:1rem; line-height:1.7; margin:0 0 18px; max-width:70ch; }

.heat-article p{ color:var(--ink-2); line-height:1.75; margin:0 0 16px; }
.heat-article p strong, .heat-article p em{ color:var(--ink); }
.heat-article a{ color:var(--blue); text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--blue-soft); transition:text-decoration-color .2s; }
.heat-article a:hover{ text-decoration-color:var(--blue); }
.heat-article h3{ font-size:1.15rem; font-weight:600; margin:24px 0 10px; }
.heat-article ul, .heat-article ol{ margin:0 0 16px; padding-left:22px; color:var(--ink-2); line-height:1.7; }
.heat-article li{ margin-bottom:8px; }
.heat-article li::marker{ color:var(--blue); }

/* ---------- Ordered steps ---------- */
.heat-steps{ counter-reset:heat-step; list-style:none; padding:0; margin:0 0 20px; display:grid; gap:12px; }
.heat-steps > li{ counter-increment:heat-step; position:relative; padding:0 0 0 46px; margin:0; min-height:40px; }
.heat-steps > li::before{ content:counter(heat-step, decimal-leading-zero); position:absolute; left:0; top:0; width:32px; height:32px; display:grid; place-items:center; font:600 .78rem var(--font-mono); color:var(--blue-deep); background:var(--tint); border:1px solid var(--blue-soft); border-radius:9px; }
.heat-steps > li strong{ color:var(--ink); }

/* ---------- Two-column boxes ---------- */
.heat-2col{ display:grid; grid-template-columns:1fr; gap:14px; margin:22px 0; }
.heat-2col-box{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px; }
.heat-2col-box h3{ margin:0 0 10px; font-size:1rem; }
.heat-2col-box ul{ margin:0; padding-left:20px; }
.heat-2col-box li{ margin-bottom:7px; font-size:.92rem; color:var(--ink-2); }

/* ---------- Animated SVG diagram ---------- */
.heat-diagram{ margin:32px 0; background:var(--dark-2); border:1px solid var(--dark-line); border-radius:14px; padding:clamp(8px, 2vw, 18px); }
.heat-diagram svg{ width:100%; height:auto; display:block; }

.hd-glow{ animation:hdGlow 7s ease-in-out infinite alternate; transform-box:fill-box; transform-origin:center; }
@keyframes hdGlow{ from{ opacity:.55; } to{ opacity:1; transform:scale(1.04); } }

.hd-fan-frame{ fill:#0e2038; stroke:#2e5f93; stroke-width:1.5; }
.hd-fan-hub{ fill:#12314f; stroke:#2e5f93; stroke-width:1.5; }
.hd-blades{ fill:#1b3b61; stroke:#2e5f93; stroke-width:1; transform-box:fill-box; transform-origin:center; animation:hdSpin 6s linear infinite; }
@keyframes hdSpin{ to{ transform:rotate(360deg); } }

.hd-chip{ fill:#0e2038; stroke:#2e5f93; stroke-width:1.5; }
.hd-core{ fill:#ef8a3c; transform-box:fill-box; transform-origin:center; animation:hdCore 2.6s ease-in-out infinite; }
@keyframes hdCore{ 0%,100%{ transform:scale(1); opacity:.85; } 50%{ transform:scale(1.35); opacity:1; } }
.hd-thermo{ fill:none; stroke:#2e5f93; stroke-width:1.5; }
.hd-thermo-tick{ stroke:#24466f; stroke-width:1; }

.hd-temp-track{ fill:#12314f; }
.hd-temp-fill{ fill:url(#hdTempGrad); transform-box:fill-box; transform-origin:bottom; animation:hdTemp 4s ease-in-out infinite alternate; }
@keyframes hdTemp{ from{ transform:scaleY(0.45); } to{ transform:scaleY(0.92); } }
.hd-tick{ stroke:#e0533d; stroke-width:1.5; stroke-dasharray:4 3; }
.hd-led{ fill:var(--ok); transform-box:fill-box; transform-origin:center; animation:hdLed 3s ease-in-out infinite; }
@keyframes hdLed{ 50%{ transform:scale(1.3); opacity:.7; } }

.hd-signal{ stroke:#24466f; stroke-width:2; stroke-dasharray:6 10; animation:hdFlow 1.8s linear infinite; }
@keyframes hdFlow{ to{ stroke-dashoffset:-32; } }

.hd-label{ fill:#8aa3c4; font:600 12px var(--font-mono); letter-spacing:1.5px; }
.hd-status{ fill:#5b7396; font:500 12px var(--font-mono); letter-spacing:1px; }

/* ---------- Decision tree ---------- */
.heat-tree{ margin:24px 0; }
.heat-tree-status{ font:500 .72rem var(--font-mono); text-transform:uppercase; letter-spacing:.1em; color:var(--ink-3); margin:0 0 8px; min-height:1.2em; }
.heat-tree-q{ font-size:1.1rem; font-weight:600; margin:0 0 14px; min-height:1.4em; }
.heat-tree-opts{ display:grid; grid-template-columns:1fr; gap:10px; margin-bottom:16px; }
.heat-tree-btn{ text-align:left; font:500 .95rem var(--font-body); color:var(--ink); background:var(--surface); border:1px solid var(--line-2); border-radius:var(--radius); padding:13px 16px; cursor:pointer; transition:border-color .2s, background .2s, transform .15s; }
.heat-tree-btn:hover{ border-color:var(--blue); background:var(--tint); transform:translateY(-1px); }
.heat-tree-rec{ border:1px solid var(--line); border-left:3px solid var(--cyan); border-radius:var(--radius); background:var(--surface); padding:18px 20px; margin-bottom:12px; }
.heat-tree-rec p{ margin:0 0 12px; font-size:.95rem; color:var(--ink-2); line-height:1.7; }
.heat-tree-rec p:last-child{ margin-bottom:0; }
.heat-tree-rec a{ color:var(--blue); }
.heat-tree-rec strong{ color:var(--ink); }
.heat-noscript{ font-size:.9rem; color:var(--ink-2); border-left:3px solid var(--line-2); padding-left:14px; margin:0; }

/* ---------- Copyable commands ---------- */
.heat-cmd{ display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin:10px 0; }
.heat-cmd-label{ font:500 .68rem var(--font-mono); text-transform:uppercase; letter-spacing:.08em; color:var(--ink-3); min-width:88px; }
.heat-cmd code{ font:500 .82rem var(--font-mono); color:var(--ink); background:var(--tint); border-radius:6px; padding:6px 10px; overflow-x:auto; white-space:nowrap; }
.heat-cmd-copy{ font:500 .78rem var(--font-mono); color:var(--blue); background:none; border:1px solid var(--blue-soft); border-radius:7px; padding:6px 12px; cursor:pointer; transition:background .2s, color .2s; flex:none; }
.heat-cmd-copy:hover{ background:var(--blue); color:#fff; border-color:var(--blue); }
.heat-cmd-copy.is-done{ background:var(--ok); border-color:var(--ok); color:#06281c; }
.heat-cmd-note{ grid-column:1 / -1; margin:2px 0 0; font-size:.8rem; color:var(--ink-3); }

/* ---------- Checklist ---------- */
.heat-check{ background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:14px; padding:20px; }
.heat-check-file{ display:flex; justify-content:space-between; font-size:.72rem; color:var(--ink-3); border-bottom:1px dashed var(--line-2); padding-bottom:12px; margin:0 0 12px; }
.heat-check-list{ list-style:none; padding:0; margin:0; }
.heat-check-list li{ margin:0; }
.heat-check-list label{ display:flex; align-items:flex-start; gap:12px; padding:10px 8px; border-radius:8px; cursor:pointer; transition:background .15s; font-size:.93rem; color:var(--ink-2); }
.heat-check-list label:hover{ background:#f2f7ff; }
.heat-check-box{ width:18px; height:18px; margin:2px 0 0; accent-color:var(--blue); flex:none; cursor:pointer; }
.heat-check-box:checked + span{ color:var(--ink); }
.heat-check-actions{ display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.heat-check-hint{ font-size:.7rem; color:var(--ink-3); margin:0; }

/* ---------- Verdict ---------- */
.heat-verdict{ margin:28px 0 0; padding:22px; background:var(--dark-2); color:var(--dark-ink); border:1px solid var(--dark-line); border-radius:14px; }
.heat-verdict-label{ margin:0 0 14px; font:600 1.05rem var(--font-display); }
.heat-verdict-btns{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.heat-vbtn{ font:500 .88rem var(--font-body); color:var(--dark-ink); background:transparent; border:1px solid var(--dark-line); border-radius:10px; padding:10px 16px; cursor:pointer; transition:border-color .2s, background .2s, color .2s; }
.heat-vbtn:hover{ border-color:var(--cyan-bright); color:#fff; }
.heat-vbtn.is-active{ background:var(--cyan); border-color:var(--cyan); color:#04222a; }
.heat-verdict-msg{ margin:0; font-size:.9rem; color:var(--dark-muted); min-height:1.4em; }

/* ---------- FAQ (native <details>) ---------- */
.heat-faq{ display:grid; gap:10px; }
.heat-faq-item{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); transition:border-color .2s; }
.heat-faq-item[open]{ border-color:var(--blue-soft); }
.heat-faq-sum{ list-style:none; cursor:pointer; display:flex; align-items:center; gap:12px; padding:16px 18px; font-weight:600; font-size:.98rem; color:var(--ink); }
.heat-faq-sum::-webkit-details-marker{ display:none; }
.heat-faq-ico{ margin-left:auto; position:relative; width:16px; height:16px; flex:none; }
.heat-faq-ico::before, .heat-faq-ico::after{ content:""; position:absolute; left:0; top:7px; width:16px; height:2px; background:var(--ink-3); transition:transform .25s, background .25s; }
.heat-faq-ico::after{ transform:rotate(90deg); }
.heat-faq-item[open] .heat-faq-ico::after{ transform:rotate(0deg); }
.heat-faq-item[open] .heat-faq-ico::before, .heat-faq-item[open] .heat-faq-ico::after{ background:var(--blue); }
.heat-faq-panel{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .35s ease; }
.heat-faq-item[open] .heat-faq-panel{ grid-template-rows:1fr; }
.heat-faq-inner{ overflow:hidden; min-height:0; visibility:hidden; transition:visibility 0s .35s; }
.heat-faq-item[open] .heat-faq-inner{ visibility:visible; transition-delay:0s; }
.heat-faq-inner p{ margin:0; padding:0 18px 18px; color:var(--ink-2); font-size:.95rem; line-height:1.7; }

/* ---------- Series + related cards ---------- */
.heat-series{ display:grid; grid-template-columns:1fr; gap:14px; margin-top:8px; }
.heat-series-card{ position:relative; display:flex; flex-direction:column; gap:6px; padding:18px 18px 18px 62px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); text-decoration:none; color:var(--ink); transition:border-color .2s, transform .2s, box-shadow .2s; }
a.heat-series-card:hover, a.heat-series-card:focus-visible{ border-color:var(--blue); transform:translateY(-3px); box-shadow:var(--shadow-1); }
.heat-series-num{ position:absolute; left:16px; top:16px; font:600 .8rem var(--font-mono); color:var(--line-2); }
.heat-series-here{ border-color:var(--blue); background:var(--tint); }
.heat-series-here .heat-series-num{ color:var(--blue); }
.heat-series-badge{ position:absolute; left:16px; top:38px; font:500 .62rem var(--font-mono); text-transform:uppercase; letter-spacing:.06em; color:#fff; background:var(--blue); border-radius:999px; padding:3px 8px; }
.heat-series-title{ font-size:1rem; font-weight:600; margin:0; line-height:1.35; }
.heat-series-sub{ font-size:.85rem; color:var(--ink-2); margin:0; }
.heat-chip{ position:absolute; right:16px; top:16px; font:500 .62rem var(--font-mono); text-transform:uppercase; letter-spacing:.06em; color:var(--warn); background:#fdf3e6; border:1px dashed #e3c08a; border-radius:999px; padding:3px 9px; }

.heat-related{ display:grid; grid-template-columns:1fr; gap:14px; margin-top:8px; }
.heat-related-card{ display:flex; flex-direction:column; gap:6px; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); text-decoration:none; color:var(--ink); transition:border-color .2s, transform .2s, box-shadow .2s; }
.heat-related-card:hover, .heat-related-card:focus-visible{ border-color:var(--blue); transform:translateY(-3px); box-shadow:var(--shadow-1); }
.heat-related-title{ font-size:1.02rem; font-weight:600; margin:0; }
.heat-related-sub{ font-size:.86rem; color:var(--ink-2); margin:0; }

/* ---------- Article footer ---------- */
.heat-foot{ margin-top:48px; padding-top:20px; border-top:1px solid var(--line); }
.heat-foot p{ font-size:.85rem; color:var(--ink-3); margin:0; }

/* ---------- Ad slot (self-contained; hides when empty) ---------- */
.ad-wrap{ margin:clamp(40px, 6vw, 64px) 0; }
.ad-slot{ display:none; }
.ad-slot:not(:empty){ display:flex; align-items:center; justify-content:center; position:relative; max-width:720px; min-height:250px; margin-inline:auto; border:1px dashed var(--line-2); background:var(--surface); border-radius:var(--radius); overflow:hidden; }
.ad-slot:not(:empty)::before{ content:"Advertisement"; position:absolute; top:8px; right:12px; font:500 .62rem var(--font-mono); text-transform:uppercase; letter-spacing:.1em; color:var(--ink-3); }
.ad-slot:not(:empty) *{ max-width:100%; }

/* ---------- Responsive ---------- */
@media (min-width:560px){
  .heat-tree-opts{ grid-template-columns:1fr 1fr; }
  .heat-2col{ grid-template-columns:1fr 1fr; }
  .heat-related{ grid-template-columns:1fr 1fr; }
}
@media (min-width:1000px){
  .heat-grid{ grid-template-columns:230px minmax(0,1fr); gap:56px; }
  .heat-toc{ display:block; position:sticky; top:calc(var(--header-h) + 24px); align-self:start; max-height:calc(100vh - var(--header-h) - 48px); overflow:auto; }
  .heat-series{ grid-template-columns:1fr 1fr; }
}
@media (max-width:559px){
  .heat-cmd{ grid-template-columns:1fr; }
  .heat-cmd-label{ min-width:0; }
  .heat-tree-opts{ grid-template-columns:1fr; }
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] .heat-warn{ background:#241a09; border-color:#5a4417; }
[data-theme="dark"] .heat-warn-text{ color:#d8b878; }
[data-theme="dark"] .heat-callout.bsd-tip{ background:#0d2419; }
[data-theme="dark"] .heat-callout.bsd-note{ background:#0a2226; }
[data-theme="dark"] .heat-steps > li::before{ background:var(--tint); color:var(--blue); border-color:var(--blue-soft); }
[data-theme="dark"] .heat-cmd code{ background:var(--tint); }
[data-theme="dark"] .heat-check-list label:hover{ background:var(--tint); }
[data-theme="dark"] .heat-series-here{ background:var(--tint); }
[data-theme="dark"] .heat-chip{ color:#f0b45f; background:#241a09; border-color:#5a4417; }
[data-theme="dark"] .heat-figure figcaption{ color:var(--ink-3); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .heat-progress{ display:none; }
  .hd-glow, .hd-blades, .hd-core, .hd-temp-fill, .hd-signal, .hd-led{ animation:none !important; }
  .hd-temp-fill{ transform:scaleY(0.65); }
  .heat-faq-panel, .heat-faq-inner{ transition:none; }
}

/* ---------- Print ---------- */
@media print{
  .heat-progress, .heat-toc, .to-top, .site-header, .topbar, .heat-diagram, .ad-wrap, .heat-check-actions, .heat-verdict, .site-footer, .consent, .heat-tree-opts, .heat-tree-rec{ display:none !important; }
  .heat-grid{ display:block; padding:0; }
  .heat-article{ max-width:100%; }
  a{ color:var(--ink); text-decoration:none; }
  .heat-sec{ page-break-inside:avoid; }
}
