/* The Integrative Psychiatry Evidence Project
 *
 * Typography and structure modelled on NIH/NCCIH health-information pages,
 * measured from nccih.nih.gov: Helvetica stack, 40px/300 display heading,
 * 17.6px body on 30px leading, #4F4B4B headings, #2E2E2E body, #336699 links,
 * ~840px content column.
 *
 * Deliberately NOT borrowed: the flag banner, the HHS/NIH agency bar, agency
 * logos, and any "official website" language. This project has no government
 * affiliation, and the masthead says so.
 */

:root {
  --paper:      #ffffff;
  --band:       #f0f0f0;
  --ink:        #2e2e2e;
  --ink-head:   #4f4b4b;
  --ink-soft:   #5c5c5c;
  --ink-faint:  #6e6e6e;
  --rule:       #d6d6d6;
  --rule-soft:  #e8e8e8;
  --blue:       #336699;
  --blue-dark:  #24486b;
  --blue-vis:   #6b4c8a;
  --notice-bg:  #fef0c8;
  --notice-br:  #936f38;

  /* evidence tiers -- hue supports the letter, never replaces it */
  --tier-a-bg:#e4efe4; --tier-a-fg:#1f4d2a; --tier-a-br:#9dc4a4;
  --tier-b-bg:#e3edf5; --tier-b-fg:#24486b; --tier-b-br:#9dbcd6;
  --tier-c-bg:#f6eeda; --tier-c-fg:#6b4d10; --tier-c-br:#d7c08a;
  --tier-d-bg:#f7e5e4; --tier-d-fg:#7a2620; --tier-d-br:#daa6a1;

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 1160px;
  --article: 700px;
  --rail: 300px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:#15181b; --band:#1d2126; --ink:#e3e6e9; --ink-head:#eceff2;
    --ink-soft:#aab2ba; --ink-faint:#8b939b; --rule:#333a41; --rule-soft:#262c32;
    --blue:#8ab4dd; --blue-dark:#a9c9e8; --blue-vis:#bda3d8;
    --notice-bg:#2e2716; --notice-br:#8a6c37;
    --tier-a-bg:#16281a; --tier-a-fg:#9fd3aa; --tier-a-br:#2f5137;
    --tier-b-bg:#152531; --tier-b-fg:#9cc4e4; --tier-b-br:#2c4a63;
    --tier-c-bg:#2b2416; --tier-c-fg:#e0c489; --tier-c-br:#574823;
    --tier-d-bg:#2e1a18; --tier-d-fg:#e8a9a2; --tier-d-br:#5c302b;
  }
}
:root[data-theme="dark"] {
  --paper:#15181b; --band:#1d2126; --ink:#e3e6e9; --ink-head:#eceff2;
  --ink-soft:#aab2ba; --ink-faint:#8b939b; --rule:#333a41; --rule-soft:#262c32;
  --blue:#8ab4dd; --blue-dark:#a9c9e8; --blue-vis:#bda3d8;
  --notice-bg:#2e2716; --notice-br:#8a6c37;
  --tier-a-bg:#16281a; --tier-a-fg:#9fd3aa; --tier-a-br:#2f5137;
  --tier-b-bg:#152531; --tier-b-fg:#9cc4e4; --tier-b-br:#2c4a63;
  --tier-c-bg:#2b2416; --tier-c-fg:#e0c489; --tier-c-br:#574823;
  --tier-d-bg:#2e1a18; --tier-d-fg:#e8a9a2; --tier-d-br:#5c302b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
}

.skip { position: absolute; left: -9999px; background: var(--paper);
  padding: .6rem 1rem; border: 2px solid var(--blue); z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- masthead ---------- */

.identity-bar {
  background: var(--blue); color: #fff;
  font-size: 13px; line-height: 1.5;
}
.identity-bar .inner { max-width: var(--measure); margin: 0 auto; padding: .5rem 1.5rem; }
.identity-bar strong { font-weight: 700; }

.masthead { border-bottom: 3px solid var(--blue); background: var(--paper); }
.masthead-inner { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.5rem 0; }
.wordmark {
  margin: 0 0 .2rem; font-size: 22px; font-weight: 700;
  line-height: 1.25; color: var(--ink-head); letter-spacing: -.005em;
}
.wordmark a { color: inherit; text-decoration: none; }
.wordmark a:hover { color: var(--blue); }
.tagline { margin: 0 0 1.1rem; font-size: 14px; color: var(--ink-faint); line-height: 1.45; }

.masthead nav { font-size: 16px; line-height: 1; padding-bottom: 0; }
.masthead nav a {
  display: inline-block; color: var(--blue); text-decoration: none;
  padding: .55rem 0 .75rem; margin-right: 1.4rem;
  border-bottom: 4px solid transparent;
}
.masthead nav a:hover { text-decoration: underline; }
.masthead nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--blue); }

/* ---------- layout ---------- */

main { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }

/* two-column article + right rail, the NCCIH health-info pattern */
.layout {
  display: grid;
  grid-template-columns: minmax(0, var(--article)) var(--rail);
  gap: 3.5rem;
  align-items: start;
}
.article { min-width: 0; }

.rail { position: sticky; top: 1.5rem; }
.rail-box {
  border-top: 3px solid var(--blue);
  padding: .9rem 0 1.1rem;
  margin-bottom: 1.5rem;
}
.rail-box h4 {
  font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-head); margin: 0 0 .6rem;
}
.rail-box ul { list-style: none; padding: 0; margin: 0; }
.rail-box li { font-size: 14.5px; line-height: 1.45; margin-bottom: .5rem; }
.rail-box p { font-size: 14px; line-height: 1.55; margin: 0; color: var(--ink-soft); }
.rail-box .cite { font-size: 13px; line-height: 1.5; }
.rail-box a { color: var(--blue); text-decoration: none; }
.rail-box a:hover { text-decoration: underline; }

