/* Legal documents: terms, privacy, cookies, sub-processors, and the footer
   that links them.

   These live in a stylesheet rather than inline <style> blocks because
   scripts/ui_v2_template_audit.py treats a style block or a raw hex literal in
   a template as a hard failure. Colours are inherited from the shell's
   variables wherever one exists, so the documents follow the theme. */

.legal-doc {
  max-width: 52rem;
  margin-inline: auto;
}

.legal-doc h1 {
  margin-bottom: 1.5rem;
}

.legal-doc h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.legal-doc h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-doc p,
.legal-doc li {
  line-height: 1.65;
}

.legal-doc ul,
.legal-doc ol {
  margin-bottom: 1rem;
}

/* The header block rendered by legal/_meta.html. */
.legal-meta {
  border-left: 3px solid var(--bs-primary, currentColor);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.legal-meta dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin-bottom: 0;
}

.legal-meta dt {
  font-weight: 600;
  opacity: 0.75;
}

.legal-meta dd {
  margin-bottom: 0;
}

/* Cookie and sub-processor tables read as reference material, not data grids. */
.legal-table {
  width: 100%;
  font-size: 0.9375rem;
}

.legal-table th {
  text-align: left;
  vertical-align: bottom;
}

.legal-table td,
.legal-table th {
  padding: 0.5rem 0.75rem;
}

.legal-table code {
  white-space: nowrap;
}

/* Cross-links between the documents, shown under the meta block. */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color, currentColor);
}

/* The site-wide footer that links the documents from every page. */
.legal-footer {
  margin-top: 3rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--bs-border-color, currentColor);
  font-size: 0.875rem;
  opacity: 0.85;
}

.legal-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-footer a {
  text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus {
  text-decoration: underline;
}

/* Small-print attribution, e.g. the reCAPTCHA notice Google's terms require. */
.legal-attribution {
  font-size: 0.8125rem;
  opacity: 0.7;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

@media (max-width: 575.98px) {
  .legal-meta dl {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-meta dd {
    margin-bottom: 0.5rem;
  }
}
