/* Module 05 — Model Comparison.
   Only what styles.css does not already provide: a five-up comparison grid,
   the per-answer stat strip, verdict colours, and a comparison table that
   stacks into readable rows on a phone. Every selector is scoped to this
   module's body so nothing here can leak into another page. Plain CSS, no
   nesting — these pages get opened on whatever phone the student brought. */

/* ------------------------------------------------ five columns, not three */

/* styles.css assumes three compare columns; this module has five, so the
   breakpoints are re-declared here rather than changed in the shared file.
   The body[data-module] prefix keeps these more specific than the shared
   three-column rule at every width. */
body[data-module="models"] #compare-grid.compare-cols {
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 700px) {
  body[data-module="models"] #compare-grid.compare-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1060px) {
  body[data-module="models"] #compare-grid.compare-cols { grid-template-columns: repeat(5, 1fr); }
}

/* ---------------------------------------------------------- column heads */

body[data-module="models"] .mc-arch {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
  line-height: 1.3;
}
body[data-module="models"] .mc-arch-sub {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
body[data-module="models"] .mc-verdict-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

/* Once the five columns sit side by side, line the answer bodies up with each
   other: fix the header height and push the verdict badges to its bottom edge,
   so a two-line archetype name does not shunt one column out of step. */
@media (min-width: 1060px) {
  body[data-module="models"] .compare-col-head {
    display: flex;
    flex-direction: column;
    min-height: 200px;
  }
  body[data-module="models"] .mc-verdict-row { margin-top: auto; padding-top: 9px; }
}
body[data-module="models"] .mc-verdict,
body[data-module="models"] .mc-pick {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
body[data-module="models"] .mc-verdict.ok   { background: var(--ok-soft);     color: var(--ok);     border-color: #bfe3cc; }
body[data-module="models"] .mc-verdict.warn { background: var(--warn-soft);   color: var(--warn);   border-color: #f0d9b5; }
body[data-module="models"] .mc-verdict.bad  { background: var(--danger-soft); color: var(--danger); border-color: #f0c2c2; }
body[data-module="models"] .mc-pick {
  background: var(--surface);
  color: var(--accent-dark);
  border-color: var(--accent);
}

/* ------------------------------------------------------------ stat strip */

body[data-module="models"] .mc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
body[data-module="models"] .mc-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 9px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
body[data-module="models"] .mc-stat-k {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
body[data-module="models"] .mc-stat-v {
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
body[data-module="models"] .mc-stat-note {
  font-size: .76rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
}

/* --------------------------------------------------------------- reveals */

body[data-module="models"] .mc-sub {
  font-size: .9rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
body[data-module="models"] .mc-list {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: .95rem;
}
body[data-module="models"] .mc-list li { margin-bottom: 4px; }

/* ----------------------------------------------------- comparison table */

body[data-module="models"] .mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  margin-top: 6px;
}
body[data-module="models"] .mc-table th,
body[data-module="models"] .mc-table td {
  text-align: left;
  vertical-align: top;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}
body[data-module="models"] .mc-table thead th {
  font-size: .76rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line-strong);
}
body[data-module="models"] .mc-table tbody th { font-weight: 700; color: var(--ink); }
body[data-module="models"] .mc-table td { color: var(--ink-soft); }

/* Phones: no horizontal scrolling. Each row becomes a small stacked block and
   the column heading travels with it as a label. */
@media (max-width: 719px) {
  body[data-module="models"] .mc-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  body[data-module="models"] .mc-table,
  body[data-module="models"] .mc-table tbody,
  body[data-module="models"] .mc-table tr,
  body[data-module="models"] .mc-table th,
  body[data-module="models"] .mc-table td { display: block; }
  body[data-module="models"] .mc-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 4px 2px 8px;
    margin-bottom: 12px;
  }
  body[data-module="models"] .mc-table th,
  body[data-module="models"] .mc-table td { border-bottom: 0; padding: 6px 12px; }
  body[data-module="models"] .mc-table tbody th { font-size: 1rem; padding-top: 10px; }
  body[data-module="models"] .mc-table td::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
}

/* ---------------------------------------------------- touch target sizes */

body[data-module="models"] .chip { min-height: 44px; padding-left: 16px; padding-right: 16px; }

/* Long prompts and code answers must never widen the page. */
body[data-module="models"] .response-body.code,
body[data-module="models"] .compare-out { overflow-wrap: anywhere; }

/* The stat strip gets cramped on the narrowest phones — two up reads better
   than three squeezed. */
@media (max-width: 400px) {
  body[data-module="models"] .mc-stats { grid-template-columns: repeat(2, 1fr); }
  body[data-module="models"] .mc-stat:last-child { grid-column: 1 / -1; }
}
