/* A block's lab tests (tests-page.js, on crop-soil-tests.html and crop-leaf-tests.html): the block's tests at a
   glance, the latest at a depth or of a part, read in parts (each page's own parts are in its own
   sheet: pages/soil.css), the tests side by side, each test, and putting one in. */

.tests-open { padding-block: clamp(2rem, 5vw, 3.6rem) clamp(1rem, 3vw, 2rem); }
.tests-open h1 { margin: 0.2rem 0 0.6rem; text-wrap: balance; }
.tests-open .lede { max-width: 44rem; margin: 0; }
.tests-main { padding-block: 0 var(--section); }
.tests-main > .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.3rem, 3vw, 2.2rem); }
.tests-main h2 { text-wrap: balance; }
.tests-pick { max-width: 26rem; }
.tests-note h2 { margin-top: 0; }
.tests-note > :last-child { margin-bottom: 0; }

/* the block's tests at a glance, and which depth or part */
.tests-head { display: grid; gap: 0.5rem; }
.tests-head > * { margin: 0; }
.tests-head h2 { font-size: var(--step-3); }
.tests-head__when { color: var(--ink-2); font-weight: 600; }
.tests-head__sample { color: var(--ink-3); font-size: 0.92rem; }
.tests-wheres { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.tests-wheres button { font: inherit; font-size: 0.9rem; font-weight: 700; padding: 0.4rem 0.85rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; }
.tests-wheres button[aria-pressed="true"] { background: var(--canopy); border-color: var(--canopy); color: var(--paper); }
.tests-head__go { margin-top: 0.4rem; }
/* the head and the tests sit in the page's grid, either side of the form */
.tests-top, .tests-rest { display: contents; }

/* putting a test in: the lab's file and what's read from it to check (lab.css), or typed in */
.tests-form { display: grid; gap: 0.9rem; }
.tests-form[hidden], .tests-hand[hidden] { display: none; }
.tests-form > *, .tests-hand > * { margin: 0; }
.tests-form h2 { font-size: var(--step-2); }
.tests-form h2:focus { outline: none; }
.tests-hand { display: grid; gap: 0.9rem; }
.tests-hand__title { font-size: 1.1rem; }
.tests-form__lede { color: var(--ink-2); max-width: 46rem; }
.tests-form__when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1.6rem; }
.tests-form__where input { width: 9rem; }
.tests-form__where.is-wide input, .tests-form__stage input { width: 13rem; }
.tests-in { padding-top: 0.6rem; border-top: 1px dashed rgba(30, 43, 34, 0.28); }
.tests-in summary { cursor: pointer; font-weight: 700; }
.tests-in__count { font-weight: 600; color: var(--ink-2); }
.tests-in .lab-in-wrap { margin-top: 0.5rem; }
.tests-in__unit { font-size: 0.88rem; color: var(--ink-2); }
.tests-in__as { display: block; font-size: 0.8rem; font-weight: 400; font-style: italic; color: var(--ink-3); }
.tests-form__bad { font-weight: 700; color: var(--earth); }
.tests-form__go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
.tests-ask { display: grid; gap: 0.5rem; padding: 0.7rem 0.8rem; border-radius: 10px; background: rgba(242, 182, 50, 0.16); max-width: 46rem; }
.tests-ask > * { margin: 0; }
.tests-ask > p { font-weight: 600; }

/* the latest test, in parts */
.tests-latest { display: grid; gap: 1rem; }
.tests-latest > h2, .tests-years h2, .tests-each h2 { margin: 0; font-size: var(--step-3); }
.tests-latest__what { margin: -0.4rem 0 0; color: var(--ink-2); font-weight: 600; }
.tests-latest__print { display: flex; flex-wrap: wrap; gap: 0 1.4rem; margin: -0.6rem 0 0; }
.tests-latest__print .walk-link { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; }
.tests-latest__print .walk-link svg { flex: none; width: 1.05rem; height: 1.05rem; color: var(--earth); }
.tests-part { display: grid; gap: 0.7rem; align-content: start; }
.tests-part > * { margin: 0; }
.tests-part h3 { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step-1); }
.tests-part h3 svg { flex: none; width: 1.3rem; height: 1.3rem; color: var(--earth); }
.tests-part h3 span { font-weight: 600; color: var(--ink-3); }
.tests-part__lede { color: var(--ink-2); max-width: 46rem; margin: 0; }
.tests-part a { color: inherit; }

/* numbers as a list */
.tests-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0 1.6rem; margin: 0; }
.tests-nums > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 0.8rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--rule); }
.tests-nums dt { font-size: 0.94rem; }
.tests-how { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-3); }
.tests-nums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* the lab's own range for a number, and its word on it, on a line of its own under the number */
.tests-nums dd.tests-range { flex-basis: 100%; font-size: 0.78rem; font-weight: 600; color: var(--ink-3); white-space: normal; }
.tests-range__word { display: inline-block; margin-left: 0.2rem; padding: 0.02rem 0.45rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; color: var(--ink); background: var(--paper-2); }
.tests-range__word.is-low { background: rgba(217, 119, 74, 0.25); }
.tests-range__word.is-high { background: rgba(247, 210, 106, 0.5); }
.tests-range__word.is-ok { background: var(--sap-2); }
.tests-guide { margin: 0; font-size: 0.86rem; color: var(--ink-3); }

/* side by side */
.tests-years { display: grid; gap: 0.6rem; }
.tests-years > p { margin: 0; }
.tests-years__wrap { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper); }
.tests-years__table { border-collapse: collapse; width: 100%; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.tests-years__table th, .tests-years__table td { padding: 0.5rem 0.75rem; text-align: right; border-bottom: 1px solid rgba(30, 43, 34, 0.12); white-space: nowrap; }
.tests-years__table thead th { font-size: 0.82rem; vertical-align: bottom; }
.tests-years__table th:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); white-space: normal; min-width: 11rem; }
.tests-years__table tbody tr:last-child > * { border-bottom: 0; }
.tests-years__table a { color: inherit; }
.tests-years__unit { margin-left: 0.35rem; font-size: 0.78rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tests-years__table .tests-how { display: inline; }
.tests-years__stage { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-3); white-space: normal; }
.tests-years__group th { background: var(--paper-2) !important; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-2); padding-top: 0.6rem; }

/* each test */
.tests-each { display: grid; gap: 0.6rem; }
.tests-each__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.tests-test { padding: 0.7rem 0; border-top: 1px dashed rgba(30, 43, 34, 0.24); display: grid; gap: 0.25rem; }
.tests-test > * { margin: 0; }
.tests-test__file { color: var(--ink-3); font-size: 0.9rem; }
.tests-test__go { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.2rem; font-size: 0.92rem; }
.tests-test__go > span { font-weight: 700; }

/* what to do with them */
.tests-go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem; }
.tests-go .walk-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.tests-go .walk-link svg { flex: none; width: 1.05rem; height: 1.05rem; color: var(--earth); }
/* on a touch screen each link in a test's row and in the foot is 44 px high to tap, as the walks' are
   (walk.css); a row that wraps keeps its lines touching, so no two taps overlap (qag-10asg) */
@media (pointer: coarse) {
  .tests-test__go { row-gap: 0; }
  .tests-test__go .walk-link, .tests-go .walk-link { display: inline-flex; align-items: center; min-height: 44px; }
}
.tests-kept { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; font-size: 0.9rem; color: var(--ink-3); }
.tests-kept svg { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; color: var(--earth); }
