/* ── section-guide.css — MetalWeightPro ─────────────────────────────────────
 * Loaded on tools/section-guide.html (IS 808 Section Guide) only.
 * Injected by build.js getCssLinks() via TOOL_CSS_FILES['tools/section-guide.html'].
 * Always loaded AFTER base style.css — inherits all CSS variables and tokens.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── Phase P — Section Guide + Comparator ──────────────────────── */

/* ── Hook paragraph ─────────────────────────────────────────────── */

.sg-hook {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.55;
}

/* ── Finder section wrapper ──────────────────────────────────────── */

.sg-finder {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.sg-finder__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* ── Progress dots ───────────────────────────────────────────────── */

.sg-progress {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-lg);
}

.sg-progress__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background var(--tr), border-color var(--tr);
  flex-shrink: 0;
}

.sg-progress__dot--active {
  background: var(--accent);
  border-color: var(--accent);
}

.sg-progress__dot--done {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 0.55;
}

/* ── Wizard steps — hidden / visible ────────────────────────────── */

.sg-step {
  display: none;
}

.sg-step--active {
  display: block;
}

.sg-step__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* ── Card grid ───────────────────────────────────────────────────── */

.sg-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

@media (min-width: 600px) {
  .sg-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .sg-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Individual card ─────────────────────────────────────────────── */

.sg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 100px;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
  user-select: none;
  /* WCAG touch target */
  min-width: 44px;
}

.sg-card:hover {
  border-color: var(--accent);
}

.sg-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sg-card--selected {
  border-color: var(--accent);
  background: rgba(232, 149, 42, 0.08);
  color: var(--accent);
}

.sg-card__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color var(--tr);
}

.sg-card--selected .sg-card__icon {
  color: var(--accent);
}

.sg-card__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: inherit;
  line-height: 1.2;
}

.sg-card__sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.sg-card--selected .sg-card__sub {
  color: var(--text-secondary);
}

/* ── Result box ──────────────────────────────────────────────────── */

.sg-result-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ── Individual result card ──────────────────────────────────────── */

.sg-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
}

.sg-result--primary {
  border-left: 3px solid var(--accent);
}

.sg-result--secondary {
  opacity: 0.85;
}

/* ── Why-chips ───────────────────────────────────────────────────── */

.sg-result__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
}

.sg-result__chip {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(232, 149, 42, 0.08);
  border: 1px solid rgba(232, 149, 42, 0.25);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ── Availability badges ─────────────────────────────────────────── */

.sg-availability {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sg-availability--common {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sg-availability--moderate {
  background: rgba(232, 149, 42, 0.2);
  color: var(--accent);
  border: 1px solid rgba(232, 149, 42, 0.35);
}

.sg-availability--limited {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Engineering disclaimer ──────────────────────────────────────── */

.sg-disclaimer {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: var(--space-md);
}

.sg-disclaimer p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* ── Result links (view full properties) ─────────────────────────── */

.sg-result__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.sg-result__link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-xs) var(--space-md);
  text-decoration: none;
  transition: background var(--tr), color var(--tr);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sg-result__link:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ── Article content layer ───────────────────────────────────────── */

.sg-article {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.sg-article h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* ── Family block ────────────────────────────────────────────────── */

.sg-family-block {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.sg-family-block:last-child {
  border-bottom: none;
}

.sg-family-block__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-top: 4px;
}

.sg-family-block__icon svg {
  width: 48px;
  height: 48px;
}

.sg-family-block__content {
  flex: 1;
  min-width: 0;
}

.sg-family-block__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.sg-family-block__desc {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-xs);
}

.sg-family-block__uses {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: var(--space-md);
  margin-bottom: var(--space-xs);
  line-height: 1.6;
}

.sg-family-block__avail-note {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: var(--space-xs) 0;
  font-style: italic;
}

.sg-family-block__link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: var(--space-xs);
  transition: opacity var(--tr);
}

.sg-family-block__link:hover {
  opacity: 0.75;
}

/* ── Comparator section ──────────────────────────────────────────── */

.sg-comparator {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.sg-comparator h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* ── Mode tab switcher ───────────────────────────────────────────── */

.sg-mode {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.sg-mode__tab {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: color var(--tr), border-color var(--tr);
  /* touch target */
  min-height: 44px;
  margin-bottom: -1px;
}

.sg-mode__tab:hover {
  color: var(--text-secondary);
}

.sg-mode__tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Comparator controls ─────────────────────────────────────────── */

.sg-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

@media (min-width: 600px) {
  .sg-controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }
}

.sg-controls--cross {
  /* hidden by default — toggled by JS when Cross-Family tab active */
}

.sg-controls__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.sg-controls__group label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Select element ──────────────────────────────────────────────── */

.sg-select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-sm);
  height: 44px;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--tr);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.sg-select:focus {
  outline: none;
  border-color: var(--accent);
}

.sg-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Comparison output area ──────────────────────────────────────── */

.sg-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.sg-output__header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.sg-output__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

.sg-output__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.sg-output__desig {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* Property table wrapper — horizontal scroll on mobile */
#sg-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
}

/* ── Comparison summary block ────────────────────────────────────── */

.sg-summary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.sg-summary__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border);
}

.sg-summary__row:last-child {
  border-bottom: none;
}

.sg-summary__label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 160px;
}

.sg-summary__val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}

.sg-summary__note {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  width: 100%;
  margin-top: 2px;
}

/* ── Highlighted value (higher in comparison) ────────────────────── */

.sg-highlight {
  color: var(--accent);
  font-weight: 700;
}

/* ── Responsive: stack summary on small screens ──────────────────── */

@media (max-width: 599px) {
  .sg-summary__label {
    flex: 0 0 100%;
  }
  .sg-summary__val {
    flex: 0 0 100%;
  }
}
