/* =============================================================================
   RookiDroid theme — Build guides
   ============================================================================= */


:root {
  --warn: #e08a00;
  --warn-dim: rgba(242,183,5,0.12);
  --info: #1b2a4a;
  --info-dim: rgba(27,42,74,0.07);
}

/* ── Hero ── */
.guide-hero {
  position: relative;
  overflow: hidden;
  /* The guides use the full-width template, so the hero already spans the
     page; a 100vw width would overshoot by the scrollbar's width. */
  width: 100%;
  background: linear-gradient(120deg, var(--rd-surface-alt) 45%, var(--rd-panel) 100%);
  padding: 52px 0 54px;
  margin-bottom: 0;
  text-align: left;
}

.guide-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Chest trim along the bottom edge. */
.guide-hero::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  z-index: 1;
  background: var(--rd-chest-trim);
  pointer-events: none;
}

.guide-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background-image: var(--rd-panel-lines);
  background-repeat: repeat;
  opacity: 0.14;
  pointer-events: none;
}

.guide-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--rd-font-mono);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--rd-text-secondary);
  margin-bottom: 18px;
  background: transparent;
  padding: 0 0 0 10px;
  border-left: 4px solid var(--rd-yellow);
}

.guide-hero-title {
  font-family: var(--rd-font-display);
  letter-spacing: -0.01em;
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  color: var(--rd-text);
  margin: 0 0 14px;
  line-height: 1.15;
}

.guide-hero-highlight { color: var(--rd-primary) !important; }

.guide-hero-desc {
  font-family: var(--rd-font-body);
  font-size: 1rem;
  color: var(--rd-text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 680px) {
  .guide-hero { padding: 36px 0 38px; }
  .guide-hero-inner { padding: 0 16px; }
  .guide-hero::after { width: 60%; opacity: 0.1; }
}

/* ── Hero media ── */
.guide-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 40px;
  align-items: center;
}

.guide-hero-copy { min-width: 0; }

.guide-hero-media {
  margin: 0;
  min-width: 0;
}

.guide-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  border: 4px solid var(--rd-primary);
  box-shadow: var(--rd-shadow-lg);
}

@media (max-width: 900px) {
  .guide-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .guide-hero-media { max-width: 440px; }
}

.guide-hero-meta { display: flex; gap: 2rem; flex-wrap: wrap; padding-top: 2rem; border-top: 2px solid var(--rd-border); margin-top: 2rem; }
.meta-item { display: flex; flex-direction: column; gap: 3px; padding-left: 10px; border-left: 3px solid var(--rd-primary); }
.meta-label { font-size: 11px; font-weight: 600; font-family: var(--rd-font-mono); color: var(--rd-text-muted); letter-spacing: .01em; }
.meta-val { font-size: 16px; font-weight: 700; font-family: var(--rd-font-mono); color: var(--rd-primary); }

/* ── Hero Actions ── */
.guide-hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.hero-res-card {
  position: relative;
  background: var(--rd-surface);
  border: 2px solid var(--rd-navy);
  border-radius: 0;
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  transition: var(--rd-transition);
  box-shadow: var(--rd-shadow-hard);
  text-align: left;
}
.hero-res-card:hover {
  border-color: var(--rd-primary);
  transform: translate(-2px, -2px);
  box-shadow: var(--rd-shadow-hover);
}
.hero-res-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.hero-res-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-res-title {
  color: var(--rd-text);
  font-weight: 700;
  font-family: var(--rd-font-display);
  letter-spacing: -0.01em;
  font-size: .95rem;
}
.hero-res-action {
  color: var(--rd-primary);
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--rd-font-mono);
  letter-spacing: .01em;
}



/* ── Phase nav ── */
/* Fix for WordPress blocks breaking position: sticky. html and body keep
   their overflow-x: clip (it doesn't break sticky), so the full-bleed hero
   can't cause a sideways scroll. */
*:has(.phase-nav-wrap):not(html):not(body) {
  overflow: visible !important;
  clip-path: none !important;
}
html, body {
  overflow-x: clip; /* Prefer clip over hidden for body to avoid breaking sticky */
}