h2[id] { scroll-margin-top: 1.5rem; }

.crumb { font-size: 14px; color: var(--ink); margin: 0 0 1.5rem; }
.crumb a { color: var(--blue); }

h1 {
  font-size: 40px; font-weight: 300; line-height: 1.2;
  color: var(--ink-head); margin: 0 0 .75rem;
}
.dek { font-size: 19px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 1.75rem; }

h2 {
  font-size: 27px; font-weight: 600; line-height: 1.25;
  color: var(--ink-head); margin: 2.5rem 0 .85rem;
}
h3 { font-size: 20px; font-weight: 700; color: var(--ink-head); margin: 1.9rem 0 .55rem; }

p, li { font-size: 17.6px; line-height: 30px; }
p { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1.15rem; }
li { margin-bottom: .45rem; }

a { color: var(--blue); text-decoration: underline; text-underline-offset: .13em; }
a:visited { color: var(--blue-vis); }
a:hover { color: var(--blue-dark); }

/* ---------- article metadata ---------- */

.artmeta {
  font-size: 14px; line-height: 1.65; color: var(--ink-faint);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .8rem 0; margin: 0 0 1.75rem;
}
.artmeta strong { color: var(--ink-soft); font-weight: 700; }

/* ---------- answer capsule ---------- */

.capsule { background: var(--band); border-left: 5px solid var(--blue);
  padding: 1.25rem 1.4rem; margin: 0 0 2rem; }
.capsule h2 {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 .6rem;
}
.capsule p:last-child { margin-bottom: 0; }
.capsule .lede { font-size: 18.5px; line-height: 31px; }

/* ---------- evidence tiers ---------- */

.tier {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: .16rem .45rem; border: 1px solid; border-radius: 2px; white-space: nowrap;
}
.tier-a { background:var(--tier-a-bg); color:var(--tier-a-fg); border-color:var(--tier-a-br); }
.tier-b { background:var(--tier-b-bg); color:var(--tier-b-fg); border-color:var(--tier-b-br); }
.tier-c { background:var(--tier-c-bg); color:var(--tier-c-fg); border-color:var(--tier-c-br); }
.tier-d { background:var(--tier-d-bg); color:var(--tier-d-fg); border-color:var(--tier-d-br); }

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; margin: 1.5rem 0 1.75rem; }
table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--rule-soft); }
thead th {
  background: var(--band); color: var(--ink-head);
  font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 700; border-bottom: 2px solid var(--blue);
}
tbody tr:last-child td { border-bottom: 1px solid var(--rule); }

/* ---------- definition block ---------- */

.defblock { border: 1px solid var(--rule); border-top: 4px solid var(--blue);
  padding: 1.35rem 1.4rem; margin: 1.75rem 0 1.5rem; background: var(--paper); }
.defblock .deflabel {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 .65rem;
}
.defblock .deftext { font-size: 19px; line-height: 32px; margin: 0; color: var(--ink); }
.defblock .defver {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint);
  margin: .9rem 0 0; padding-top: .7rem; border-top: 1px solid var(--rule-soft);
}

.verified {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-faint); background: var(--band);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: .05rem .35rem; white-space: nowrap;
}

/* ---------- citations ---------- */

sup.ref { font-size: .68em; line-height: 0; }
sup.ref a { text-decoration: none; padding: 0 .06em; }
sup.ref a:hover { text-decoration: underline; }

ol.refs { font-size: 15px; line-height: 1.6; color: var(--ink-soft); padding-left: 1.6rem; margin: 1rem 0 0; }
ol.refs li { font-size: 15px; line-height: 1.6; margin-bottom: .8rem; }
ol.refs li:target { background: var(--notice-bg); outline: 2px solid var(--notice-br); }

.pull { background: var(--band); border-left: 5px solid var(--ink-faint);
  padding: 1rem 1.2rem; margin: 1.6rem 0; }
.pull p { font-size: 17px; margin-bottom: 0; }

/* ---------- disclosure + footer ---------- */

.disclosure {
  background: var(--notice-bg); border-left: 5px solid var(--notice-br);
  padding: 1.1rem 1.25rem; margin: 3rem 0 0;
}
.disclosure p, .disclosure { font-size: 15px; line-height: 1.6; color: var(--ink); }
.disclosure strong { font-weight: 700; }

.site-footer { border-top: 4px solid var(--blue); background: var(--band); margin-top: 3rem; }
.site-footer-inner { max-width: var(--measure); margin: 0 auto; padding: 2rem 1.5rem 2.75rem; }
.site-footer, .site-footer p, .site-footer li { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.site-footer a { color: var(--blue); }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1.5rem; margin-bottom: 1.75rem; }
.site-footer h4 {
  font-size: 13px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-head); margin: 0 0 .5rem; font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .25rem; }
.footer-legal { border-top: 1px solid var(--rule); padding-top: 1.15rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .rail { position: static; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
}

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 23px; }
  .dek { font-size: 17px; }
  p, li { font-size: 17px; line-height: 28px; }
  main, .masthead-inner, .site-footer-inner, .identity-bar .inner { padding-left: 1.15rem; padding-right: 1.15rem; }
  .masthead nav a { margin-right: 1rem; font-size: 15px; }
}

@media print {
  .masthead nav, .site-footer .cols, .identity-bar { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
}
