/*
 * aihi-trust.css - the page styles of the trust, legal and reference pages (Phase 3, builder B5): How we test, How we
 * rank, How we check prices, What we compare, About us, Terms of Use, Privacy notice, Cookies, Corrections,
 * Glossary and Contact (inc/aihi-trust.php). Loaded after the shared aihi-site.css, whose tokens, prose, table, form
 * and gap styles it uses; it adds only what these pages print: bench state lines, the criteria table, provider groups,
 * the tests list, glossary entries, correction entries and the contact form. Mockup E look (colours from the shared
 * tokens; yellow stays for the Ad label and the gap marker only). Strict CSP: classes only, no inline style.
 * Every small-screen rule sits in ONE marked block at the end.
 */

/* ---------------------------------------------------------------- sections */

/* the sections sit one level inside .aihi-prose: the same rhythm as its own children (paragraphs 1em apart) */
.aihi-trust .aihi-section > * + * { margin-top: 1em; }
.aihi-trust .aihi-section > h2 + *, .aihi-trust .aihi-section > h3 + * { margin-top: 0.6em; }
.aihi-trust > .aihi-section:first-child > h2:first-child { margin-top: 0.4em; }
.aihi-trust-table th[scope="row"] { min-width: 9.5em; }
.aihi-trust-section--benches > .aihi-section { margin-top: 1.4em; padding-top: 1.2em; border-top: 1px solid var(--c-line); }
.aihi-trust-section--benches > .aihi-section > h3 { margin-top: 0; }

/* the state line of a bench ("We have not run this bench yet.") */
.aihi-trust-status {
  display: inline-block;
  margin-top: 0.5em;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--c-filter-bg);
  border: 1px solid var(--c-table-line);
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.aihi-trust-empty, .aihi-trust-fallback {
  padding: 14px 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
  color: var(--c-text-2);
}
.aihi-trust-meta { color: var(--c-muted); font-size: 15px; }

/* ---------------------------------------------------------------- How we rank: the criteria table */

.aihi-trust-table table { min-width: 560px; }
/* the description keeps a readable width: on phones the table scrolls sideways inside its labelled box instead */
.aihi-trust-table tbody td:last-child, .aihi-trust-table thead th:last-child { min-width: 21em; }
.aihi-trust-table caption { padding: 14px 12px 6px; }
.aihi-trust-table tbody th { font-weight: 700; }
.aihi-trust-table tfoot th, .aihi-trust-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--c-table-line); }
.aihi-trust-num { white-space: nowrap; text-align: right; }
.aihi-prose th.aihi-trust-num, .aihi-prose td.aihi-trust-num { text-align: right; }

/* ---------------------------------------------------------------- What we compare and How we test: lists of links */

.aihi-trust-group + .aihi-trust-group { margin-top: 1.2em; }
.aihi-trust-group h3 { margin-top: 1.2em; font-size: 19px; }
.aihi-trust-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 4px 24px;
}
.aihi-prose .aihi-trust-list { padding-left: 0; }
.aihi-prose .aihi-trust-list li + li { margin-top: 0; }
.aihi-trust-list a { font-weight: 600; }
.aihi-trust-tests { list-style: none; }
.aihi-prose .aihi-trust-tests { padding-left: 0; }
.aihi-trust-tests li { padding: 10px 0; border-bottom: 1px solid var(--c-row-line); }
.aihi-prose .aihi-trust-tests li + li { margin-top: 0; }
.aihi-trust-tests a { font-weight: 600; }

/* ---------------------------------------------------------------- Glossary and Corrections: entries with anchors */

.aihi-trust-term, .aihi-trust-entry { scroll-margin-top: 24px; }
.aihi-trust-term { padding-top: 1.2em; border-top: 1px solid var(--c-line); }
.aihi-trust-term + .aihi-trust-term { margin-top: 1.2em; }
.aihi-trust-term > h2 { margin-top: 0; font-size: 24px; }
.aihi-trust-term > p + p { margin-top: 0.8em; }
.aihi-trust-term:target, .aihi-trust-entry:target, .aihi-trust-section:target > h2, .aihi-trust-section:target > h3 {
  outline: 2px solid var(--c-blue);
  outline-offset: 6px;
  border-radius: 4px;
}
.aihi-trust-entry {
  margin-top: 1.2em;
  padding: 18px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
}
.aihi-trust-entry > h3 { margin-top: 0; font-size: 20px; }
.aihi-trust-entry > .aihi-trust-meta { margin-top: 0.3em; }
.aihi-trust-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin-top: 0.9em; }
.aihi-trust-dl dt { font-weight: 600; color: var(--c-text-2); }
.aihi-trust-dl dd { margin: 0; }
.aihi-trust-dl dd > p + p { margin-top: 0.6em; }

/* ---------------------------------------------------------------- Contact: the form */

.aihi-contact__form { margin-top: 1.2em; }
.aihi-contact__field { display: flex; flex-direction: column; gap: 4px; }
.aihi-contact__field label { margin-bottom: 2px; }
.aihi-contact__select { width: 100%; min-height: var(--touch); font-size: 16px; }
.aihi-contact__field .aihi-error { margin-top: 2px; }
.aihi-contact__field [aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 1px #B3261E; }
.aihi-contact__alert { margin-top: -4px; }
.aihi-contact__done strong { display: block; font-size: 17px; }
.aihi-contact__nojs, .aihi-contact__email, .aihi-contact__closed { color: var(--c-text-2); }
/* the honeypot: out of sight and out of reach (aria-hidden, tabindex -1); people never fill it in */
.aihi-contact__hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.aihi-contact__form button[aria-disabled="true"] { opacity: 0.7; cursor: progress; }

/* ================================================================ SMALL SCREENS (every small-screen rule is here) */

/* touch sizes at 1024 px and below: list links and table scrolling get 44 px targets */
@media (max-width: 1024px) {
  .aihi-trust-list a, .aihi-trust-tests a, .aihi-trust-dl a { display: inline-flex; align-items: center; min-height: var(--touch); }
  .aihi-trust-tests li { padding: 4px 0; }
}

/* phones: definition lists stack, the criteria table scrolls inside its box */
@media (max-width: 560px) {
  .aihi-trust-dl { grid-template-columns: 1fr; gap: 2px; }
  .aihi-trust-dl dd + dt { margin-top: 10px; }
  .aihi-trust-entry { padding: 16px; }
}
