/* The reading pages (4 What to know, 4.1, 4.2, 4.4): the library's own pieces, as wireframed on 2F0-0, 11B-0, H3-0 and 1IC-0.
   Tokens only (datum.css, site.css): no new colours, sizes or shadows. Plain rows between hairlines, no card grid, no chips. */

/* ---------- Search (4 hero): a 52 field with the loupe, then the Search button ---------- */
.lib-search { display: flex; gap: 12px; width: 100%; max-width: var(--col-text); }
.lib-search__field { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border: 1px solid var(--onyx); border-radius: 4px; background: var(--white); }
.lib-search__field:focus-within { outline: 2px solid var(--field); outline-offset: 0; border-color: var(--field); }   /* as 6.1 and 6.4 */
.lib-search__icon { flex: none; fill: none; stroke: var(--onyx); stroke-width: 1.5; stroke-linecap: round; }
.lib-search__input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--onyx); font: inherit; font-size: 16px; line-height: 24px; }
.lib-search__input:focus-visible { outline: none; }
.lib-search__input::placeholder, .lib-input::placeholder { color: var(--grey); opacity: 1; }

/* ---------- Tabs (4 hero foot): 64 below the columns, a hairline under the row, Field Blue rule under the current tab ---------- */
.lib-tabs { padding-top: 64px; }
.lib-tabs__list { display: flex; gap: 40px; border-bottom: 1px solid var(--hairline); }
.lib-tab { display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 24px; color: var(--onyx); text-decoration: none; white-space: nowrap; }
.lib-tab::after { content: ""; height: 2px; background: transparent; }
.lib-tab.is-current { font-weight: 500; }
.lib-tab.is-current::after { background: var(--field); }
a.lib-tab:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Sections ---------- */
.lib-sec { padding-bottom: var(--section-y-fluid); }
.lib-sec__in { display: flex; flex-direction: column; gap: 48px; }
.lib-sec__in--find { gap: 32px; }
.lib-more { font-size: 16px; line-height: 24px; font-weight: 500; }
.lib-more--faq { padding-top: 32px; }

/* ---------- Start here: picture (568) | report (560) ---------- */
.lib-feature { display: grid; grid-template-columns: minmax(0, var(--col-pic)) minmax(0, var(--col-text)); justify-content: space-between; column-gap: 48px; align-items: center; }
.lib-feature__pic { min-width: 0; }
.lib-feature__text { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.lib-feature__h3 a { color: var(--onyx); text-decoration: none; }
.lib-feature__h3 a:hover { text-decoration: underline; text-underline-offset: 6px; }
.lib-tag { font-size: 14px; line-height: 20px; font-weight: 500; }

/* ---------- Report form (4, 4.1) ---------- */
.lib-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: var(--col-text); }
.lib-form__label { font-size: 16px; line-height: 24px; font-weight: 500; }
.lib-form__row { display: flex; flex-wrap: wrap; gap: 12px; }
.lib-input { height: 52px; padding: 0 16px; border: 1px solid var(--onyx); border-radius: 4px; background: var(--white); color: var(--onyx); font: inherit; font-size: 16px; line-height: 24px; }
.lib-form__input { flex: 0 1 300px; min-width: 0; }