.phase-nav-wrap {
  background: var(--rd-surface);
  border-top: 2px solid var(--rd-navy);
  border-bottom: 4px solid var(--rd-primary);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(15,26,48,.12);
}
.phase-nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.phase-nav::-webkit-scrollbar { display: none; }
.phase-btn {
  padding: 16px 8px 13px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--rd-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--rd-transition);
  font-family: var(--rd-font-body);
  letter-spacing: normal; /* reset the tracking some form styles give <button> */
  display: flex;
  align-items: center;
}
.phase-btn:hover, .phase-btn:focus { color: var(--rd-primary); background: transparent; box-shadow: none; outline: none; }
.phase-btn.active { color: var(--rd-text); border-bottom-color: var(--rd-primary); background: transparent; }
.phase-btn .num { --rd-chamfer: 4px; font-family: var(--rd-font-mono); font-size: 11px; font-weight: 700; opacity: 0.8; margin-right: 8px; background: var(--rd-surface-alt); border: 1px solid var(--rd-border); padding: 2px 6px; border-radius: 0; clip-path: var(--rd-chamfer-clip); }
.phase-btn.active .num { background: var(--rd-primary); border-color: var(--rd-outline); color: #fff; opacity: 1; }

/* ── Progress bar ── */
.progress-track { height: 4px; background: var(--rd-panel); }
/* Purple, ending in a run of yellow vent slats. */
.progress-fill {
  height: 4px;
  background:
    repeating-linear-gradient(90deg, var(--rd-yellow) 0 6px, transparent 6px 10px) right / 40px 100% no-repeat,
    var(--rd-primary);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ── Content ── */
.content {
  max-width: 1170px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.phase { display: none; animation: mechanicalSlide 0.3s cubic-bezier(0.4,0,0.2,1); }
.phase.visible { display: block; }
@keyframes mechanicalSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Section headings ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 3.5rem 0 1.5rem;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 1.2rem; font-weight: 700; color: var(--rd-text); font-family: var(--rd-font-display); letter-spacing: -0.01em; margin: 0; }
/* A purple rule ending in a red and a yellow chip. */
.section-head::after {
  content: '';
  flex: 1;
  height: 4px;
  background: linear-gradient(90deg,
    var(--rd-primary) 0 calc(100% - 44px),
    transparent calc(100% - 44px) calc(100% - 40px),
    var(--rd-red) calc(100% - 40px) calc(100% - 22px),
    transparent calc(100% - 22px) calc(100% - 18px),
    var(--rd-yellow) calc(100% - 18px));
}

/* ── Cards ── */
.card {
  position: relative;
  background: var(--rd-surface);
  border: 2px solid var(--rd-navy);
  border-radius: 0;
  padding: 1.5rem;
  margin-bottom: 16px;
  box-shadow: var(--rd-shadow-hard);
}
.card-row { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.card-stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-family: var(--rd-font-mono); font-size: 11px; font-weight: 600; color: var(--rd-text-muted); letter-spacing: .01em; }
.stat-val { font-size: 1.1rem; font-weight: 700; color: var(--rd-text); font-family: var(--rd-font-mono); }

/* ── Parts grid ── */
.parts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.part-card {
  position: relative;
  background: var(--rd-surface);
  border: 2px solid var(--rd-navy);
  border-radius: 0;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--rd-transition);
  box-shadow: var(--rd-shadow-sm);
}
.part-card:hover { border-color: var(--rd-primary); box-shadow: var(--rd-shadow-hard); transform: translate(-2px, -2px); }
.part-card img { width: 100%; height: auto; border-radius: 0; margin-bottom: 8px; background: var(--rd-surface); border: 1px solid var(--rd-border); }
.part-name { font-size: 12px; font-family: var(--rd-font-mono); color: var(--rd-text-secondary); }
.part-qty { font-size: 20px; font-weight: 700; font-family: var(--rd-font-mono); color: var(--rd-text); }
.part-card.accent { border-color: var(--rd-primary); background: var(--rd-primary-ghost); }
.part-card.accent .part-name { color: var(--rd-primary); }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
thead th { text-align: left; font-family: var(--rd-font-mono); font-size: 12px; font-weight: 700; color: var(--rd-text-secondary); letter-spacing: .01em; padding: 0 16px 10px 0; border-bottom: 2px solid var(--rd-navy); }
tbody td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rd-border-light); color: var(--rd-text); vertical-align: top; line-height: 1.5; }
tbody tr:last-child td { border-bottom: none; }
td.muted { color: var(--rd-text-secondary); font-size: .9rem; }
td code { font-family: var(--rd-font-mono); font-size: 13px; background: var(--rd-surface-alt); padding: 2px 6px; border-radius: 0; border: 1px solid var(--rd-border-light); color: var(--rd-primary); }

