/* /css/AlternatingInferenceChainsLesson.css
// ==========================================================
// Sudoku Paradise — Alternating Inference Chains Lesson
// ----------------------------------------------------------
// Extends XYChainLesson.css with candidate-state tracing,
// endpoint proofs, return-junction notation, and A-AIC stages.
// ========================================================== */

.aic-definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.aic-definition-grid article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.aic-definition-grid h3 {
  margin: 0 0 0.45rem;
  color: #174f55;
  font-size: 1.04rem;
}

.aic-definition-grid p:last-child {
  margin-bottom: 0;
}

.candidate-state-card {
  border-color: rgba(66, 151, 92, 0.55) !important;
  background: #edf8ef !important;
}

.aic-mini-notation span {
  justify-content: center;
  border: 2px solid rgba(11, 104, 112, 0.22);
}

.aic-mini-notation span small {
  color: #547074;
  font-size: 0.69rem;
  font-weight: 750;
}

.aic-natural-figure img {
  width: min(100%, 327px);
}

.illustration-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  margin-top: 0.9rem;
  color: #405d61;
  font-size: 0.9rem;
  font-weight: 750;
}

.illustration-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.legend-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(35, 59, 62, 0.48);
  border-radius: 3px;
}

.legend-swatch.aic-strong-link {
  border-color: #b7891f;
  background: #fff2bd;
}

.legend-swatch.aic-weak-link {
  border-color: #2588a3;
  background: #e3f2f6;
}

.legend-swatch.aic-victim {
  border-color: #b94742;
  background: #e9abab;
}

.endpoint-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.2rem;
}

.endpoint-summary > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.8rem;
  border: 2px solid #3c72a9;
  border-radius: 10px;
  background: linear-gradient(135deg, #e2f2e3 0 50%, #e5eef9 50%);
  text-align: center;
}

.endpoint-summary .endpoint-bridge {
  border: 0;
  background: transparent;
  color: #547074;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.endpoint-summary .endpoint-conclusion {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: min(100%, 300px);
  border-color: #b94742;
  background: #fdebea;
  color: #762824;
}

.aic-trace {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
  margin-top: 1rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(11, 104, 112, 0.24);
  border-radius: 11px;
  background: #eef5f5;
  scrollbar-color: #80a6aa #dce9ea;
}

.aic-node {
  display: flex;
  flex: 0 0 6.35rem;
  flex-direction: column;
  justify-content: center;
  min-height: 5.3rem;
  padding: 0.65rem 0.45rem;
  border: 2px solid #8a9c9e;
  border-radius: 9px;
  background: #ffffff;
  color: #52696c;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.aic-node code {
  color: inherit;
  font-size: 0.88rem;
}

.aic-node small {
  margin-top: 0.25rem;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aic-node.is-endpoint {
  border-color: #3c72a9;
  background: linear-gradient(135deg, #e2f2e3 0 50%, #e5eef9 50%);
}

.aic-node.is-pending {
  opacity: 0.62;
}

.aic-node.is-true {
  border-color: #23864c;
  background: #dff4e5;
  color: #185f38;
}

.aic-node.is-false {
  border-color: #b94742;
  background: #fdebea;
  color: #8d2b27;
}

.aic-node.is-current {
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px rgba(11, 104, 112, 0.18);
}

.aic-link {
  display: flex;
  flex: 0 0 3.65rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #547074;
  text-align: center;
}

.aic-link strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1rem;
}

.aic-link small {
  margin-top: 0.25rem;
  font-size: 0.62rem;
  font-weight: 750;
}

.aic-link.is-strong strong {
  border: 2px solid #b7891f;
  background: #fff2bd;
  color: #79590f;
}

.aic-link.is-weak strong {
  border: 2px solid #2588a3;
  background: #e3f2f6;
  color: #17637a;
}

.aic-link.is-pending {
  opacity: 0.42;
}

.aic-link.is-reached {
  opacity: 1;
}

.link-ledger {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(11, 104, 112, 0.2);
}

.link-ledger summary {
  color: #174f55;
  font-weight: 800;
  cursor: pointer;
}

.link-token {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 850;
}

.link-token.strong {
  background: #fff2bd;
  color: #79590f;
}

.link-token.weak {
  background: #e3f2f6;
  color: #17637a;
}

.return-junction-card {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(211, 154, 31, 0.62);
  border-radius: 11px;
  background: #fffaf0;
}

.return-junction-card h3 {
  margin: 0 0 0.45rem;
  color: #174f55;
}

.return-junction-card p:last-child {
  margin-bottom: 0;
}

.return-sequence {
  overflow-x: auto;
  padding: 0.75rem;
  border-radius: 8px;
  background: #ffffff;
  white-space: nowrap;
}

.aaic-section {
  background: linear-gradient(145deg, #f2f0fa, #ffffff);
}

.aaic-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.aaic-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.85rem 0.55rem;
  border: 1px solid #7463a9;
  border-radius: 10px;
  background: #ffffff;
  color: #4a3e77;
  font: inherit;
  cursor: pointer;
}

.aaic-stage span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #ece8f8;
  font-weight: 900;
}

.aaic-stage strong {
  font-size: 1rem;
}

.aaic-stage small {
  color: #6d6489;
  text-align: center;
}

.aaic-stage:hover,
.aaic-stage:focus-visible,
.aaic-stage.is-active {
  background: #ece8f8;
  box-shadow: 0 0 0 3px rgba(116, 99, 169, 0.16);
}

.aaic-detail {
  min-height: 4.8rem;
  margin: 0.8rem 0 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #7463a9;
  border-radius: 0 9px 9px 0;
  background: #f4f1fb;
  color: #403664;
  font-weight: 700;
}

.audit-checklist {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.audit-checklist h3 {
  margin: 0 0 0.55rem;
  color: #174f55;
}

.audit-checklist ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.audit-checklist li::marker {
  color: #0b6870;
}

@media (max-width: 800px) {
  .aic-definition-grid,
  .aaic-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .endpoint-summary {
    grid-template-columns: 1fr;
  }

  .endpoint-summary .endpoint-bridge,
  .endpoint-summary .endpoint-conclusion {
    grid-column: auto;
    width: 100%;
  }

  .aic-trace {
    padding: 0.75rem;
  }

  .aic-node {
    flex-basis: 5.8rem;
  }

  .aic-link {
    flex-basis: 3.2rem;
  }
}

@media (max-width: 480px) {
  .aic-definition-grid,
  .aaic-pipeline {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aic-node,
  .aaic-stage {
    transition: none;
  }
}
