/*
 * Chrome for the public legal documents (/terms and /privacy).
 *
 * Propshaft's `stylesheet_link_tag :app` bundles every file in this directory,
 * so the pages pick this up with no <link> of their own. Everything is scoped
 * under .legal-* to keep it out of the admin panel's way.
 */

:root {
  --legal-ink: #0f172a;
  --legal-body: #334155;
  --legal-muted: #64748b;
  --legal-rule: #e2e8f0;
  --legal-link: #2563eb;
  --legal-dark: #0f172a;
  --legal-dark-ink: #f8fafc;
  --legal-dark-body: #94a3b8;
  --legal-dark-rule: #334155;
}

/* Masthead ---------------------------------------------------------------- */

.legal-masthead {
  background: var(--legal-dark);
  color: #e2e8f0;
  padding: 20px 0 40px;
}

.legal-masthead__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.legal-masthead__brand {
  color: #f1f5f9;
  font-weight: 600;
  text-decoration: none;
}

.legal-masthead__brand:hover { color: #fff; }

.legal-masthead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-masthead__link {
  color: var(--legal-dark-body);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--legal-dark-rule);
  border-radius: 8px;
  padding: 6px 14px;
}

.legal-masthead__link:hover {
  color: #f1f5f9;
  border-color: #475569;
}

.legal-masthead__title {
  font-size: 40px;
  font-weight: 700;
  color: var(--legal-dark-ink);
  margin: 0 0 12px;
}

.legal-masthead__lead {
  color: var(--legal-dark-body);
  font-size: 17px;
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 0 20px;
}

.legal-masthead__meta {
  display: inline-block;
  background: #1e293b;
  border: 1px solid var(--legal-dark-rule);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 14px;
  margin: 0;
}

/* Body -------------------------------------------------------------------- */

.legal-body { padding: 40px 0 64px; }

.legal-toc {
  position: sticky;
  top: 24px;
  border-left: 2px solid var(--legal-rule);
  padding-left: 18px;
}

.legal-toc__heading {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--legal-muted);
  margin-bottom: 12px;
}

.legal-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-toc__list li { margin-bottom: 8px; }

.legal-toc__link {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.legal-toc__link:hover {
  color: var(--legal-link);
  text-decoration: underline;
}

.legal-section {
  scroll-margin-top: 24px;
  margin-bottom: 36px;
}

.legal-section__heading {
  font-size: 21px;
  font-weight: 650;
  color: var(--legal-ink);
  margin-bottom: 12px;
}

.legal-section p,
.legal-section ul {
  color: var(--legal-body);
  line-height: 1.75;
  max-width: 68ch;
}

.legal-section p { margin-bottom: 12px; }
.legal-section ul { padding-left: 20px; }
.legal-section li { margin-bottom: 8px; }
.legal-section strong { color: var(--legal-ink); }
.legal-section a { color: var(--legal-link); }

.legal-footer {
  border-top: 1px solid var(--legal-rule);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
}

.legal-footer__label {
  color: var(--legal-muted);
  font-size: 14px;
  margin: 0;
}

.legal-footer__link {
  color: var(--legal-link);
  font-size: 14px;
  text-decoration: none;
  font-weight: 600;
}

.legal-footer__link:hover { text-decoration: underline; }

/* Footer link pair reused outside the documents themselves. */

.legal-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--legal-muted);
}

.legal-links a {
  color: var(--legal-muted);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--legal-ink);
  text-decoration: underline;
}

/* Keyboard users get a visible target on every interactive element. */

.legal-masthead__link:focus-visible,
.legal-masthead__brand:focus-visible,
.legal-toc__link:focus-visible,
.legal-footer__link:focus-visible,
.legal-section a:focus-visible,
.legal-links a:focus-visible {
  outline: 2px solid var(--legal-link);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 991px) {
  .legal-masthead__title { font-size: 30px; }

  .legal-toc {
    position: static;
    margin-bottom: 32px;
  }
}

/* Print ------------------------------------------------------------------- */
/*
 * People file these documents: they save the page as a PDF or print it for a
 * contract folder. Drop the navigation, which is useless on paper, and keep
 * the title, the effective date, and the text itself readable in black ink.
 */

@media print {
  .legal-masthead {
    background: none;
    color: #000;
    padding: 0 0 16pt;
    border-bottom: 1pt solid #000;
  }

  .legal-masthead__bar,
  .legal-masthead__actions,
  .legal-toc,
  .legal-footer__link { display: none; }

  .legal-masthead__title,
  .legal-masthead__lead,
  .legal-masthead__meta,
  .legal-section__heading,
  .legal-section p,
  .legal-section ul,
  .legal-section a { color: #000; }

  .legal-masthead__meta {
    background: none;
    border: 0;
    padding: 0;
    font-weight: 700;
  }

  .legal-body { padding: 16pt 0 0; }

  .legal-section {
    margin-bottom: 14pt;
    break-inside: avoid;
  }

  .legal-section__heading { break-after: avoid; }

  /* The mail links already read as the address itself, so no href footnote. */
  .legal-section a { text-decoration: none; }
}
