:root {
  --civic-blue: #0a4f8f;
  --sky-blue: #2ba7d8;
  --community-green: #78a642;
  --warm-gold: #f2b84b;
  --ink: #172033;
  --muted: #617083;
  --line: #e6eef5;
  --surface: #f7fafc;
  --card: #ffffff;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

a { color: var(--civic-blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #083d70; }

.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 2000; }

.masthead {
  background: linear-gradient(135deg, #0a4f8f 0%, #176cab 62%, #2ba7d8 100%);
  border-bottom: 4px solid var(--warm-gold);
  color: #fff;
  padding: 16px 0;
}

.brand-lockup {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 14px;
  text-decoration: none;
}

.brand-lockup:hover { color: #fff; }
.brand-crest {
  background: #fff;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 50%;
  height: 56px;
  object-fit: cover;
  padding: 3px;
  width: 56px;
}

.brand-title {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-subtitle {
  display: block;
  font-size: .88rem;
  opacity: .88;
}

.masthead-tools { gap: 8px; }
.tool-chip {
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  color: #fff;
  font-size: .88rem;
  padding: 6px 12px;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}
.tool-chip:hover { background: rgba(255,255,255,.14); color: #fff; transform: translateY(-1px); }

.portal-nav {
  background: #17324f !important;
  box-shadow: 0 6px 18px rgba(15, 43, 68, .16);
  position: sticky;
  top: 0;
  z-index: 1020;
}
.portal-nav .nav-link { color: rgba(255,255,255,.88); font-weight: 700; }
.portal-nav .nav-link:hover, .portal-nav .nav-link:focus { color: #fff; }

.content-panel, .portal-sidebar, .community-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 67, 101, .06);
}

.content-panel { padding: clamp(18px, 3vw, 30px); }
.article-panel { border-top: 4px solid var(--civic-blue); }
.feed-panel { border-top: 4px solid var(--sky-blue); }
.taxonomy-panel { border-top: 4px solid var(--community-green); }

.section-header, .article-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6, .content-heading {
  color: var(--civic-blue);
  font-family: "Merriweather", Georgia, serif;
  font-weight: 900;
  letter-spacing: 0;
}

h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.18; }
h2 { font-size: 1.55rem; line-height: 1.25; margin-top: 1.7rem; }
h3 { font-size: 1.18rem; }

.eyebrow {
  color: var(--community-green);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: .35rem;
  text-transform: uppercase;
}

.lead { color: #39485d; }
.content-figure { margin: 1.4rem 0; }
.content-figure img {
  border-radius: 8px;
  max-height: 680px;
  object-fit: contain;
}
figcaption {
  color: var(--muted);
  font-size: .9rem;
  margin-top: .5rem;
}

.content-list {
  background: #f9fcff;
  border-left: 3px solid var(--sky-blue);
  border-radius: 0 8px 8px 0;
  padding: .75rem 1rem .75rem 1.35rem;
}

.content-card, .category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.content-card { margin: 1rem 0; padding: 1rem; }
.content-card:hover, .category-card:hover {
  border-color: rgba(43,167,216,.55);
  box-shadow: 0 12px 28px rgba(30,67,101,.1);
  transform: translateY(-1px);
}

.portal-sidebar, .community-panel {
  padding: 16px;
  position: sticky;
  top: 86px;
}
.sidebar-title, .community-panel h2 {
  border-bottom: 2px solid var(--line);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: .75rem;
  padding-bottom: .55rem;
}
.portal-sidebar .nav-link, .community-panel a, .footer-links a {
  border-radius: 6px;
  display: block;
  font-size: .92rem;
  padding: .3rem .35rem;
  text-decoration: none;
}
.portal-sidebar .nav-link:hover, .community-panel a:hover {
  background: #eef7fc;
}

.right-rail .portal-sidebar { position: static; }
.site-footer { background: #112c45 !important; margin-top: 2rem; }
.footer-title { color: #fff; font-size: 1.3rem; }
.footer-heading {
  color: #fff;
  font-family: "Inter", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 800;
}
.footer-copy, .site-footer a { color: rgba(255,255,255,.78); }
.site-footer a:hover { color: #fff; }

.toc-box {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .75rem;
}
.toc-box a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .65rem;
  text-decoration: none;
}

.main-image { border-radius: 8px; max-width: 33%; }
.table { font-size: .95rem; }
pre {
  background: #102235;
  border-radius: 8px;
  color: #e6eef5;
  padding: 1rem;
}

@media (max-width: 991.98px) {
  .portal-sidebar, .community-panel { position: static; }
  .main-image { float: none !important; max-width: 100%; width: 100%; }
}

@media print {
  .site-header, .site-footer, .portal-sidebar, .community-panel { display: none !important; }
  body { background: #fff; }
  .content-panel { border: 0; box-shadow: none; padding: 0; }
}
