/* ============================================================
   RMCM Guides: step-by-step execution content
   Loaded only by guides/{slug}.html and guides.html
   ============================================================ */

:root {
  --guide-verify: #8fd6a4;
}

/* --- Verified stamp ---------------------------------------- */
.guide-verified {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.8rem;
  margin: 1.5rem 0 0;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--guide-verify);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 0.85rem;
}
.guide-verified__label {
  font-family: var(--font-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--guide-verify);
}
.guide-verified__src { color: var(--muted); }
.guide-verified__src a { color: var(--orange); text-decoration: underline; }

/* --- Prerequisites bar ------------------------------------- */
.guide-meta {
  margin: 2rem 0;
  padding: clamp(1rem, 2.4vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.guide-meta__label {
  font-family: var(--font-accent);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-2);
  margin-bottom: 0.8rem;
}
.guide-meta__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem 1.4rem;
  margin-bottom: 1rem;
}
.guide-meta__item dt {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide-meta__item dd {
  margin: 0.15rem 0 0;
  color: var(--ink);
  font-weight: 600;
}
.guide-meta ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.guide-meta li { margin-bottom: 0.35rem; }

/* --- Step blocks ------------------------------------------- */
.guide-step {
  position: relative;
  margin: 2.6rem 0;
  padding: 0 0 0 3.2rem;
  scroll-margin-top: 90px;
}
.guide-step__num {
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--orange);
  background: var(--dark-pill);
  font-family: var(--font-accent);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--orange-2);
}
.guide-step__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  text-transform: uppercase;
  color: var(--yellow);
  margin: 0 0 0.7rem;
  text-wrap: balance;
}
.guide-step__do > :first-child { margin-top: 0; }
.guide-step__do ol,
.guide-step__do ul { padding-left: 1.15rem; color: var(--muted); }
.guide-step__do li { margin-bottom: 0.4rem; }

/* Verify + trap callouts */
.guide-step__verify,
.guide-step__trap {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.guide-step__verify {
  border-left: 3px solid var(--guide-verify);
  background: rgba(143, 214, 164, 0.07);
}
.guide-step__trap {
  border-left: 3px solid var(--orange);
  background: rgba(255, 90, 61, 0.07);
}
.guide-step__verify b,
.guide-step__trap b {
  display: block;
  font-family: var(--font-accent);
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.guide-step__verify b { color: var(--guide-verify); }
.guide-step__trap b { color: var(--orange-2); }

/* --- Screenshot / recreation figure ------------------------ */
.guide-shot {
  margin: 1.2rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.guide-shot__frame { position: relative; }
.guide-shot img { width: 100%; height: auto; display: block; }
.guide-shot__callout {
  position: absolute;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--dark-pill);
  font-family: var(--font-accent);
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(2, 7, 8, 0.55);
  transform: translate(-50%, -50%);
}
.guide-shot figcaption {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

/* --- UI recreation primitives ------------------------------ */
.ui-mock {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.45;
  background: #0b1416;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}
.ui-mock__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--line);
}
.ui-mock__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(246, 240, 223, 0.25);
  flex: none;
}
.ui-mock__bar span:last-child {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-mock__body {
  padding: 1.35rem 1.25rem 1.5rem;
  display: grid;
  gap: 1.25rem;
}
.ui-mock__row { position: relative; display: grid; gap: 0.45rem; }
.ui-mock__label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.ui-mock__field {
  position: relative;
  padding: 0.6rem 3.2rem 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.4;
  min-height: 1.4em;
}
.ui-mock__field--active { border-color: var(--orange); }
.ui-mock__btn {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--orange);
  color: var(--dark-pill);
  font-family: var(--font-accent);
  letter-spacing: 0.05em;
}

/* Metric tiles, as used across the analytics dashboards (Search Console, GA4) */
.ui-mock__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}
.ui-mock__metric {
  position: relative;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.ui-mock__metric--on { border-color: var(--orange); background: rgba(255, 90, 61, 0.08); }
.ui-mock__metric dt {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.ui-mock__metric dd {
  margin: 0;
  font-family: var(--font-accent);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
}
.ui-mock__metric--on dd { color: var(--orange-2); }

/* Data table, as used by the Performance and Pages reports */
.ui-mock__tablewrap { overflow-x: auto; }
.ui-mock__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 380px;
}
.ui-mock__table th {
  text-align: left;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ui-mock__table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(246, 240, 223, 0.07);
  color: var(--ink);
  vertical-align: middle;
}
.ui-mock__table tbody tr:last-child td { border-bottom: 0; }
.ui-mock__table td:not(:first-child),
.ui-mock__table th:not(:first-child) { text-align: right; white-space: nowrap; }
.ui-mock__table tr.is-flagged td { background: rgba(255, 90, 61, 0.09); }
.ui-mock__table tr.is-flagged td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.ui-mock__table td:first-child { position: relative; }

/* Tabs / filter chips inside a recreation */
.ui-mock__tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ui-mock__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}
.ui-mock__tab--on { border-color: var(--orange); color: var(--orange-2); background: rgba(255, 90, 61, 0.1); }

