/* Shared reader finishing pass, loaded after the individual reader styles.
   Preserve article media, sponsor artwork and the separate event/book readers. */
@media screen {
  /* Warm neutral surfaces tie news introductions to the rest of the site. */
  .bhm-article-main .bhm-article-layout--news .bhm-reader-title,
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-reader-panel__title,
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-card__title {
    color: #222222;
  }
  .bhm-article-layout--news .bhm-reader-lead {
    border-bottom-color: #ddd8cf;
  }
  .bhm-article-layout--news .bhm-reader-meta {
    border-top-color: #ddd8cf;
  }
  .bhm-article-main .bhm-article-layout--news .bhm-reader-lead-media {
    border-color: #e4dfd5;
    background: #f6f3ec;
  }
  .bhm-article-layout--news .bhm-reader-standfirst,
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-card__summary {
    color: #565a58;
  }
  .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) .bhm-context-card__image {
    background: #f6f3ec;
  }

  /* The reader narrows when a right-hand rail is present. Let related cards
     respond to that available width instead of forcing three narrow columns. */
  .bhm-article-main .bhm-article-layout--news > .bhm-reader-sidebar {
    container: bhm-reader-related / inline-size;
  }
  .bhm-article-main .bhm-article-layout--news > .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px 24px;
  }
  .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) > li {
    display: flex;
    min-width: 0;
    border-bottom-color: #ddd8cf;
  }
  .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) .bhm-context-card {
    width: 100%;
    height: 100%;
    padding-block: 20px;
    gap: 14px;
  }
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-card:hover .bhm-context-card__title {
    color: var(--bhm-dark-red, #9f1d24);
  }

  /* The generic reader can have a single panel in a 260px desktop sidebar.
     The earlier two-column rule made its thumbnail and text compete for space. */
  .bhm-article-main .bhm-article-layout:not(.bhm-article-layout--news) > .bhm-reader-sidebar > .bhm-reader-panel:only-child .bhm-context-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    column-gap: 24px;
  }

  /* Plain information pages without side content get one deliberate measure. */
  body.page .bhm-article-main .bhm-article-layout:not(.bhm-article-layout--sidebar):not(.bhm-article-layout--rail) {
    max-width: 780px;
    margin-inline: auto;
  }
  body.page .bhm-article-main .bhm-reader-header {
    padding-bottom: 24px;
    border-bottom: 1px solid #ddd8cf;
  }

  /* Keep profile styling self-contained: only the organisation's own content
     and existing useful-information card are affected. */
  .bhm-article-main .bhm-profile {
    --bhm-profile-surface: #f6f3ec;
  }
  .bhm-profile .bhm-profile-layout {
    column-gap: clamp(28px, 3vw, 48px);
  }
  .bhm-profile .bhm-profile-card {
    border-color: #ddd8cf;
    border-top-color: var(--bhm-red, #bf1824);
  }
  .bhm-profile .bhm-profile-info-title {
    border-bottom-color: #ddd8cf;
  }
  .bhm-profile .bhm-profile-info :is(p, li) {
    text-wrap: pretty;
  }
  .bhm-profile .bhm-profile-info > :first-child {
    margin-top: 0;
  }

  /* Small reader navigation keeps a clear keyboard target and touch area. */
  .bhm-article-main .bhm-reader-pagination > :is(a, span) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border-color: #cfc8bd;
    line-height: 1.35;
  }
  .bhm-article-main .bhm-reader-pagination > [aria-current="page"] {
    border-color: var(--bhm-dark-red, #9f1d24);
    background: #f6f3ec;
    font-weight: 700;
  }
  .bhm-article-main .bhm-reader-sidebar .bhm-context-card:focus-visible,
  .bhm-article-main .bhm-reader-pagination a:focus-visible {
    outline: 3px solid var(--bhm-dark-red, #9f1d24);
    outline-offset: 4px;
  }

  @container bhm-reader-related (min-width: 504px) {
    .bhm-article-main .bhm-article-layout--news > .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @container bhm-reader-related (min-width: 768px) {
    .bhm-article-main .bhm-article-layout--news > .bhm-reader-sidebar .bhm-context-list:not(.bhm-context-list--profiles) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}

@media screen and (max-width: 599px) {
  .bhm-article-layout--news .bhm-reader-lead {
    margin-bottom: 24px;
  }
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-reader-panel__title {
    font-size: 22px;
    line-height: 1.3;
  }
  .bhm-article-main .bhm-article-layout--news .bhm-reader-sidebar .bhm-context-card__title {
    font-size: 18px;
    line-height: 1.4;
  }
  .bhm-profile .bhm-profile-layout {
    row-gap: 32px;
  }
  body.page .bhm-article-main .bhm-reader-header {
    padding-bottom: 20px;
  }
}
