@layer institutional {
  html[lang] .page-shell .news-page [data-search-hidden="true"],
  .news-page .news-search[hidden],
  .news-page .news-search [hidden],
  .news-page .news-search-status[hidden],
  .news-page .news-search-empty[hidden] { display: none !important; }

  .news-page .news-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin: 0 0 24px;
    padding: 0 10px 0 20px;
    border: 0;
    border-radius: var(--radius-ui);
    background: var(--neutral-card-surface);
    color: #617481;
  }
  .news-page .news-search:focus-within {
    background: #fff;
    outline: none;
    box-shadow: none;
    outline-offset: 0;
  }
  /* Reserve the search row before JS enables it, so the first story never drops. */
  html[lang] .page-shell .news-page .news-search[hidden] {
    display: flex !important;
    visibility: hidden;
  }
  .news-page .news-search > svg { width: 20px; height: 20px; flex: none; }
  .news-page .news-search input {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    appearance: none;
    background: transparent;
    color: #172f40;
  }
  .news-page .news-search input::placeholder { color: #7b8992; opacity: 1; }
  .news-page .news-search input::-webkit-search-cancel-button { appearance: none; }
  .news-page .news-search-clear {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-ui);
    background: transparent;
    color: #617481;
    cursor: pointer;
  }
  .news-page .news-search-clear svg { width: 18px; height: 18px; }
  .news-page .news-search-clear:focus-visible,
  .news-page .news-search-reset:focus-visible { outline: none; background: #e7ebee; }
  .news-page .news-search-status { margin: -8px 0 20px; color: #617481; }
  .news-page .news-search-empty { padding: 48px 20px 64px; text-align: center; }
  .news-page .news-search-empty p { margin: 0 0 20px; color: #5b6871; }
  .news-page .news-search-reset {
    min-height: 44px;
    padding: 10px 20px;
    border: 0;
    border-radius: var(--radius-ui);
    background: #fff;
    color: #243f50;
    cursor: pointer;
  }

  @media (max-width: 680px) , (orientation: portrait)  {
    .news-page .news-search { min-height: 50px; margin-bottom: 16px; padding-left: 16px; gap: 10px; }
    .news-page .news-search input { height: 48px; }
    .news-page .news-search-status { margin: 0 6px 16px; }
    html[lang] .page-shell .news-page .news-pair:has(> .news-pair-secondary[data-search-hidden]) > .news-pair-primary { border-radius: var(--radius-ui) !important; }
    .news-page .news-pair:has(> .news-pair-primary[data-search-hidden]) > .news-pair-secondary { border-radius: var(--radius-ui); }
    .news-page .news-pair:has(> .news-pair-primary[data-search-hidden]) > .news-pair-secondary::before { display: none; }
  }
}

@layer typography {
  html[lang] .page-shell .news-page .news-search input,
  html[lang] .page-shell .news-page .news-search-reset {
    font-family: var(--site-font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
  }
  html[lang] .page-shell .news-page .news-search-status { font-size: 14px; line-height: 1.6; }
  html[lang] .page-shell .news-page .news-search-empty p { font-size: 16px; line-height: 1.7; }
}

/* Quiet numbered navigation after the final article. */
.news-page .news-pagination[hidden] { display: none !important; }
.news-page .news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 18px 0 0;
}
.news-page .news-pagination a,
.news-page .news-pagination span {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 40px;
  color: #6b7c86;
  font: 400 13px/1 var(--site-font-body, sans-serif);
  text-decoration: none;
}
.news-page .news-pagination a { background: transparent; }
.news-page .news-pagination a[aria-current="page"] {
  color: #243f50;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.news-page .news-pagination a:focus-visible { outline: none !important; outline-offset: 1px; }
@media (hover: hover)  {
  .news-page .news-pagination a:hover { color: #243f50; text-decoration: underline; text-underline-offset: 5px; }
}

/* Pagination moves focus here for reading; the collection is not a control. */
@layer institutional {
  html[lang] .page-shell .news-page .news-index-list[tabindex="-1"]:focus {
    outline: none !important;
    outline-offset: 0 !important;
  }
}

/* A quiet way back when the reader is at the top of a later page. */
.news-page .news-previous[hidden] { display: none !important; }
.news-page .news-previous {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  padding: 0 2px;
  justify-self: start;
  background: transparent;
  color: #617481;
  text-decoration: none;
}
@layer typography {
  html[lang] .page-shell .news-page .news-previous {
    font-family: var(--site-font-body);
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
  }
}
@media (hover: hover)  {
  .news-page .news-previous:hover { color: #426c85; }
}

/* Use one spacing system rather than stacking grid gaps and control margins. */
@layer institutional {
  html[lang] .page-shell .news-page .archive-section {
    row-gap: 12px !important;
  }
  html[lang] .page-shell .news-page .archive-section > .news-search {
    margin-bottom: 0 !important;
  }
}
