/* Authority pages: comparison tables, checklists, glossary and browser tools.
   Uses the existing site.css design tokens so these pages match the published
   design without introducing a second visual language. */

.authority-page .compare-table-wrap {
  margin: var(--space-32, 2rem) 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-14, 14px);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.authority-page .compare-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: var(--font-size-small-1, .9375rem);
  text-align: left;
}

.authority-page .compare-table th,
.authority-page .compare-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

.authority-page .compare-table thead th {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  white-space: nowrap;
}

.authority-page .compare-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--ink);
  width: 34%;
}

.authority-page .compare-table tbody tr:last-child th,
.authority-page .compare-table tbody tr:last-child td { border-bottom: 0; }

.authority-page .checklist {
  list-style: none;
  padding: 0;
  margin: var(--space-28, 1.75rem) 0;
  display: grid;
  gap: .7rem;
}

.authority-page .checklist li {
  position: relative;
  padding-left: 1.9rem;
  line-height: 1.55;
}

.authority-page .checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .48em;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  border: 2px solid var(--blue);
}

.authority-page .glossary-list { margin: var(--space-28, 1.75rem) 0; display: grid; gap: 0; }

.authority-page .glossary-entry {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 6rem;
}

.authority-page .glossary-entry:last-child { border-bottom: 1px solid var(--line); }

.authority-page .glossary-entry dt {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .3rem;
}

.authority-page .glossary-entry dd { margin: 0; color: var(--muted); line-height: 1.6; }

.authority-page .research-sources ul { padding-left: 1.1rem; }
.authority-page .research-sources li { margin-bottom: .45rem; line-height: 1.5; }

/* ---------------------------------------------------------------- tools */

.frh-tool {
  margin: var(--space-32, 2rem) 0;
  padding: var(--space-26, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-15, 15px);
  background: var(--white);
  box-shadow: 0 18px 48px rgba(11, 30, 44, .07);
}

.frh-tool .frh-tool-note {
  font-size: var(--font-size-small-1, .9rem);
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.frh-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 2.1rem 1.25rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius-14, 14px);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.frh-drop:hover,
.frh-drop.is-over { border-color: var(--blue); background: #eef3ff; }
.frh-drop:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.frh-drop strong { font-size: 1.02rem; color: var(--ink); }
.frh-drop span { font-size: .86rem; color: var(--muted); }
.frh-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.frh-result { margin-top: 1.15rem; }
.frh-result:empty { display: none; }

.frh-verdict {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .85rem 1rem;
  border-radius: var(--radius-12, 12px);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.frh-verdict strong { font-size: 1.02rem; }
.frh-verdict.is-good { background: #e7f8f2; border-left: 4px solid var(--mint); }
.frh-verdict.is-warn { background: #fff5e9; border-left: 4px solid var(--orange); }
.frh-verdict.is-bad { background: #fdecef; border-left: 4px solid #d2445c; }
.frh-verdict.is-info { background: #eef3ff; border-left: 4px solid var(--blue); }

.frh-fields { display: grid; gap: 0; margin: 0; }

.frh-field {
  display: grid;
  grid-template-columns: minmax(9rem, 38%) 1fr;
  gap: .5rem 1rem;
  padding: .6rem 0;
  border-top: 1px solid var(--line);
  font-size: var(--font-size-small-1, .92rem);
}

.frh-field:last-child { border-bottom: 1px solid var(--line); }
.frh-field dt { color: var(--muted); }
.frh-field dd { margin: 0; font-family: var(--mono); font-size: .86rem; color: var(--ink); word-break: break-word; }

.frh-questions { display: grid; gap: 1.15rem; margin: 0 0 1.3rem; }
.frh-question { display: grid; gap: .55rem; }
.frh-question > p { margin: 0; font-weight: 600; color: var(--ink); line-height: 1.4; }
.frh-options { display: flex; flex-wrap: wrap; gap: .5rem; }

.frh-options label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-size: .89rem;
  line-height: 1.3;
  transition: border-color .16s ease, background .16s ease;
}

.frh-options label:hover { border-color: var(--blue); }
.frh-options input { accent-color: var(--blue); margin: 0; }
.frh-options input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.frh-options label:has(input:checked) { border-color: var(--blue); background: #eef3ff; }

.frh-calc { display: grid; gap: .95rem; margin-bottom: 1.2rem; }
.frh-calc label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }

.frh-calc input[type="number"] {
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-12, 12px);
  font: inherit;
  font-family: var(--mono);
  background: var(--white);
  color: var(--ink);
  max-width: 16rem;
}

.frh-calc input[type="number"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.frh-hex {
  margin: 0;
  padding: .9rem 1rem;
  background: var(--ink);
  color: #dce7f0;
  border-radius: var(--radius-12, 12px);
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

.frh-noscript {
  padding: .9rem 1rem;
  border-left: 4px solid var(--orange);
  background: #fff5e9;
  font-size: .92rem;
}

@media (max-width: 640px) {
  .frh-field { grid-template-columns: 1fr; gap: .15rem; padding: .55rem 0; }
  .frh-tool { padding: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .frh-drop, .frh-options label { transition: none; }
}

.authority-page .hub-grid { margin-top: var(--space-28, 1.75rem); }
.authority-page .hub-grid p {
  margin: .4rem 0 .6rem;
  font-size: var(--font-size-small-1, .9rem);
  color: var(--muted);
  line-height: 1.5;
}

/* ---------------------------------------------- guide hub authority block */
/* Not scoped to .authority-page: this block lives on the guide hubs, which
   carry body class "guide-page hub-page". */

.hub-authority { padding-block: var(--space-40, 2.5rem) 0; }

.hub-authority .hub-authority-intro {
  max-width: 60ch;
  color: var(--muted);
  margin: var(--rhythm-heading-to-copy, .8em) 0 0;
}

.hub-authority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-18, 1.1rem);
  margin-top: var(--space-28, 1.75rem);
}

.hub-authority-grid a {
  display: block;
  padding: var(--space-22, 1.35rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-14, 14px);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: border-color .16s ease, transform .16s ease;
}

.hub-authority-grid a:hover { border-color: var(--blue); transform: translateY(-2px); }
.hub-authority-grid a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.hub-authority-grid small {
  display: block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .5rem;
}

.hub-authority-grid strong { display: block; font-size: 1.02rem; color: var(--ink); line-height: 1.3; }
.hub-authority-grid p { margin: .45rem 0 0; font-size: .9rem; color: var(--muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { .hub-authority-grid a { transition: none; } }
