/* Editorial entry pages: news, resources and tools.
   The global header, footer and scroll engine remain owned by site.css/site.js. */

.hemu-portal-main {
  --portal-paper: var(--theme-paper, #f7f6f1);
  --portal-surface: var(--theme-surface, #fffefa);
  --portal-ink: var(--theme-ink, #26352f);
  --portal-text: var(--theme-text, #4f5d56);
  --portal-muted: var(--theme-muted, #748079);
  --portal-line: var(--theme-line, #dcded6);
  --portal-line-strong: var(--theme-line-strong, #bcc4ba);
  --portal-green: #254a37;
  --portal-green-soft: #edf2e8;
  --portal-rust: #c94a2d;
  --portal-rust-soft: #f6e9e3;
  overflow: clip;
  min-height: calc(100vh - var(--site-header-height));
  color: var(--portal-text);
  background: var(--portal-paper);
  font-family: var(--font);
}

.hemu-portal-main *,
.hemu-portal-main *::before,
.hemu-portal-main *::after { box-sizing: border-box; }

.hemu-portal-main a { color: inherit; text-decoration: none; }

.hemu-portal-main a:focus-visible,
.hemu-portal-main button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--portal-green) 76%, white);
  outline-offset: 3px;
}

.hemu-portal-shell {
  width: min(calc(100% - 48px), 1240px);
  margin-inline: auto;
}

/* Masthead ---------------------------------------------------------------- */

.hemu-portal-masthead {
  position: relative;
  isolation: isolate;
  min-height: 188px;
  border-bottom: 1px solid var(--portal-line-strong);
  background: var(--portal-paper);
}

.hemu-portal-masthead::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .36;
  background-repeat: no-repeat;
  background-position: center;
  background-size: max(1240px, 100vw) auto;
  content: "";
  pointer-events: none;
}

.hemu-portal-masthead.is-news::before { background-image: url("./images/portal-redesign/news-masthead-lineart.png"); }
.hemu-portal-masthead.is-resources::before { background-image: url("./images/portal-redesign/resources-masthead-lineart.png"); }
.hemu-portal-masthead.is-tools::before { background-image: url("./images/portal-redesign/tools-masthead-lineart.png"); }

.masthead-grid {
  display: grid;
  grid-template-columns: minmax(330px, .92fr) minmax(430px, 1.18fr) minmax(210px, .58fr);
  gap: clamp(24px, 4vw, 66px);
  align-items: center;
  min-height: 188px;
  padding-block: 28px 26px;
}

.portal-kicker {
  margin: 0 0 13px;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: .18em;
  line-height: 1;
}

.portal-kicker span { color: var(--portal-rust); letter-spacing: .08em; }

.masthead-title h1 {
  margin: 0;
  color: #151b18;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(44px, 4.25vw, 60px);
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.04;
  text-wrap: balance;
}

html body .hemu-portal-main .masthead-title h1,
html body .hemu-portal-main .news-lead-copy h2,
html body .hemu-portal-main .resource-lead-copy h3 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif !important;
  letter-spacing: .025em !important;
}

.masthead-intro {
  align-self: center;
  margin: 36px 0 0;
  color: #303a35;
  font-size: clamp(14px, 1.12vw, 16px);
  line-height: 1.82;
}

.masthead-date {
  display: flex;
  gap: 9px;
  align-items: baseline;
  justify-self: end;
  align-self: end;
  margin: 0 0 4px;
  white-space: nowrap;
}

.masthead-date strong { color: var(--portal-rust); font-size: 15px; font-weight: 720; letter-spacing: .04em; }
.masthead-date span { color: var(--portal-ink); font-weight: 700; }
.masthead-date small { color: var(--portal-muted); font-size: 12px; }

.hemu-portal-masthead.is-tools .masthead-grid {
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  grid-template-rows: auto auto;
  column-gap: 48px;
  row-gap: 0;
}

.hemu-portal-masthead.is-tools .masthead-title { grid-column: 1; grid-row: 1; align-self: end; }
.hemu-portal-masthead.is-tools .masthead-intro { grid-column: 1; grid-row: 2; align-self: start; margin: 12px 0 0; }
.hemu-portal-masthead.is-tools .masthead-date { grid-column: 2; grid-row: 2; align-self: end; }

.portal-content { padding-block: 34px 46px; }

/* Shared editorial primitives --------------------------------------------- */

.portal-section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  color: var(--portal-ink);
  font-size: 16px;
  font-weight: 760;
  letter-spacing: .015em;
  line-height: 1.2;
}

.portal-section-title > i {
  width: 3px;
  height: 17px;
  flex: 0 0 auto;
  background: var(--portal-rust);
}

.portal-accent-label {
  margin: 0;
  color: var(--portal-rust);
  font-size: 13px;
  font-weight: 760;
}

.portal-text-link,
.portal-outline-action {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 720;
}

.portal-text-link span,
.portal-outline-action span,
.portal-index-column header > a span { transition: transform 220ms var(--ease-out); }

.portal-text-link:hover span,
.portal-text-link:focus-visible span,
.portal-outline-action:hover span,
.portal-outline-action:focus-visible span,
.portal-index-column header > a:hover span,
.portal-index-column header > a:focus-visible span { transform: translateX(4px); }

.portal-outline-action {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--portal-green);
  border-radius: 3px;
  transition: color 200ms ease, background-color 200ms ease, transform 200ms var(--ease-out);
}

