/* AI in Model Railroading: the hub and its topic pages.
   Builds on article.css (.feature layout). Each sub-project is a section with a fact strip
   (.ai-facts), plain paragraphs, and a short verdict box (.ai-verdict). */

/* Fact strip: tool, when, status, as small labelled cells. */
.feature-body .ai-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-body);
}

.feature-body .ai-facts > div {
  padding: 0.45rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brand-2);
}

.feature-body .ai-facts dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.feature-body .ai-facts dd {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

/* Small run-in headings inside an entry. */
.feature-body h3.ai-sub {
  margin: 1.2rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--brand-2);
}

/* Verdict: what AI was good at and where a person had to step in. */
.feature-body .ai-verdict {
  margin: 1.3rem 0 0;
  padding: 0.8rem 1rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  font-family: var(--font-body);
  font-size: 0.97rem;
  line-height: 1.5;
}

.feature-body .ai-verdict > b {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.feature-body .ai-verdict ul {
  margin: 0;
  padding-left: 1.2rem;
}

.feature-body .ai-verdict li {
  margin: 0.2rem 0;
}

.feature-body .ai-verdict .k {
  font-weight: 700;
  color: var(--ink-soft);
}

/* "See it" link row at the end of an entry. */
.feature-body .ai-see {
  margin: 0.9rem 0 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.feature-body .ai-see b {
  color: var(--brand);
}

/* Link card: a whole-row link to the full article, placed after a verdict. */
.feature-body a.ai-linkcard {
  display: block;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  font-family: var(--font-body);
  font-size: 0.97rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
}

.feature-body a.ai-linkcard b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.feature-body a.ai-linkcard:hover b,
.feature-body a.ai-linkcard:focus-visible b {
  text-decoration: underline;
}

/* Topic pager at the foot of each topic page. */
.ai-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-body);
  font-weight: 600;
}

.ai-pager a {
  text-decoration: none;
}

/* Hub: the topic cards list their jobs in a short line under the text. */
.ai-hub .card .ai-count {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ai-hub .card .ai-count span {
  white-space: nowrap; /* a job's name never splits across lines */
}

/* Getting started habits: numbered stops along a line, read down each column.
   Deliberately not cards, so the section does not echo the Topics grid. */
.ai-rules {
  list-style: none;
  counter-reset: habit;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  column-gap: 3rem;
}

.ai-rules li {
  counter-increment: habit;
  position: relative;
  padding: 0 0 1.4rem 3.4rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* The stop: a gold-rimmed numbered disc, like the route banner's station. */
.ai-rules li::before {
  content: counter(habit);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--accent);
  color: var(--accent-on-dark);
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1;
  z-index: 1;
}

/* The line to the next stop; the last stop in each column has none. */
.ai-rules li::after {
  content: "";
  position: absolute;
  left: calc(1.15rem - 2px);
  top: 2.3rem;
  bottom: 0;
  width: 4px;
  background: var(--rule);
}

.ai-rules li:last-child::after {
  display: none;
}

.ai-rules b {
  display: block;
  margin: 0.25rem 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  color: var(--brand);
}

@media (min-width: 701px) {
  .ai-rules li:nth-child(4)::after {
    display: none;
  }
}

@media (max-width: 700px) {
  .ai-rules {
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}

/* Hub: tools over time, a plain table that scrolls on phones. */
.ai-tools {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ai-tools th,
.ai-tools td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.ai-tools th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-tools td:first-child {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

/* The Diverging Route banner: the shared .hub-banner card is in ops.css. A straight main line on top, and a
   passing siding whose stops are loud, comic-style AI buzzwords. */
.hub-banner svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.hub-banner .route-tall {
  display: none;
  max-width: 24rem;
  margin: 0 auto;
}

.route-ties {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 18;
  stroke-dasharray: 3 9;
  opacity: 0.35;
}

.route-rail {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 3;
}

.route-ties-hot {
  stroke: var(--brand-2);
  opacity: 0.45;
}

.route-rail-hot {
  stroke: var(--brand);
  stroke-width: 4;
}

.route-points {
  fill: var(--accent);
  stroke: var(--brand);
  stroke-width: 2;
}

.route-stop {
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 3;
}

/* Comic-style labels: loud, tilted, mixed sizes, offset shadows. */
.cm-shadow {
  fill: var(--ink);
}

.cm-bubble,
.cm-tag,
.cm-burst {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.cm-bubble {
  fill: var(--accent);
}

.cm-tag {
  fill: var(--card);
}

.cm-burst {
  fill: var(--brand-2);
}

.cm-tail {
  fill: var(--ink);
}

.cm-text {
  font-family: "Marker Felt", "Chalkboard SE", "Bradley Hand", "Comic Neue", "Comic Sans MS", cursive;
  font-weight: 700;
  fill: var(--ink);
}

.cm-text.cm-on-dark {
  fill: #fff;
}

.cm-text.cm-plain {
  fill: var(--brand);
  stroke: var(--card);
  stroke-width: 6;
  paint-order: stroke;
  stroke-linejoin: round;
}

@media (max-width: 700px) {
  .hub-banner .route-wide {
    display: none;
  }

  .hub-banner .route-tall {
    display: block;
  }
}

/* Getting started: a sub-heading and a plain bulleted list under the habits list. */
.hub-group .hub-sub {
  margin: 2rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--brand-2);
}

.ai-try {
  columns: 2;
  column-gap: 2.5rem;
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.ai-try li {
  margin: 0 0 0.5rem;
  break-inside: avoid;
}

.ai-adv {
  margin: 0 0 1rem;
}

@media (max-width: 700px) {
  .ai-try {
    columns: 1;
  }
}

/* Topics follows Getting started: same extra gap the Operations hub uses between its two groups. */
#topics {
  margin-top: 2.5rem;
}

/* The section's name in the intro: a true bold (700 is loaded on this page only) in the dark brand colour. */
.ai-hub .page-head .section-note strong {
  font-weight: 700;
  color: var(--brand);
}
