/* Shared styles for the Soulfia legal pages. No external fonts or assets. */

:root {
  color-scheme: light;
  --text: #1c1c1e;
  --muted: #55555c;
  --bg: #ffffff;
  --surface: #f5f5f7;
  --border: #dcdce0;
  --link: #1d4ed8;
  --link-visited: #5b3cc4;
  --note-bg: #fff8e6;
  --note-border: #e8c76a;
  --alert-bg: #fdecec;
  --alert-border: #d98c8c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--text);
}

.brand:visited {
  color: var(--text);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

/* Main content */

main {
  padding-top: 28px;
  padding-bottom: 48px;
}

/* Long words, such as an email address, wrap instead of widening the page on narrow screens.
   break-word (not anywhere) leaves table column sizing alone. */
main,
.site-footer {
  overflow-wrap: break-word;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 6px;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.2em 0 0.5em;
  padding-top: 0.4em;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 1.6em 0 0.4em;
}

p,
ul,
ol,
table {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.35em;
}

li > ul,
li > ol {
  margin-top: 0.35em;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:visited {
  color: var(--link-visited);
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 650;
}

.meta {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 1.6em;
}

.lead {
  font-size: 1.08rem;
}

/* Callouts */

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 1.4em;
}

.box > :last-child {
  margin-bottom: 0;
}

.box h2,
.box h3 {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.note {
  background: var(--note-bg);
  border-color: var(--note-border);
}

.alert {
  background: var(--alert-bg);
  border-color: var(--alert-border);
}

/* Table of contents */

.toc ol {
  margin-bottom: 0;
}

.toc li {
  margin-bottom: 0.15em;
}

/* Tables: scroll inside their own box on narrow screens instead of widening the page */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.2em;
  -webkit-overflow-scrolling: touch;
}

/* Focusable so keyboard users can scroll it with the arrow keys. */
.table-scroll:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.table-scroll table {
  margin: 0;
  min-width: 560px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 650;
}

/* Landing page links */

.link-list {
  list-style: none;
  padding: 0;
}

.link-list li {
  margin-bottom: 12px;
}

.link-list a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

.link-list a:hover {
  border-color: var(--link);
}

.link-list a strong {
  display: block;
  color: var(--link);
}

.link-list a span {
  color: var(--muted);
  font-size: 15px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  padding-top: 18px;
  padding-bottom: 28px;
}

.site-footer p {
  margin: 0 0 0.4em;
}

/* Taller tap targets for the small footer links. */
.site-footer a {
  display: inline-block;
  padding: 6px 0;
}

/* Small screens */

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.22rem;
  }
}

@media print {
  .site-header,
  .site-footer {
    display: none;
  }

  a {
    color: inherit;
  }
}