/* Callouts inside a recreation anchor to the field, not to a percentage of the
   figure, so they survive any spacing change to the mock. */
.ui-mock__field > .guide-shot__callout,
.ui-mock__metric > .guide-shot__callout,
.ui-mock__tab > .guide-shot__callout {
  left: auto;
  right: 0.55rem;
  top: 50%;
  transform: translate(0, -50%);
}
.ui-mock__metric > .guide-shot__callout { right: 0.45rem; top: 0.45rem; transform: none; }
/* A tab is too narrow to overlay a pin without covering its label, so the pin
   sits inline after the text and the tab grows to fit it. */
.ui-mock__tab > .guide-shot__callout {
  position: static;
  display: inline-grid;
  vertical-align: middle;
  transform: none;
  left: auto;
  right: auto;
  margin-left: 0.45rem;
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.82rem;
}
.ui-mock__table td > .guide-shot__callout {
  left: auto;
  right: auto;
  margin-left: 0.5rem;
  position: static;
  display: inline-grid;
  vertical-align: middle;
  transform: none;
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.85rem;
}

/* --- Copy-paste block -------------------------------------- */
.guide-copy {
  position: relative;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
}
.guide-copy__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.guide-copy__name {
  font-family: var(--font-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--orange-2);
}
.guide-copy__btn {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-accent);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.guide-copy__btn:hover { border-color: var(--orange); color: var(--orange-2); }
.guide-copy pre {
  margin: 0;
  padding: 0.9rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink);
}

/* --- Closing checklist ------------------------------------- */
.guide-checklist {
  margin: 2.5rem 0;
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.guide-checklist__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.7rem;
}
.guide-checklist__label {
  font-family: var(--font-accent);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-2);
}
.guide-checklist__status { display: flex; align-items: center; gap: 0.2rem; }
.guide-checklist__progress {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide-checklist__progress.is-done { color: var(--guide-verify); }
.guide-checklist__reset {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-accent);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 0.6rem;
  flex: none;
}
.guide-checklist__reset:hover { border-color: var(--orange); color: var(--orange-2); }

.guide-checklist ul { list-style: none; margin: 0; padding: 0; }
.guide-checklist li { margin-bottom: 0.45rem; }
.guide-checklist li:last-child { margin-bottom: 0; }

/* The row is the label, so the whole line is a click target */
.guide-checklist label {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 1.4rem;
  align-items: start;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.55;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.guide-checklist label:hover { color: var(--ink); background: rgba(246, 240, 223, 0.04); }

.guide-checklist input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.22rem 0 0;
  margin-top: calc((1lh - 1.15rem) / 2);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  place-content: center;
  cursor: pointer;
  flex: none;
}
.guide-checklist input[type="checkbox"]::after {
  content: "";
  width: 0.62rem;
  height: 0.34rem;
  border-left: 2px solid var(--dark-pill);
  border-bottom: 2px solid var(--dark-pill);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform .12s ease;
}
.guide-checklist input[type="checkbox"]:checked {
  background: var(--guide-verify);
  border-color: var(--guide-verify);
}
.guide-checklist input[type="checkbox"]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.guide-checklist input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.guide-checklist input[type="checkbox"]:checked + span {
  color: rgba(246, 240, 223, 0.45);
  text-decoration: line-through;
  text-decoration-color: rgba(143, 214, 164, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .guide-checklist input[type="checkbox"]::after,
  .guide-checklist label { transition: none; }
}

/* --- Step-aware TOC ---------------------------------------- */
.toc-list--steps { counter-reset: tocstep; }
.toc-list--steps .toc-item { counter-increment: tocstep; }
.toc-list--steps .toc-item--step .toc-link::before {
  content: counter(tocstep) ". ";
  color: var(--orange-2);
  font-family: var(--font-accent);
}

/* --- Print: the checklist has to survive ------------------- */
@media print {
  .guide-shot, .guide-copy__btn, .toc-sidebar { display: none; }
  .guide-checklist { border-color: #000; }
  .guide-checklist__reset { display: none; }
  .guide-checklist input[type="checkbox"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 640px) {
  .guide-step { padding-left: 2.6rem; }
  .guide-step__num { width: 1.9rem; height: 1.9rem; font-size: 1.05rem; }
  .guide-shot__callout { width: 1.4rem; height: 1.4rem; font-size: 0.85rem; }
}