/* ── Alerts ── */
.alert {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 0;
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}
.alert-warn { background: var(--warn-dim); border: 2px solid rgba(224,138,0,0.35); border-left: 6px solid var(--rd-yellow); color: #8a4b00; }
.alert-info { background: var(--info-dim); border: 2px solid rgba(27,42,74,0.25); border-left: 6px solid var(--rd-navy); color: var(--rd-navy); }
.alert-accent { background: var(--rd-primary-ghost); border: 2px solid var(--rd-primary-light); border-left: 6px solid var(--rd-primary); color: var(--rd-primary-dark); }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rd-border-light);
  align-items: start;
}
.step:last-child { border-bottom: none; padding-bottom: 0; }
.step:first-child { padding-top: 0; }
/* Step number: a chamfered navy plate with a purple base line. */
.step-n {
  --rd-chamfer: 6px;
  width: 32px;
  height: 32px;
  border-radius: 0;
  clip-path: var(--rd-chamfer-clip);
  background: var(--rd-navy);
  box-shadow: inset 0 -3px 0 var(--rd-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--rd-font-mono);
  flex-shrink: 0;
}
.step-body { font-size: .95rem; color: var(--rd-text); line-height: 1.65; padding-top: 4px; }
.step-body strong { color: var(--rd-primary); font-weight: 600; }
.step-body code { font-family: var(--rd-font-mono); font-size: 13px; background: var(--rd-surface-alt); padding: 2px 6px; border-radius: 0; color: var(--rd-primary); border: 1px solid var(--rd-border-light); }
.step-body a { color: var(--rd-primary); font-weight: 500; text-decoration: none; }
.step-body a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Checklist ── */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  /* Block, not flex: a flex row turns the bold lead-in and the rest of the
     sentence into two columns once the line wraps. The dot sits in the gutter. */
  position: relative;
  padding: 12px 0 12px 30px;
  border-bottom: 1px solid var(--rd-border-light);
  font-size: .95rem;
  color: var(--rd-text-secondary);
  line-height: 1.6;
}
.checklist li:last-child { border-bottom: none; padding-bottom: 0; }
.checklist li:first-child { padding-top: 0; }
.checklist li strong { color: var(--rd-text); }
.check-dot { width: 18px; height: 18px; border-radius: 0; background: var(--rd-surface); border: 2px solid var(--rd-navy); position: absolute; left: 0; top: 15px; }
.checklist li:first-child .check-dot { top: 3px; }
.check-dot::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; border-radius: 0; background: var(--rd-primary); opacity: 0; transition: opacity 0.2s; }
.checklist li:hover .check-dot::after { opacity: 0.6; }

/* ── Badge ── */
.badge { --rd-chamfer: 4px; display: inline-block; font-family: var(--rd-font-mono); font-size: 10px; font-weight: 700; letter-spacing: .01em; padding: 4px 10px; border-radius: 0; border: 1px solid var(--rd-outline); clip-path: var(--rd-chamfer-clip); vertical-align: middle; margin-left: 6px; }
.badge-warn { background: var(--rd-yellow); color: var(--rd-outline); }
.badge-accent { background: var(--rd-primary); color: #fff; }

/* ── Config block ── */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.config-item { position: relative; background: var(--rd-surface); border: 2px solid var(--rd-navy); border-radius: 0; padding: 18px 16px 16px; box-shadow: var(--rd-shadow-sm); }
.config-key { font-family: var(--rd-font-mono); font-size: 11px; font-weight: 600; color: var(--rd-text-muted); letter-spacing: .01em; margin-bottom: 6px; }
.config-val { font-family: var(--rd-font-mono); font-size: 15px; color: var(--rd-primary); font-weight: 700; }

/* ── Servo grid ── */
.servo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.servo-group { position: relative; background: var(--rd-surface); border: 2px solid var(--rd-navy); border-radius: 0; padding: 22px 20px 20px; box-shadow: var(--rd-shadow-hard); }
.servo-group-title { font-family: var(--rd-font-mono); font-size: 12px; font-weight: 700; color: var(--rd-text); letter-spacing: .01em; margin-bottom: 16px; padding: 4px 8px; background: var(--rd-surface-alt); border-left: 4px solid var(--rd-primary); }
.servo-joint { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--rd-border); font-size: .95rem; }
.servo-joint:last-child { border-bottom: none; padding-bottom: 0; }
.joint-name { color: var(--rd-text); font-weight: 500; }
.joint-target { font-family: var(--rd-font-mono); font-size: 13px; font-weight: 600; color: var(--rd-primary); background: var(--rd-primary-ghost); padding: 2px 8px; border-radius: 0; border: 1px solid var(--rd-primary-light); }