.portal-outline-action:hover { color: #fff; background: var(--portal-green); transform: translateY(-1px); }

.portal-update-list { margin-top: 10px; }

.portal-update-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: start;
  min-height: 64px;
  padding: 11px 4px 10px 0;
  border-bottom: 1px solid var(--portal-line);
  transition: padding 210ms var(--ease-out), background-color 210ms ease;
}

.portal-update-row:hover,
.portal-update-row:focus-visible { padding-left: 8px; background: color-mix(in srgb, var(--portal-green-soft) 46%, transparent); }

.portal-update-row > span { min-width: 0; }
.portal-update-row strong { display: block; overflow: hidden; color: var(--portal-ink); font-size: 13px; font-weight: 680; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.portal-update-row small { display: block; overflow: hidden; margin-top: 6px; color: var(--portal-muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.portal-update-row time { grid-column: 3; grid-row: 1; padding-top: 1px; color: var(--portal-muted); font-size: 10px; white-space: nowrap; }
.portal-update-row > em {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  padding: 2px 5px;
  border-radius: 2px;
  color: #fff;
  background: var(--portal-rust);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .06em;
}

.portal-update-row.is-latest::before {
  position: absolute;
  top: 17px;
  left: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--portal-rust);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--portal-rust) 12%, transparent);
  content: "";
}

.portal-update-panel > .portal-text-link { margin-top: 12px; }

/* News -------------------------------------------------------------------- */

.news-focus-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr) 408px;
  gap: 25px;
  align-items: stretch;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--portal-line);
}

.news-lead-image {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  background: #dde3dc;
}

.news-lead-image img,
.resource-lead-image > img,
.tools-workbench-preview > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 720ms var(--ease-out), filter 420ms ease;
}

.news-lead-image:hover img,
.news-lead-image:focus-visible img,
.resource-lead-image:hover > img,
.resource-lead-image:focus-visible > img { transform: scale(1.025); filter: saturate(1.04) contrast(1.02); }

.news-lead-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 5px 0 2px;
}

.news-lead-copy h2 {
  margin: 25px 0 16px;
  color: #18201c;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1.6;
}

.news-lead-copy h2 a {
  border-bottom: 1px solid transparent;
  transition: border-color 260ms ease;
}

.news-lead-copy h2 a:hover { border-bottom-color: currentColor; }

.news-lead-copy > p:not(.portal-accent-label) {
  margin: 0;
  color: var(--portal-text);
  font-size: 12px;
  line-height: 1.85;
}

