:root {
  --bg: #f7f8fa; --card: #fff; --ink: #1c2430; --muted: #5a6675; --line: #dde2e9;
  --brand: #17405f; --brand-2: #0f7b8a; --accent: #c0392b; --link: #0b5f8f;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161d; --card: #1a222c; --ink: #e6ebf1; --muted: #9aa7b6; --line: #2b3542; --brand: #0d2438; --brand-2: #4fc3d1; --link: #6cb8e8; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px; }

.site-header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.bar { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a, .topics summary { color: #fff; text-decoration: none; cursor: pointer; list-style: none; }
.topics summary::-webkit-details-marker { display: none; }
.topics summary::after { content: " \25BE"; }
.topnav a:hover, .topics summary:hover { text-decoration: underline; }
.topics { position: static; }
.mega { position: absolute; left: 0; right: 0; top: 56px; background: var(--card); color: var(--ink); border-bottom: 3px solid var(--brand-2);
  box-shadow: 0 8px 20px rgba(0,0,0,.18); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 24px; padding: 20px max(16px, calc((100% - 1048px) / 2)); max-height: 80vh; overflow: auto; }
.mega h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a { color: var(--link); display: block; padding: 3px 0; font-size: .97rem; }

.hero { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.intro h1 { font-size: 2rem; margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.audiences { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.audiences > div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 20px 12px; }
.audiences h2 { font-size: 1.15rem; color: var(--brand-2); }
.section-title { font-size: 1.3rem; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-top: 32px; }
.topic-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; }
.topic-group h3 { margin: 12px 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.topic-group ul { list-style: none; margin: 0; padding: 0; }
.topic-group li { padding: 2px 0; }
.more-links { color: var(--muted); }
.donate { text-align: center; }


.article { max-width: 860px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 28px 24px; }
.article h1 { font-size: 2rem; line-height: 1.2; }
.article h2 { margin-top: 1.8em; }
.article .updated { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 10px; }

/* Accordions used in articles for "extra depth" sections */
.article details { border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; background: var(--bg); }
.article summary { cursor: pointer; padding: 10px 14px 10px 38px; font-weight: 600; list-style: none; position: relative; }
.article summary::-webkit-details-marker { display: none; }
.article summary::before { content: "\25B6"; color: var(--accent); position: absolute; left: 14px; font-size: .8em; top: 14px; transition: transform .15s; }
.article details[open] > summary::before { transform: rotate(90deg); }
.article details > *:not(summary) { margin-left: 16px; margin-right: 16px; }
.article details[open] { padding-bottom: 10px; }

.reslist { list-style: none; padding: 0; }
.reslist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reslist p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.tag { font-size: .72rem; background: var(--line); padding: 1px 8px; border-radius: 10px; margin-left: 6px; color: var(--muted); }
.searchform { display: flex; gap: 8px; margin: 12px 0 20px; }
.searchform input { flex: 1; }
input[type=text], input[type=url], input[type=password], input[type=search], textarea, select {
  padding: 9px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); width: 100%; }
button, .btn { padding: 9px 18px; font: inherit; background: var(--brand-2); color: #fff; border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
button.danger { background: var(--accent); }
.results { list-style: none; padding: 0; } .results li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.results p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 16px; text-align: center; color: var(--muted); font-size: .88rem; }

/* Admin */
.admin table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin th, .admin td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin form.inline { display: inline; }
.admin .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin label { display: block; font-weight: 600; font-size: .9rem; margin-top: 8px; }
.flash { background: #e6f4ea; border: 1px solid #b7dfc2; padding: 10px 14px; border-radius: 6px; color: #1e4620; }
.flash.err { background: #fdeaea; border-color: #f0b5b5; color: #7a1f1f; }

@media (max-width: 800px) {
  .audiences, .admin .grid { grid-template-columns: 1fr; }
  .article { padding: 4px 16px 20px; }
}

/* Mobile hamburger */
.burger { display: none; background: transparent; border: 0; padding: 10px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 3px; background: #fff; margin: 4px 0; border-radius: 2px; }
@media (max-width: 800px) {
  .burger { display: block; }
  .bar { flex-wrap: wrap; }
  .topnav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 8px; }
  .topnav.open { display: flex; }
  .topnav > a, .topics summary { padding: 12px 4px; border-top: 1px solid rgba(255,255,255,.2); display: block; }
  .mega { position: static; box-shadow: none; border: 0; background: rgba(255,255,255,.08); color: #fff; max-height: 60vh; padding: 8px 12px; grid-template-columns: 1fr; }
  .mega h3 { color: #cfe3f2; }
  .mega a { color: #fff; padding: 8px 0; }
}

/* Resources table */
.legend { color: var(--muted); font-size: .92rem; }
.restable { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.restable th, .restable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.restable th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); }
.restable .restitle { width: 24%; font-weight: 600; }
.restable .resdesc { color: var(--muted); font-size: .95rem; }
.restable .freecol { width: 64px; text-align: center; }
.free-yes { color: #1e8e3e; font-weight: 700; font-size: 1.15rem; }
.free-no { color: #d93025; font-weight: 700; font-size: 1.3rem; }
.sr { position: absolute; left: -999px; }
@media (max-width: 800px) {
  .restable .restitle { width: 34%; }
  .restable th, .restable td { padding: 8px 6px; font-size: .9rem; }
}
