/* ==========================================================================
   Hopkins Technology — Restored Health Information Library
   Editorial / medical-library aesthetic. Brand accent: deep clinical crimson.
   Heading: Source Serif 4 (editorial serif). Body/UI: Inter (clean sans).
   Custom layer only — Bulma (CDN) handles grid/components.
   ========================================================================== */

:root {
  /* Brand — evolved from the original #ff0000 company-name red */
  --ht-crimson: #9b1c2e;
  --ht-crimson-dark: #741320;
  --ht-crimson-light: #c0392b;
  --ht-crimson-tint: #faf2f3;

  /* Ink + neutrals */
  --ht-ink: #1f2126;
  --ht-ink-soft: #4a4f57;
  --ht-muted: #6b7280;
  --ht-line: #e7e3df;
  --ht-paper: #ffffff;
  --ht-paper-warm: #faf8f5;   /* sandstone descendant — warm off-white */
  --ht-paper-warm2: #f3efe8;

  /* Link blue (descendant of the original #0000ff links) */
  --ht-link: #1d4e89;
  --ht-link-hover: #9b1c2e;

  /* The signature multi-color "colorbar.gif" reborn as a slim gradient */
  --ht-rule: linear-gradient(90deg,
      #9b1c2e 0%, #c0392b 18%, #d98324 36%,
      #3a7d44 56%, #1d4e89 76%, #5b3a86 100%);

  --ht-radius: 10px;
  --ht-radius-sm: 6px;
  --ht-shadow: 0 1px 2px rgba(31,33,38,.05), 0 8px 24px rgba(31,33,38,.06);
  --ht-shadow-sm: 0 1px 3px rgba(31,33,38,.08);
  --ht-maxw: 1180px;
  --ht-readw: 760px;

  --ht-font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ht-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ----- Base ------------------------------------------------------------ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--ht-font-sans);
  color: var(--ht-ink);
  background: var(--ht-paper-warm);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ht-link); transition: color .15s ease; }
a:hover { color: var(--ht-link-hover); }

h1, h2, h3, h4, .ht-serif {
  font-family: var(--ht-font-serif);
  color: var(--ht-ink);
  line-height: 1.2;
  font-weight: 600;
}

strong { font-weight: 600; color: var(--ht-ink); }

/* ----- The colorbar rule (signature divider) -------------------------- */
.ht-rule {
  height: 4px;
  width: 100%;
  background: var(--ht-rule);
  border: 0;
  border-radius: 4px;
  margin: 0;
}
.ht-rule--thin { height: 3px; }

/* ----- Top bar / nav --------------------------------------------------- */
.ht-topstrip { height: 4px; background: var(--ht-rule); }

.ht-nav {
  background: var(--ht-paper);
  border-bottom: 1px solid var(--ht-line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.ht-nav .navbar-brand { align-items: center; }

.ht-brand {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding: .55rem .25rem;
  text-decoration: none;
}
.ht-brand .ht-brand-mark {
  font-family: var(--ht-font-serif);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--ht-crimson);
  letter-spacing: -.01em;
  line-height: 1;
}
.ht-brand .ht-brand-sub {
  font-family: var(--ht-font-sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ht-muted);
  font-weight: 600;
}
.ht-brand:hover .ht-brand-mark { color: var(--ht-crimson-dark); }

.ht-nav .navbar-item,
.ht-nav .navbar-link {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ht-ink-soft);
}
.ht-nav a.navbar-item:hover,
.ht-nav a.navbar-item.is-active {
  background: transparent;
  color: var(--ht-crimson);
}
.ht-nav .navbar-item.is-cta {
  font-weight: 600;
  color: var(--ht-crimson);
}
.ht-nav .navbar-dropdown { border-top: 2px solid var(--ht-crimson); box-shadow: var(--ht-shadow); }
.ht-nav .navbar-burger { color: var(--ht-ink); }

/* Bulma navbar default link bg fix on hover for dropdown */
.ht-nav .navbar-dropdown a.navbar-item:hover { background: var(--ht-crimson-tint); color: var(--ht-crimson); }

/* ----- Layout container ------------------------------------------------ */
.ht-container { max-width: var(--ht-maxw); margin: 0 auto; padding: 0 1.25rem; }
.ht-section { padding: 3.25rem 0; }
.ht-section--tight { padding: 2.25rem 0; }

/* ----- Hero ------------------------------------------------------------ */
.ht-hero {
  background: linear-gradient(180deg, var(--ht-paper) 0%, var(--ht-paper-warm) 100%);
  border-bottom: 1px solid var(--ht-line);
}
.ht-hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 2.75rem;
  align-items: center;
  padding: 3rem 0 3.25rem;
}
.ht-hero--solo .ht-hero-inner { grid-template-columns: 1fr; max-width: var(--ht-readw); }

.ht-eyebrow {
  display: inline-block;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ht-crimson);
  margin-bottom: .85rem;
}
.ht-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin: 0 0 1rem;
  letter-spacing: -.015em;
}
.ht-hero .ht-lead {
  font-size: 1.15rem;
  color: var(--ht-ink-soft);
  margin-bottom: 1.5rem;
  max-width: 38ch;
}
.ht-hero--solo .ht-lead { max-width: 60ch; }

