/* Construct guide pages (ncjosi-2-*.html). Shared by all 10 guides.
   External file only: no inline styles, so the site CSP is unaffected. */

.guide-scope,
body {
  --g-navy: var(--bh-navy);
  --g-navy-soft: var(--bh-navy-light);
  --g-gold: var(--bh-gold);
  --g-ink: var(--bh-gray-900);
  --g-muted: var(--bh-gray-500);
  --g-line: var(--bh-gray-200);
  --g-panel: var(--bh-off-white);
  --g-condition: #2b5797;
  --g-act: #6b3fa0;   /* deductive_reasoning color from construct-map.js */
  --g-exception: #b74a3e;
}

/* ---------- Layout ---------- */
.guide {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
  color: var(--g-ink);
  line-height: 1.65;
}
.guide p { margin: 0 0 1rem; }

.guide-crumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--g-muted);
  margin-bottom: 2rem;
}
.guide-crumbs a { color: var(--g-navy-soft); }

.guide-intro h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  color: var(--g-navy);
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 4px solid var(--g-gold);
  display: inline-block;
}
.guide-lede {
  font-size: 1.2rem;
  line-height: 1.55;
}

.guide-section { margin-top: 3rem; }
.guide-section h2,
.guide-cta h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--g-navy);
  margin: 0 0 1rem;
}
.guide-note {
  font-size: 0.9rem;
  color: var(--g-muted);
}

/* ---------- Sample question ---------- */
.sample {
  border: 1px solid var(--g-line);
  border-radius: 10px;
  padding: 1.5rem;
  background: #fff;
}
.sample__rule {
  margin: 0 0 1.5rem;
  background: var(--g-panel);
  border-left: 4px solid var(--g-navy);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
}
.sample__rule figcaption {
  font-weight: 700;
  color: var(--g-navy);
  margin-bottom: 0.5rem;
}
.sample__rule blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
}
.sample__rule blockquote p { margin: 0; }

.sample__stem {
  font-weight: 700;
  font-size: 1.05rem;
}
.sample__options {
  margin: 0 0 1.5rem;
  padding-left: 2rem;
}
.sample__options li {
  padding: 0.35rem 0;
}
.sample__options li::marker {
  font-weight: 700;
  color: var(--g-navy);
}

.sample__reveal summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--g-navy);
  border: 2px solid var(--g-navy);
  border-radius: 6px;
  padding: 0.55rem 1rem;
}
.sample__reveal summary::-webkit-details-marker { display: none; }
.sample__reveal summary:hover { background: var(--g-panel); }
.sample__reveal[open] summary { margin-bottom: 1rem; }
.sample__answer {
  border-top: 1px solid var(--g-line);
  padding-top: 1rem;
}

/* ---------- Method ---------- */
.method {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.method > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: 2rem;
}
.method > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--g-navy);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.method h3 {
  font-size: 1.1rem;
  color: var(--g-navy);
  margin: 0.25rem 0 0.5rem;
}

.rule-parts {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.6rem;
}
.rule-parts__row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  background: var(--g-panel);
  border-left: 4px solid var(--g-line);
  border-radius: 0 6px 6px 0;
  padding: 0.7rem 1rem;
}
.rule-parts dt {
  font-weight: 700;
  font-size: 0.9rem;
}
.rule-parts dd { margin: 0; }
.rule-parts__row--condition { border-left-color: var(--g-condition); }
.rule-parts__row--condition dt { color: var(--g-condition); }
.rule-parts__row--act { border-left-color: var(--g-act); }
.rule-parts__row--act dt { color: var(--g-act); }
.rule-parts__row--exception { border-left-color: var(--g-exception); }
.rule-parts__row--exception dt { color: var(--g-exception); }

/* ---------- CTA ---------- */
.guide-cta {
  margin-top: 3.5rem;
  background: var(--g-navy);
  color: #fff;
  border-radius: 10px;
  padding: 2rem 1.5rem;
}
.guide-cta h2 { color: #fff; }
.guide-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
}
.guide-link { color: #fff; }

/* ---------- Focus & responsive ---------- */
.guide a:focus-visible,
.guide summary:focus-visible {
  outline: 3px solid var(--g-gold);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .sample { padding: 1.1rem; }
  .rule-parts__row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .method > li { padding-left: 2.9rem; }
}

/* ---------- Added for the full guide set ---------- */
.sample__table-wrap { overflow-x: auto; }
.sample__table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  background: #fff;
}
.sample__table th,
.sample__table td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--g-line);
  white-space: nowrap;
}
.sample__table th { color: var(--g-navy); }
.sample__table--mono td {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
.sample__table--mono td:first-child { font-family: inherit; }

.sample__steps {
  margin: 0 0 1.25rem;
  padding-left: 2rem;
}
.sample__steps li { padding: 0.15rem 0; }

.sample__figure {
  margin: 0 0 1.5rem;
  text-align: center;
}
.sample__figure figcaption {
  font-size: 0.9rem;
  color: var(--g-muted);
  margin-top: 0.4rem;
}

/* Spatial orientation map */
.so-map {
  width: 100%;
  max-width: 540px;
  height: auto;
  background: var(--g-panel);
  border-radius: 6px;
}
.so-roads line { stroke: #b9c1cf; stroke-width: 14; stroke-linecap: round; }
.so-arrows path { fill: var(--g-navy); }
.so-labels text,
.so-poi text,
.so-north text {
  font: 700 12px system-ui, -apple-system, "Segoe UI", sans-serif;
  fill: var(--g-ink);
}
.so-poi rect { fill: var(--g-condition); }
.so-poi--dest circle { fill: var(--g-exception); }
.so-north path { fill: var(--g-ink); }

/* Flexibility of closure figures */
.fc-svg polyline {
  fill: none;
  stroke: var(--g-ink);
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.sample__figure--target .fc-svg { background: var(--g-panel); border-radius: 6px; }
.sample__options--figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-left: 0;
  list-style: none;
}
.fc-label {
  font-weight: 700;
  color: var(--g-navy);
}
.sample__options--figures li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--g-line);
  border-radius: 6px;
  padding: 0.6rem 0.4rem;
}
.sample__options--figures .fc-svg { max-width: 100%; height: auto; }

/* Related guides */
.guide-related {
  margin-top: 3rem;
  border-top: 1px solid var(--g-line);
  padding-top: 1.5rem;
}
.guide-related h2 {
  font-size: 1.1rem;
  color: var(--g-navy);
  margin: 0 0 0.75rem;
}
.guide-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1.5rem;
}
.guide-related a { color: var(--g-navy-soft); }
.guide-related [aria-current="page"] { font-weight: 700; color: var(--g-ink); }

@media (max-width: 600px) {
  .sample__options--figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-related ul { grid-template-columns: 1fr; }
}
