/* NICU Nutrition Plus branding for the research summaries.
   Loaded after research-summary.css: swaps in the homepage palette, fonts and
   logo bar, and keeps the same layout. Light and dark, like the homepage. */

:root {
  --bg: #FAF7FD;
  --ink: #241633;
  --muted: #5B4E70;
  --line: #E3D6F2;
  --panel: #F1E9FA;
  --card: #FFFFFF;
  --accent: #5B2E8C;        /* plum */
  --accent-ink: #3D1D63;    /* plum-deep */
  --accent-tint: #EFE4FA;   /* plum-tint */
  --sun: #E8965A;
  --sun-soft: #FBEADB;
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #170D26; --ink: #F3ECFA; --muted: #C1AFDA; --line: #3B2856; --panel: #1E1233; --card: #241536;
    --accent: #B48CE0; --accent-ink: #D8C2F5; --accent-tint: #2A1B42; --sun: #F0A868; --sun-soft: #3A2A22;
  }
}
:root[data-theme="dark"] {
  --bg: #170D26; --ink: #F3ECFA; --muted: #C1AFDA; --line: #3B2856; --panel: #1E1233; --card: #241536;
  --accent: #B48CE0; --accent-ink: #D8C2F5; --accent-tint: #2A1B42; --sun: #F0A868; --sun-soft: #3A2A22;
}

body { background: var(--bg); font-size: 1.04rem; line-height: 1.7; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
::selection { background: var(--accent-tint); }
:focus-visible { outline-color: var(--accent); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.005em; }
h2 { border-bottom: 2px solid var(--sun-soft); }
h3 { color: var(--accent); }
h4 { font-family: var(--font-ui); color: var(--accent-ink); }

/* Brand bar, as on the homepage */
.brandbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brandbar .wrap {
  width: auto; max-width: var(--page); padding: 0.7rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brandbar .brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brandbar .brand img { height: 32px; width: auto; }
.brandbar .brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink); white-space: nowrap; }
.brandbar .back {
  font-family: var(--font-ui); font-weight: 700; font-size: 0.86rem; text-decoration: none;
  color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; white-space: nowrap;
}
.brandbar .back:hover { background: var(--accent-tint); }

/* Masthead: the homepage's plum band with the plum-to-orange strip */
.masthead {
  position: relative;
  background:
    radial-gradient(55% 80% at 90% 0%, color-mix(in srgb, var(--sun) 40%, transparent) 0%, transparent 70%),
    linear-gradient(135deg, #5B2E8C, #3D1D63);
  padding: 3.2rem 0 2.8rem;
}
.masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, #5B2E8C, #E8965A);
}
.masthead .kicker { color: #F6C9A5; }
.masthead h1 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; }
.masthead .dek, .masthead .meta { color: #E7DAF5; }

/* Sidebar */
.toc { border-right-color: var(--line); }
.toc h2 { font-family: var(--font-ui); color: var(--accent); border-bottom-color: var(--line); }
.toc > ul > li > a, .toc > ol > li > a { color: var(--ink); }
.toc a { border-left: 2px solid transparent; padding-left: 0.5rem; margin-left: -0.5rem; }
.toc a:hover { color: var(--accent); border-left-color: var(--sun); text-decoration: none; }
.toc li ul, .toc li ol { border-left-color: var(--accent-tint); }

/* Tables, figures, callouts */
.table-scroll, .tw { border-color: var(--line); border-radius: 12px; background: var(--card); }
thead th, caption { background: var(--accent-tint); color: var(--accent-ink); border-bottom-color: var(--line); }
th, td { border-bottom-color: var(--line); }
tbody tr:hover { background: color-mix(in srgb, var(--accent-tint) 45%, transparent); }
figure.doc-figure img, .doc figure img { border-color: var(--line); border-radius: 12px; }
.callout, .doc blockquote { background: var(--sun-soft); border-left-color: var(--sun); }
code { background: var(--accent-tint); border-color: var(--line); }

.back-to-top a { border-color: var(--line); color: var(--accent); background: var(--card); }
.back-to-top a:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }

.site-footer { background: var(--panel); border-top-color: var(--line); }
.site-footer p { color: var(--muted); }

@media (max-width: 560px) {
  .brandbar .brand span { display: none; }
}
@media print {
  .brandbar { display: none; }
  .masthead::after { display: none; }
}
