/* resources.css — /resources (the guides index), each guide's article,
   the guide cards the landing page reuses, the CVSS severity scale, and
   print rules (the incident-response checklist prints cleanly). */

/* ---------- Index ---------- */
.res-hero { padding-bottom: var(--space-8); background: radial-gradient(ellipse 60% 70% at 15% 0%, color-mix(in srgb, var(--grape) 14%, transparent), transparent 70%); }
.res-group { padding-top: var(--space-8); }
.res-group__head { display: grid; gap: var(--space-1); margin-bottom: var(--space-6); max-width: 760px; }
.res-group__head .site-h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 0; }
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.res-grid > li { display: flex; min-width: 0; }
@media (max-width: 960px) { .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .res-grid { grid-template-columns: minmax(0, 1fr); } }

.res-card {
  flex: 1; display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-2); min-width: 0;
  padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); text-decoration: none;
  transition: transform .3s var(--ease-out, ease), border-color .3s ease, box-shadow .3s ease;
}
.res-card:hover { text-decoration: none; color: var(--ink); transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.res-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.res-card__icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--grape-wash); color: var(--grape); font-size: 17px; margin-bottom: var(--space-2); }
.res-card__title { font: 700 19px/25px var(--font-display); }
.res-card__summary { color: var(--ink-muted); font-size: 14px; line-height: 21px; }
.res-card__meta { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-2); font-size: 12px; color: var(--ink-muted); }
.res-card__arrow { color: var(--fizz-text); transition: transform .3s var(--ease-out, ease); }
.res-card:hover .res-card__arrow { transform: translateX(4px); }

/* ---------- Article ---------- */
.guide { padding-top: var(--space-8); }
.guide__layout {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); grid-template-areas: "head head" "toc body";
  gap: var(--space-8) var(--space-12);
}
.guide__head { grid-area: head; max-width: 820px; display: grid; justify-items: start; gap: var(--space-2); }
.guide__crumbs { font-size: 13px; color: var(--ink-muted); }
.guide__crumbs a { color: var(--ink-muted); }
.guide__icon { width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; background: color-mix(in srgb, var(--fizz) 16%, transparent); color: var(--fizz-text); font-size: 22px; margin-top: var(--space-4); }
.guide__title { margin: var(--space-2) 0; }
.guide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); margin: var(--space-2) 0 0; font-size: 13px; color: var(--ink-muted); }

.guide__toc { grid-area: toc; position: sticky; top: calc(var(--site-header-h, 64px) + var(--space-6)); align-self: start; display: grid; gap: var(--space-3); }
.guide__toc .t-label { color: var(--ink-muted); margin: 0; }
.guide__toc ol { list-style: none; margin: 0; padding: 0 0 0 var(--space-3); border-left: 2px solid var(--border); display: grid; gap: var(--space-2); }
.guide__toc a { color: var(--ink-muted); text-decoration: none; font-size: 14px; line-height: 20px; display: block; }
.guide__toc a:hover { color: var(--ink); text-decoration: underline; }

.guide__body { grid-area: body; min-width: 0; max-width: 760px; display: grid; gap: var(--space-12); }
.guide__section { display: grid; gap: var(--space-4); scroll-margin-top: calc(var(--site-header-h, 64px) + var(--space-4)); }
.guide__section .site-h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 0; }
.guide__section p { margin: 0; color: var(--ink); line-height: 1.7; font-size: 16px; }
.guide__section a { color: var(--grape); }
.guide__list { margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-2); line-height: 1.65; }
.guide__list li::marker { color: var(--fizz-text); }
.guide__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); counter-reset: gs; }
.guide__steps li {
  counter-increment: gs; position: relative; display: grid; gap: 2px; padding: var(--space-4) var(--space-4) var(--space-4) 60px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); line-height: 1.6;
}
.guide__steps li::before {
  content: counter(gs); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--fizz); color: var(--on-fizz); font: 800 14px/1 var(--font-display);
}
.guide__step-title { color: var(--ink); }
.guide__steps span { color: var(--ink-muted); }

.guide__table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.guide__table:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.guide__table table { width: 100%; min-width: 560px; font-size: 14px; line-height: 21px; }
.guide__table caption { text-align: left; padding: var(--space-3) var(--space-4); font: 600 13px/18px var(--font-sans); color: var(--ink-muted); background: var(--surface-raised); caption-side: top; }
.guide__table th, .guide__table td { text-align: left; vertical-align: top; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.guide__table thead th { font: 600 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface); }
.guide__table tbody th { color: var(--ink); font-weight: 600; }
.guide__table td { color: var(--ink-muted); }