/* ---------- List rows: type (160) | title and line | date (160) | arrow, between hairlines ---------- */
.lib-list { border-top: 1px solid var(--hairline); }
.lib-row { position: relative; display: flex; align-items: center; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--hairline); }
.lib-row[hidden] { display: none; }
.lib-row__type { flex: none; width: 160px; font-size: 14px; line-height: 20px; font-weight: 500; }
.lib-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lib-row__title { font-size: 20px; line-height: 30px; font-weight: 500; text-wrap: pretty; }
.lib-row__sum { font-size: 16px; line-height: 24px; }
.lib-row__date { flex: none; width: 160px; font-size: 14px; line-height: 20px; }
.lib-row__arrow { flex: none; margin-left: auto; fill: none; stroke: var(--field); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lib-row__link { color: var(--onyx); text-decoration: none; }
.lib-row__link::after { content: ""; position: absolute; inset: 0; }   /* the whole row is the link's target */
.lib-row.is-link:hover .lib-row__link { text-decoration: underline; text-underline-offset: 4px; }
.lib-list--related .lib-row__type { width: 120px; }
.lib-list--roles .lib-row { padding: 20px 0; }

.lib-latest { display: flex; flex-direction: column; gap: 16px; }
.lib-latest__h { font-size: 16px; line-height: 24px; font-weight: 500; }
.lib-empty { padding: 8px 0; font-size: 16px; line-height: 24px; }

/* ---------- Filters: four 52 selects, as drawn (Type, Topic, Role, State) ---------- */
.lib-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.lib-select { position: relative; display: inline-flex; }
.lib-select__el { field-sizing: content; appearance: none; -webkit-appearance: none; height: 52px; padding: 0 40px 0 16px; border: 1px solid var(--onyx); border-radius: 4px; background: var(--white); color: var(--onyx); font: inherit; font-size: 16px; line-height: 24px; cursor: pointer; }
.lib-select__icon { position: absolute; right: 16px; top: 50%; margin-top: -8px; pointer-events: none; fill: none; stroke: var(--onyx); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Long reads (4.1, 4.2, 4.4) ---------- */
.hero + .lr .lr__cols--top { padding-top: 0; }   /* the hero's own 128 already sits above the columns, as drawn */
.lr__body .lib-list { list-style: none; padding-left: 0; }
.lr__body .lib-list li + li { margin-top: 0; }
.lr__body .lib-row__link { color: var(--onyx); font-weight: 500; text-decoration: none; }
.lr__body > .faq__list { margin-top: 24px; }
.lr__body > .ph { max-width: none; }                                  /* a gap in the article spans the article column */
.lr__body > .pic { max-width: none; }                                 /* 4.1's picture to make: 700 x 400, as drawn */
.lr__body > .pic .pic__todo { aspect-ratio: 700 / 400; }
.lr__body > .lib-tags { margin-top: 56px; }

/* In short (4.2): between an Onyx rule and a hairline, three square bullets in the lead size. */
.lib-short { display: flex; flex-direction: column; gap: 16px; padding: 32px 0; border-top: 1px solid var(--onyx); border-bottom: 1px solid var(--hairline); }
.lib-short__h { font-size: 16px; line-height: 24px; font-weight: 500; }
.lr__body .lib-short__list { display: flex; flex-direction: column; gap: 12px; list-style: none; padding-left: 0; }
.lr__body .lib-short__list li { display: flex; gap: 16px; margin: 0; font-size: 20px; line-height: 30px; }
.lib-short__list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 12px; background: var(--onyx); }

/* Tags (4.2): links to the hub with that filter on. */
.lib-tags { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 32px; border-top: 1px solid var(--hairline); }

/* Related reading (4.1, 4.2): H3 (360) | rows (700). */
.lib-related { padding-bottom: var(--section-y-fluid); }
.lib-related__in { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 700px); justify-content: space-between; column-gap: 48px; align-items: start; }

/* The close band's link line (4.1, 4.2). Colour comes from site.css (.close a). */
.lib-close-link { font-size: 20px; line-height: 30px; font-weight: 500; }
.lib-close-link a { text-decoration: underline; text-underline-offset: 4px; }
.lib-close-link a:hover { text-decoration-thickness: 2px; }

/* A link inside the hero lead (4.4) takes the lead's size. */
.lib-inline { font-size: inherit; line-height: inherit; white-space: normal; }

@media (max-width: 1279px) {
  .lib-feature, .lib-related__in { column-gap: 40px; }
}

@media (max-width: 767px) {
  .lib-sec__in { gap: 32px; }
  .lib-tabs { padding-top: 48px; }
  /* Phones: the tabs wrap rather than scroll out of sight; the search field takes the full width, its button below. */
  .lib-tabs__list { flex-wrap: wrap; column-gap: 24px; row-gap: 12px; }
  .lib-search { flex-wrap: wrap; }
  .lib-search__field { flex: 1 1 100%; }
  .lib-feature, .lib-related__in { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .lib-related__in { row-gap: 24px; }
  .lib-feature__pic { order: 1; justify-self: center; width: 100%; }
  .lib-form__input { flex: 1 1 100%; }
  .lib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 4px; padding: 20px 0; }
  .lib-row__type, .lib-row__main, .lib-row__date { grid-column: 1; width: auto; }
  .lib-row__arrow { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* The report form's send error (4, 4.1), as 6.1's: Sent back red, with its icon, above nothing else; the email stays. */
.lib-form__error { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding: 16px; border: 1px solid var(--back); border-radius: 8px; font-size: 16px; line-height: 24px; }
.lib-form__error[hidden] { display: none; }
.lib-form__error .cf__icon { flex: none; margin-top: 4px; color: var(--back); }
