/* /evidence/ and the four framework pages (SOC 2, ISO 27001, PCI DSS, DORA).
   White stock; worked examples are pink (the evaluator's record) with typed entries.
   Tables are reference tables unless they are an exercise document (attendance, tracker).
   Framework rows come from FRAMEWORKS in scripts/build-site.mjs ({{frameworkTable}},
   {{frameworkCard}}). Page-only classes start with ev- or fw-. */

/* ---------- A worked example inside a white sheet: pink stock, violet entries ---------- */
.ev-pink {
  --stock: var(--pink);
  --fill: var(--carbon);
}
/* the rows carry the stock, so a caption above stays on white */
table.ev-pink tbody tr {
  background: var(--pink);
}
.main > table + .note {
  margin-top: var(--s6);
}
.ev-docs {
  display: grid;
  gap: var(--s7);
}
.ev-docs .table-note {
  margin-top: calc(-1 * var(--s7) + var(--s3));
}
.ev-docs .table-note .typed {
  font-size: var(--ty-out);
}
.side > p.note {
  margin-top: 0;
}

/* ---------- Reference tables ---------- */
.ev-pack thead th:nth-child(1) {
  width: 15rem;
}
.fw-table thead th:nth-child(1) {
  width: 14rem;
}
.fw-table thead th:nth-child(4) {
  width: 12rem;
}
.fw-scen thead th:nth-child(1) {
  width: 40%;
}

/* A framework at a glance: the reference list with room for longer terms */
.fw-card {
  grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
}
.fw-card > dt {
  font-stretch: 85%;
}

/* ---------- Exercise documents (ruled) ---------- */
.ev-attend thead th:nth-child(1),
.ev-tracker thead th:nth-child(1) {
  width: 3rem;
}
.ev-attend thead th:nth-child(5) {
  width: 6rem;
}
.ev-tracker thead th:nth-child(4) {
  width: 10rem;
}
.ev-tracker thead th:nth-child(5) {
  width: 7rem;
}
.ev-tracker thead th:nth-child(6) {
  width: 5rem;
}
@media (max-width: 700px) {
  /* attendance: no. | name, job title, exercise role | initials */
  .ev-attend td:nth-child(1) {
    grid-column: span 1;
  }
  .ev-attend td:nth-child(2) {
    grid-column: span 5;
    border-top: 0;
    border-left: 1px solid var(--ink);
  }
  .ev-attend td:nth-child(3),
  .ev-attend td:nth-child(4) {
    grid-column: span 3;
  }
  .ev-attend td:nth-child(4) {
    border-left: 1px solid var(--ink);
  }
  .ev-attend td:nth-child(5) {
    min-height: 3.2rem;
  }
}
/* the trackers have six or seven columns, so they restack sooner (stack-lg, 860px) */
@media (max-width: 860px) {
  /* tracker: no. | finding, action, owner | due | status */
  .ev-tracker td:nth-child(1) {
    grid-column: span 1;
  }
  .ev-tracker td:nth-child(2) {
    grid-column: span 5;
    border-top: 0;
    border-left: 1px solid var(--ink);
  }
  .ev-tracker td:nth-child(n + 4) {
    grid-column: span 2;
    white-space: normal;
  }
  .ev-tracker td:nth-child(n + 5) {
    border-left: 1px solid var(--ink);
  }
}

/* a full-width document after a split part (the tracker under the plan and attendance) */
.part > .ev-after {
  margin-top: var(--s7);
}
.ev-tracker thead th:nth-child(2) {
  width: 17rem;
}

/* actions with success measures (ISO page): no. | action | owner | due | measure | status | closed */
.ev-actions thead th:nth-child(1) {
  width: 3rem;
}
.ev-actions thead th:nth-child(3) {
  width: 9rem;
}
.ev-actions thead th:nth-child(4) {
  width: 7.5rem;
}
.ev-actions thead th:nth-child(6) {
  width: 5rem;
}
.ev-actions thead th:nth-child(7) {
  width: 6rem;
}
@media (max-width: 860px) {
  .ev-actions td:nth-child(1) {
    grid-column: span 1;
  }
  .ev-actions td:nth-child(2) {
    grid-column: span 5;
    border-top: 0;
    border-left: 1px solid var(--ink);
  }
  .ev-actions td:nth-child(3),
  .ev-actions td:nth-child(4) {
    grid-column: span 3;
  }
  .ev-actions td:nth-child(4),
  .ev-actions td:nth-child(7) {
    border-left: 1px solid var(--ink);
  }
  .ev-actions td:nth-child(6),
  .ev-actions td:nth-child(7) {
    grid-column: span 3;
  }
  .ev-actions td:nth-child(7) {
    min-height: 3.2rem;
  }
}

/* typed entries listed in a form cell (gaps, actions, plan updates) */
.ev-typed-list {
  max-width: 62ch;
}

/* scores read as a row of readings (DORA page) */
.ev-scores .typed {
  font-size: var(--ty-read);
  font-weight: 700;
  line-height: 1.05;
}

/* ---------- Prose steps and the closing actions ---------- */
.ev-steps ol > li + li {
  margin-top: var(--s4);
}
.ev-next .main .onward {
  margin-top: var(--s3);
}
/* the onward link closes the stack of actions rather than starting a new group */
.ev-next .aside .onward {
  margin-top: calc(-1 * var(--s4));
}