.news-lead-copy footer {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  color: var(--portal-muted);
  font-size: 10px;
}

.news-focus-layout > .portal-update-panel,
.resource-updates {
  padding-left: 20px;
  border-left: 1px solid var(--portal-line);
}

.portal-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.portal-index-column { min-width: 0; padding: 0 18px; border-left: 1px solid var(--portal-line); }
.portal-index-column:first-child { padding-left: 0; border-left: 0; }
.portal-index-column:last-child { padding-right: 0; }

.portal-index-column header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid var(--portal-line);
}

.portal-index-column header h2 {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  margin: 0;
  color: var(--portal-ink);
  font-size: 15px;
  font-weight: 740;
  white-space: nowrap;
}

.portal-index-column header h2 img { width: 18px; height: 18px; object-fit: contain; }
.portal-index-column header > a { color: var(--portal-muted); font-size: 10px; font-weight: 650; white-space: nowrap; }

.portal-compact-list > a {
  position: relative;
  display: grid;
  grid-template-columns: 40px 58px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 35px;
  border-bottom: 1px solid color-mix(in srgb, var(--portal-line) 82%, transparent);
  transition: color 180ms ease, padding 210ms var(--ease-out), background-color 180ms ease;
}

.portal-compact-list > a:hover,
.portal-compact-list > a:focus-visible { padding-inline: 5px; color: var(--portal-green); background: color-mix(in srgb, var(--portal-green-soft) 45%, transparent); }
.portal-compact-list time { color: var(--portal-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.portal-compact-list small { color: var(--portal-text); font-size: 9px; white-space: nowrap; }
.portal-compact-list strong { overflow: hidden; color: var(--portal-ink); font-size: 10px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.portal-compact-list em { justify-self: end; padding: 1px 4px; border-radius: 2px; color: #fff; background: var(--portal-rust); font-size: 8px; font-style: normal; white-space: nowrap; }
.portal-compact-list .is-latest time,
.portal-compact-list .is-soon time { color: var(--portal-rust); font-weight: 760; }
.portal-news-sync { margin: 9px 0 0; color: var(--portal-muted); font-size: 8px; text-align: right; }
.portal-list-empty { display: grid; min-height: 84px; place-items: center; color: var(--portal-muted); font-size: 10px; }
.portal-news-pagination[hidden] { display: none !important; }
.portal-news-page .nh-route-section,
.portal-news-page .nh-hero-media { display: contents; }

.portal-topic-list > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 35px;
  border-bottom: 1px solid color-mix(in srgb, var(--portal-line) 82%, transparent);
  transition: padding 210ms var(--ease-out), background-color 180ms ease;
}

.portal-topic-list > a:hover,
.portal-topic-list > a:focus-visible { padding-inline: 5px; background: color-mix(in srgb, var(--portal-green-soft) 45%, transparent); }
.portal-topic-list strong { overflow: hidden; color: var(--portal-ink); font-size: 10px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.portal-topic-list time { color: var(--portal-muted); font-size: 9px; font-variant-numeric: tabular-nums; }

/* Resources --------------------------------------------------------------- */

.resource-focus-layout {
  display: grid;
  grid-template-columns: 395px minmax(0, 1fr) 405px;
  gap: 28px;
  align-items: stretch;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--portal-line);
}

.resource-lead-image {
  position: relative;
  overflow: hidden;
  min-height: 255px;
  border-radius: 4px;
  background: #d9dfd7;
}

.resource-lead-image::after {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: rgba(8, 18, 13, .58);
  content: "";
  pointer-events: none;
}

.resource-lead-image > span {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 12px;
  left: 14px;
  display: grid;
  gap: 4px;
  color: #fff;
}

.resource-lead-image > span strong { font-size: 11px; font-weight: 700; }
.resource-lead-image > span small { color: rgba(255,255,255,.82); font-size: 9px; }

.resource-lead-copy { display: flex; min-width: 0; flex-direction: column; }
.resource-lead-copy h3 { margin: 24px 0 14px; color: #19211d; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: clamp(21px, 1.75vw, 24px); line-height: 1.35; }
.resource-lead-copy h3 a { border-bottom: 1px solid transparent; transition: border-color 260ms ease; }
.resource-lead-copy h3 a:hover { border-bottom-color: currentColor; }
.resource-lead-copy > p { margin: 0; color: var(--portal-text); font-size: 12px; line-height: 1.9; }
.resource-lead-copy dl { display: grid; gap: 8px; margin: auto 0 14px; padding-top: 14px; border-top: 1px solid var(--portal-line); }
.resource-lead-copy dl div { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; font-size: 10px; }
.resource-lead-copy dt { color: var(--portal-muted); }
.resource-lead-copy dd { margin: 0; color: var(--portal-text); }
.resource-updates .portal-update-row { min-height: 47px; align-items: center; }
.resource-updates .portal-update-row > em { top: 13px; }
.resource-updates .portal-update-row.is-latest::before { top: 19px; }

.resource-index-grid { margin-top: 18px; }

.resource-record-list > a {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 35px;
  border-bottom: 1px solid color-mix(in srgb, var(--portal-line) 82%, transparent);
  transition: padding 210ms var(--ease-out), background-color 180ms ease;
}

.resource-record-list > a:hover,
.resource-record-list > a:focus-visible { padding-inline: 5px; background: color-mix(in srgb, var(--portal-green-soft) 45%, transparent); }
.resource-record-list img { width: 14px; height: 14px; opacity: .78; }
.resource-record-list strong { overflow: hidden; color: var(--portal-ink); font-size: 10px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.resource-record-list small { color: var(--portal-muted); font-size: 9px; white-space: nowrap; }
.resource-record-list em { position: absolute; right: 59px; padding: 1px 4px; color: #fff; background: var(--portal-rust); font-size: 8px; font-style: normal; }
.resource-provenance { margin: 26px 0 0; color: var(--portal-muted); font-size: 9px; }

/* Tools ------------------------------------------------------------------- */

.tools-workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(360px, .97fr);
  gap: 18px;
  align-items: stretch;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--portal-line);
}

.tools-workbench-preview {
  position: relative;
  overflow: hidden;
  min-height: 348px;
  border: 1px solid #26383b;
  border-radius: 5px;
  background: #111f25;
  box-shadow: 0 22px 52px rgba(16, 31, 35, .13);
}

.tools-workbench-preview > img { object-fit: cover; }
.tools-workbench-preview:hover > img { transform: scale(1.012); filter: brightness(.82); }

.preview-hover-label {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(139, 219, 182, .6);
  border-radius: 3px;
  color: #c7f0dc;
  background: rgba(12, 28, 30, .88);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  font-size: 11px;
  font-weight: 720;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 280ms var(--ease-out);
}

.tools-workbench-preview:hover .preview-hover-label,
.tools-workbench-preview:focus-visible .preview-hover-label { opacity: 1; transform: translateY(0); }

.tools-quick-panel { padding-left: 10px; }
.tools-quick-panel > .portal-section-title { min-height: 34px; }
.tools-quick-list { margin-top: 4px; border: 1px solid var(--portal-line); }

.tools-quick-list > a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 14px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--portal-line);
  transition: padding 220ms var(--ease-out), background-color 180ms ease;
}

.tools-quick-list > a:last-child { border-bottom: 0; }
.tools-quick-list > a:hover,
.tools-quick-list > a:focus-visible { padding-left: 18px; background: color-mix(in srgb, var(--portal-green-soft) 58%, transparent); }
.tools-quick-list > a > img { width: 23px; height: 23px; }
.tools-quick-list > a > span { display: grid; gap: 5px; min-width: 0; }
.tools-quick-list strong { color: var(--portal-ink); font-size: 13px; font-weight: 700; }
.tools-quick-list small { overflow: hidden; color: var(--portal-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tools-quick-list em { display: inline-flex; gap: 5px; align-items: center; color: var(--portal-green); font-size: 9px; font-style: normal; white-space: nowrap; }
.tools-quick-list em i { width: 5px; height: 5px; border-radius: 50%; background: #2d8b5a; box-shadow: 0 0 0 3px rgba(45,139,90,.10); }
.tools-quick-list > a > b { color: var(--portal-ink); font-size: 16px; font-weight: 500; transition: transform 220ms var(--ease-out); }
.tools-quick-list > a:hover > b { transform: translateX(3px); }

.tools-index-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 0; }
.tools-index-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tools-index-main .portal-index-column { padding-top: 0; }

.tools-record-list > a {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid color-mix(in srgb, var(--portal-line) 82%, transparent);
  transition: padding 220ms var(--ease-out), background-color 180ms ease;
}

.tools-record-list > a:hover,
.tools-record-list > a:focus-visible { padding-inline: 5px; background: color-mix(in srgb, var(--portal-green-soft) 48%, transparent); }
.tools-record-list span { display: grid; gap: 5px; min-width: 0; }
.tools-record-list strong { overflow: hidden; color: var(--portal-ink); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tools-record-list small { overflow: hidden; color: var(--portal-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tools-record-list time { color: var(--portal-muted); font-size: 9px; white-space: nowrap; }
.tools-record-list em { position: absolute; top: 6px; right: 0; padding: 1px 4px; border-radius: 2px; color: #fff; background: var(--portal-rust); font-size: 7px; font-style: normal; font-weight: 720; }
.tools-record-list .is-primary strong { color: var(--portal-green); }

.tools-activity-panel { min-width: 0; margin-top: 0; padding: 0 14px 10px; border: 1px solid var(--portal-line); background: color-mix(in srgb, var(--portal-surface) 82%, transparent); }
.activity-tabs { display: flex; gap: 22px; min-height: 43px; align-items: center; border-bottom: 1px solid var(--portal-line); }
.activity-tabs button { position: relative; min-height: 43px; padding: 0; border: 0; color: var(--portal-muted); background: transparent; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.activity-tabs button[aria-selected="true"] { color: var(--portal-green); font-weight: 760; }
.activity-tabs button[aria-selected="true"]::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--portal-green); content: ""; }
.activity-list > a { display: grid; grid-template-columns: 16px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 38px; color: var(--portal-text); transition: padding 200ms var(--ease-out), background-color 180ms ease; }
.activity-list > a:hover,
.activity-list > a:focus-visible { padding-inline: 5px; background: color-mix(in srgb, var(--portal-green-soft) 54%, transparent); }
.activity-list img { width: 13px; height: 13px; }
.activity-list span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-list time { color: var(--portal-muted); font-size: 9px; white-space: nowrap; }

/* Motion ------------------------------------------------------------------ */

.portal-motion-ready [data-portal-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 620ms var(--ease-out), transform 720ms var(--ease-out);
}

.portal-motion-ready [data-portal-reveal].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .hemu-portal-main *, .hemu-portal-main *::before, .hemu-portal-main *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .portal-motion-ready [data-portal-reveal] { opacity: 1; transform: none; }
}

/* Dark theme -------------------------------------------------------------- */

html[data-theme="dark"] .hemu-portal-main {
  --portal-green: #a8c5ae;
  --portal-green-soft: #253229;
  --portal-rust: #df866d;
  --portal-rust-soft: #352a23;
}

html[data-theme="dark"] .hemu-portal-masthead::before { opacity: .11; filter: invert(1) grayscale(.5); mix-blend-mode: screen; }
html[data-theme="dark"] .masthead-title h1,
html[data-theme="dark"] .masthead-intro,
html[data-theme="dark"] .news-lead-copy h2,
html[data-theme="dark"] .resource-lead-copy h3 { color: var(--portal-ink); }
html[data-theme="dark"] .portal-update-row > em,
html[data-theme="dark"] .portal-compact-list em,
html[data-theme="dark"] .resource-record-list em,
html[data-theme="dark"] .tools-record-list em { color: #201714; }
html[data-theme="dark"] .portal-index-column header h2 img,
html[data-theme="dark"] .resource-record-list img,
html[data-theme="dark"] .tools-quick-list > a > img,
html[data-theme="dark"] .activity-list img { filter: invert(.9) sepia(.12); }

/* Tablet ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .masthead-grid { grid-template-columns: minmax(270px, .9fr) minmax(290px, 1fr) auto; gap: 26px; }
  .masthead-intro { font-size: 13px; }
  .news-focus-layout { grid-template-columns: minmax(260px, .8fr) minmax(0, 1fr); }
  .news-focus-layout > .portal-update-panel { grid-column: 1 / -1; padding: 20px 0 0; border-top: 1px solid var(--portal-line); border-left: 0; }
  .news-focus-layout > .portal-update-panel .portal-update-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .resource-focus-layout { grid-template-columns: minmax(320px, .95fr) minmax(0, 1.05fr); }
  .resource-updates { grid-column: 1 / -1; padding: 20px 0 0; border-top: 1px solid var(--portal-line); border-left: 0; }
  .resource-updates .portal-update-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .tools-workbench-layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); }
  .tools-index-layout { grid-template-columns: 1fr; }
  .tools-activity-panel { display: grid; grid-template-columns: 170px minmax(0, 1fr); padding: 0; }
  .activity-tabs { flex-direction: column; gap: 0; align-items: stretch; justify-content: center; padding: 10px 14px; border-right: 1px solid var(--portal-line); border-bottom: 0; }
  .activity-tabs button { text-align: left; }
  .activity-tabs button[aria-selected="true"]::after { top: 8px; right: auto; bottom: 8px; left: -14px; width: 2px; height: auto; }
  .activity-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 14px; column-gap: 20px; }
}

@media (max-width: 900px) {
  .hemu-portal-shell { width: min(calc(100% - 36px), 1240px); }
  .hemu-portal-masthead { min-height: 210px; }
  .hemu-portal-masthead::before { opacity: .32; background-position: 61% center; background-size: auto 100%; }
  .masthead-grid { grid-template-columns: minmax(280px, .85fr) minmax(0, 1fr); min-height: 210px; }
  .masthead-date { grid-column: 2; justify-self: start; align-self: start; margin-top: -26px; }
  .hemu-portal-masthead.is-tools .masthead-grid { grid-template-columns: minmax(0, .88fr) minmax(330px, 1.12fr); }
  .hemu-portal-masthead.is-tools .masthead-date { grid-column: 2; justify-self: end; align-self: end; margin-top: 0; }
  .portal-content { padding-top: 28px; }
  .portal-index-grid { grid-template-columns: 1fr; gap: 0; }
  .portal-index-column { padding: 14px 0 0; border-top: 1px solid var(--portal-line); border-left: 0; }
  .portal-index-column:first-child { border-top: 0; }
  .portal-index-column header { min-height: 46px; }
  .portal-compact-list > a { min-height: 40px; grid-template-columns: 42px 70px minmax(0,1fr) auto; }
  .portal-topic-list > a { min-height: 40px; }
  .resource-record-list > a { min-height: 40px; }
  .tools-workbench-layout { grid-template-columns: 1fr; }
  .tools-quick-panel { padding-left: 0; }
  .tools-quick-panel > .portal-section-title { margin-top: 10px; }
  .tools-index-main { grid-template-columns: 1fr; }
  .tools-index-main .portal-index-column { padding-top: 12px; }
}

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .hemu-portal-shell { width: min(calc(100% - 28px), 1240px); }
  .hemu-portal-masthead { min-height: 236px; }
  .hemu-portal-masthead::before { opacity: .22; background-position: 66% bottom; background-size: auto 78%; }
  .masthead-grid { display: flex; min-height: 236px; flex-direction: column; gap: 16px; align-items: stretch; justify-content: center; padding-block: 25px 22px; }
  .portal-kicker { margin-bottom: 10px; font-size: 11px; }
  .masthead-title h1 { max-width: 78%; font-size: clamp(39px, 12.4vw, 52px); line-height: 1.08; }
  .hemu-portal-masthead.is-tools .masthead-title { align-self: stretch; }
  .hemu-portal-masthead.is-tools .masthead-title h1 { max-width: 100%; font-size: clamp(38px, 11.8vw, 48px); white-space: nowrap; }
  .masthead-intro { max-width: 88%; margin: 0; font-size: 12px; line-height: 1.7; }
  .masthead-intro br { display: none; }
  .masthead-date { align-self: flex-start; justify-self: auto; margin: 0; }
  .hemu-portal-masthead.is-tools .masthead-date { align-self: flex-start; justify-self: auto; margin: 0; }
  .masthead-date strong { font-size: 12px; }
  .masthead-date small { font-size: 10px; }
  .portal-content { padding-block: 22px 34px; }
  .news-focus-layout,
  .resource-focus-layout { grid-template-columns: 1fr; gap: 20px; }
  .news-lead-image { min-height: 0; aspect-ratio: 1.32; }
  .news-lead-copy { min-height: 280px; }
  .news-lead-copy h2 { margin: 16px 0 12px; font-size: 23px; line-height: 1.55; }
  .news-lead-copy > p:not(.portal-accent-label) { font-size: 12px; }
  .news-focus-layout > .portal-update-panel,
  .resource-updates { grid-column: auto; padding: 20px 0 0; }
  .news-focus-layout > .portal-update-panel .portal-update-list,
  .resource-updates .portal-update-list { grid-template-columns: 1fr; }
  .portal-update-row { min-height: 62px; }
  .portal-update-row strong { font-size: 12px; }
  .portal-index-grid { margin-top: 8px; }
  .portal-index-column header h2 { font-size: 14px; }
  .portal-index-column header > a { font-size: 9px; }
  .portal-compact-list > a { grid-template-columns: 38px 58px minmax(0,1fr) auto; gap: 6px; }
  .portal-compact-list strong { font-size: 10px; }
  .resource-lead-image { min-height: 230px; }
  .resource-lead-copy h3 { margin: 16px 0 12px; font-size: 24px; }
  .resource-lead-copy dl { margin-top: 18px; }
  .resource-index-grid { margin-top: 8px; }
  .resource-record-list > a { grid-template-columns: 16px minmax(0,1fr) auto; gap: 8px; }
  .resource-record-list strong { font-size: 10px; }
  .resource-provenance { line-height: 1.6; }
  .tools-workbench-preview { min-height: 0; aspect-ratio: 2.12; }
  .preview-hover-label { display: none; }
  .tools-quick-list > a { grid-template-columns: 25px minmax(0, 1fr) 14px; min-height: 65px; padding-inline: 12px; }
  .tools-quick-list > a > img { width: 20px; height: 20px; }
  .tools-quick-list > a > em { display: none; }
  .tools-quick-list strong { font-size: 12px; }
  .tools-index-layout { gap: 12px; }
  .tools-record-list > a { min-height: 58px; }
  .tools-activity-panel { display: block; }
  .activity-tabs { min-height: 44px; flex-direction: row; gap: 22px; align-items: center; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--portal-line); }
  .activity-tabs button { text-align: center; }
  .activity-tabs button[aria-selected="true"]::after { top: auto; right: 0; bottom: -1px; left: 0; width: auto; height: 2px; }
  .activity-list { display: block; padding: 8px 12px; }
}

@media (max-width: 380px) {
  .masthead-title h1 { font-size: 38px; }
  .masthead-intro { max-width: 96%; }
  .portal-compact-list > a { grid-template-columns: 36px 54px minmax(0,1fr) auto; }
  .portal-compact-list small { font-size: 8px; }
  .tools-quick-list small { font-size: 8px; }
}