.guide__callout {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4);
  border-radius: var(--radius-md); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface);
}
.guide__callout > i { font-size: 18px; margin-top: 2px; }
.guide__callout p { margin: 4px 0 0; color: var(--ink-muted) !important; font-size: 15px !important; }
.guide__callout--info { border-left-color: var(--sev-low); } .guide__callout--info > i { color: var(--sev-low); }
.guide__callout--warn { border-left-color: var(--warn-text); background: var(--warn-wash); } .guide__callout--warn > i { color: var(--warn-text); }
.guide__callout--tip { border-left-color: var(--patched); background: var(--patched-wash); } .guide__callout--tip > i { color: var(--patched); }

.guide__checklist { display: grid; gap: var(--space-4); }
.guide__phase { margin: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); display: grid; gap: var(--space-2); }
.guide__phase legend { padding: 0 var(--space-2); font: 700 16px/22px var(--font-display); color: var(--ink); }
.guide__check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.5; }
.guide__check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--patched); cursor: pointer; }
.guide__check input:checked + label { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-muted) 60%, transparent); }
.guide__note { font-size: 13px; }

.guide__sources ol { margin: 0; padding-left: 1.4em; display: grid; gap: var(--space-2); font-size: 14px; }
.guide__src-host { margin-left: var(--space-2); font: 500 12px/18px var(--font-mono); color: var(--ink-muted); }

.guide__cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--fizz) 16%, var(--surface)), color-mix(in srgb, var(--grape) 18%, var(--surface)));
  border: 1px solid var(--border);
}
.guide__cta > div { display: grid; gap: var(--space-1); max-width: 46ch; }
.guide__cta .site-h3 { margin: 0; }
.guide__next { display: grid; gap: var(--space-3); }
.guide__next .t-label { color: var(--ink-muted); margin: 0; }

@media (max-width: 960px) {
  .guide__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "toc" "body"; gap: var(--space-6); }
  .guide__toc { position: static; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .guide__toc ol { border-left: 0; padding-left: 0; }
}

/* ---------- Severity scale (CVSS) ---------- */
.sev-scale { margin: 0; display: grid; gap: var(--space-2); }
.sev-scale__bar { display: flex; gap: 3px; border-radius: var(--radius-md); overflow: hidden; min-height: 64px; }
.sev-scale__band {
  flex-basis: 0; min-width: 56px; display: grid; align-content: center; gap: 2px; padding: 8px 10px; color: var(--on-sev);
  transform-origin: left;
}
.sev-scale__band--none { background: var(--sev-none); color: var(--ink); }
.sev-scale__band--low { background: var(--sev-low); }
.sev-scale__band--medium { background: var(--sev-medium); }
.sev-scale__band--high { background: var(--sev-high); }
.sev-scale__band--critical { background: var(--sev-critical); color: var(--on-sev-critical); }
.sev-scale__word { font: 700 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.sev-scale__range { font: 500 12px/16px var(--font-mono); opacity: .9; }
html[data-motion="on"] .sev-scale .sev-scale__band { transform: scaleX(.2); opacity: 0; transition: transform .7s var(--ease-out, ease), opacity .5s ease; transition-delay: var(--d, 0ms); }
html[data-motion="on"] .sev-scale.is-in .sev-scale__band { transform: none; opacity: 1; }
@media (max-width: 520px) {
  .sev-scale__bar { flex-direction: column; }
  .sev-scale__band { flex-grow: 1 !important; display: flex; justify-content: space-between; transform-origin: top; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-motion="on"] .sev-scale .sev-scale__band { transform: none; opacity: 1; }
}

/* ---------- Print: the article alone, checkboxes as boxes ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-raised: #f4f4f4; --ink: #000; --ink-muted: #333; --border: #bbb; }
  body { background: #fff; color: #000; }
  .guide__toc, .guide__cta, .guide__next, .guide__print, .guide__icon { display: none !important; }
  .guide__layout { display: block; }
  .guide__body { max-width: none; gap: 18px; }
  .guide__section { break-inside: avoid-page; }
  .guide__phase { break-inside: avoid; }
  .guide__steps li::before { background: #000; color: #fff; }
  a { color: #000; }
  .guide__sources a::after { content: " (" attr(href) ")"; font-size: 11px; }
}