.ht-hero-figure {
  border-radius: var(--ht-radius);
  overflow: hidden;
  box-shadow: var(--ht-shadow);
  background: var(--ht-paper-warm2);
}
.ht-hero-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ----- Buttons --------------------------------------------------------- */
.ht-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--ht-font-sans);
  font-weight: 600;
  font-size: .98rem;
  padding: .72rem 1.4rem;
  border-radius: var(--ht-radius-sm);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.ht-btn--primary { background: var(--ht-crimson); color: #fff; box-shadow: var(--ht-shadow-sm); }
.ht-btn--primary:hover { background: var(--ht-crimson-dark); color: #fff; transform: translateY(-1px); }
.ht-btn--ghost { background: transparent; color: var(--ht-crimson); border-color: var(--ht-crimson); }
.ht-btn--ghost:hover { background: var(--ht-crimson-tint); color: var(--ht-crimson-dark); }
.ht-btn-row { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ----- Article / prose ------------------------------------------------- */
.ht-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3rem;
  align-items: start;
}
.ht-layout--solo { grid-template-columns: minmax(0, var(--ht-readw)); justify-content: center; }

.ht-prose { max-width: 100%; }
.ht-prose .ht-figure { margin: 1.75rem 0 2rem; }
.ht-prose .ht-figure img {
  width: 100%;
  border-radius: var(--ht-radius);
  box-shadow: var(--ht-shadow);
}
.ht-prose .ht-figcaption {
  font-size: .82rem;
  color: var(--ht-muted);
  margin-top: .55rem;
  font-style: italic;
}

.ht-prose h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  margin: 0 0 1rem;
  letter-spacing: -.015em;
}
.ht-prose h2 {
  font-size: 1.55rem;
  margin: 2.2rem 0 .85rem;
  padding-top: .35rem;
}
.ht-prose h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--ht-rule);
  border-radius: 3px;
  margin-bottom: .8rem;
}
.ht-prose h3 { font-size: 1.22rem; margin: 1.6rem 0 .6rem; color: var(--ht-crimson-dark); }
.ht-prose p { margin: 0 0 1.15rem; }
.ht-prose ul, .ht-prose ol { margin: 0 0 1.3rem 1.3rem; }
.ht-prose li { margin-bottom: .5rem; }
.ht-prose li::marker { color: var(--ht-crimson); }
.ht-prose a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: rgba(29,78,137,.35); }
.ht-prose a:hover { text-decoration-color: var(--ht-crimson); }

.ht-prose .tagline { font-size: 1.18rem; color: var(--ht-ink-soft); font-style: italic; margin-bottom: 1.4rem; }

/* a disclaimer/emphasis paragraph that is purely <em> gets a callout look */
.ht-prose p > em:only-child {
  display: block;
}
.ht-disclaimer {
  background: var(--ht-crimson-tint);
  border-left: 3px solid var(--ht-crimson);
  padding: .9rem 1.1rem;
  border-radius: 0 var(--ht-radius-sm) var(--ht-radius-sm) 0;
  font-size: .92rem;
  color: var(--ht-ink-soft);
  margin: 0 0 1.5rem;
}
.ht-disclaimer em { font-style: italic; }

/* ----- Sidebar (article rail) ----------------------------------------- */
.ht-rail { position: sticky; top: 84px; }
.ht-rail-card {
  background: var(--ht-paper);
  border: 1px solid var(--ht-line);
  border-radius: var(--ht-radius);
  padding: 1.25rem 1.3rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--ht-shadow-sm);
}
.ht-rail-card h3 {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ht-muted);
  margin: 0 0 .85rem;
  font-family: var(--ht-font-sans);
  font-weight: 700;
}
.ht-rail-card ul { list-style: none; margin: 0; }
.ht-rail-card li { margin-bottom: .55rem; line-height: 1.4; }
.ht-rail-card li a { font-size: .94rem; text-decoration: none; }
.ht-rail-card li a:hover { text-decoration: underline; }
.ht-rail-note { font-size: .86rem; color: var(--ht-muted); }

/* ----- Cards (home / index sections) ----------------------------------- */
.ht-cardgrid { display: grid; gap: 1.4rem; }
.ht-cardgrid--3 { grid-template-columns: repeat(3, 1fr); }
.ht-cardgrid--2 { grid-template-columns: repeat(2, 1fr); }

.ht-card {
  background: var(--ht-paper);
  border: 1px solid var(--ht-line);
  border-radius: var(--ht-radius);
  padding: 1.5rem 1.5rem 1.6rem;
  box-shadow: var(--ht-shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.ht-card:hover { transform: translateY(-3px); box-shadow: var(--ht-shadow); border-color: #d9d3cb; }
.ht-card h3 { font-size: 1.18rem; margin: 0 0 .5rem; }
.ht-card h3 a { color: var(--ht-ink); text-decoration: none; }
.ht-card:hover h3 a { color: var(--ht-crimson); }
.ht-card p { font-size: .96rem; color: var(--ht-ink-soft); margin: 0; }
.ht-card .ht-card-tag {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--ht-crimson); margin-bottom: .5rem; display: block;
}

/* Section heading block */
.ht-secthead { margin-bottom: 1.75rem; max-width: 60ch; }
.ht-secthead h2 { font-size: 1.85rem; margin: 0 0 .6rem; }
.ht-secthead p { color: var(--ht-ink-soft); margin: 0; }
.ht-secthead .ht-eyebrow { margin-bottom: .55rem; }

/* Alt-background band */
.ht-band { background: var(--ht-paper); border-top: 1px solid var(--ht-line); border-bottom: 1px solid var(--ht-line); }
.ht-band--tint { background: var(--ht-crimson-tint); border-color: #f0dcdf; }

/* Inline feature image on home */
.ht-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.ht-feature img { border-radius: var(--ht-radius); box-shadow: var(--ht-shadow); width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.ht-feature.is-reverse .ht-feature-media { order: 2; }

/* ----- Breadcrumb ------------------------------------------------------ */
.ht-crumbs { font-size: .85rem; color: var(--ht-muted); padding: 1.1rem 0 0; }
.ht-crumbs a { color: var(--ht-muted); text-decoration: none; }
.ht-crumbs a:hover { color: var(--ht-crimson); text-decoration: underline; }
.ht-crumbs span { margin: 0 .4rem; opacity: .6; }

/* ----- Footer ---------------------------------------------------------- */
.ht-footer { background: #20232a; color: #c7ccd6; margin-top: 3.5rem; }
.ht-footer .ht-rule { border-radius: 0; }
.ht-footer-inner { padding: 3rem 0 1.25rem; }
.ht-footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
}
.ht-footer h4 {
  color: #fff;
  font-family: var(--ht-font-sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  font-weight: 700;
}
.ht-footer ul { list-style: none; margin: 0; }
.ht-footer li { margin-bottom: .55rem; }
.ht-footer a { color: #c7ccd6; text-decoration: none; font-size: .94rem; }
.ht-footer a:hover { color: #fff; text-decoration: underline; }
.ht-footer .ht-foot-brand .ht-brand-mark { color: #fff; font-family: var(--ht-font-serif); font-weight: 700; font-size: 1.35rem; }
.ht-footer .ht-foot-blurb { font-size: .92rem; color: #9aa1ad; margin-top: .8rem; max-width: 34ch; }
.ht-foot-bottom {
  border-top: 1px solid #333842;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  font-size: .85rem;
  color: #8e95a1;
}
.ht-foot-bottom a { color: #8e95a1; }

/* ----- 404 ------------------------------------------------------------- */
.ht-404 { text-align: center; padding: 5rem 1.25rem; max-width: 620px; margin: 0 auto; }
.ht-404 .ht-404-code { font-family: var(--ht-font-serif); font-size: 5rem; color: var(--ht-crimson); line-height: 1; margin: 0; }
.ht-404 h1 { font-size: 1.9rem; margin: 1rem 0 .75rem; }
.ht-404 p { color: var(--ht-ink-soft); margin-bottom: 1.75rem; }

/* ----- Responsive ------------------------------------------------------ */
@media (max-width: 980px) {
  .ht-layout { grid-template-columns: 1fr; gap: 2rem; }
  .ht-rail { position: static; }
  .ht-hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .ht-hero-figure { order: -1; }
  .ht-cardgrid--3 { grid-template-columns: repeat(2, 1fr); }
  .ht-feature { grid-template-columns: 1fr; gap: 1.5rem; }
  .ht-feature.is-reverse .ht-feature-media { order: 0; }
  .ht-footer-cols { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .ht-section { padding: 2.25rem 0; }
  .ht-cardgrid--3, .ht-cardgrid--2 { grid-template-columns: 1fr; }
  .ht-footer-cols { grid-template-columns: 1fr; }
  .ht-hero .ht-lead { max-width: 100%; }
}

/* Bulma navbar mobile menu surface */
@media (max-width: 1023px) {
  .ht-nav .navbar-menu { box-shadow: var(--ht-shadow); border-top: 1px solid var(--ht-line); }
  .ht-nav .navbar-menu.is-active { padding: .5rem .75rem; }
}

/* Layout helpers (replace former inline styles — strict file separation) */
.ht-figure--lead { margin: 0 0 1.75rem; }
.ht-figure--hub { margin: 0 0 2rem; }
.ht-hubintro { max-width: 760px; }
.ht-hub-title { font-size: clamp(2rem, 4vw, 2.7rem); margin: .2rem 0 1rem; }
.ht-prose--centered { max-width: var(--ht-readw); margin: 0 auto; }
.ht-h2-lg { font-size: 1.9rem; margin: .2rem 0 .8rem; }
.ht-lead-soft { color: var(--ht-ink-soft); margin-bottom: 1.1rem; }
.ht-secthead--center { text-align: center; margin-left: auto; margin-right: auto; }
.ht-secthead--center p { margin-left: auto; margin-right: auto; }
.ht-btn-row--center { justify-content: center; }
