/* M28 Investigates · the section pages as one grid of stories (Bex's briefs of 25 Nov 2026: "SECTION PAGES").
   Investigations and Research & Analysis share this design. Made by lib/p_section.py.

   The page: the header · the grid, twenty stories to a page · the pagination. Dark, as the live site; nothing in a
   box except the page numbers (they are in a box on the live site too).

   The header (second brief of 25 Nov 2026):
     from 992 px   two columns. Left: the title and "Browse by country: [Choose a country]" (no line of introduction
                   since 25 Nov 2026; Research & Analysis also has "Browse by type: [Choose a type]").
                   Right: the map of Africa, 380 px high, always there, its legend small under it on one line.
     below 992 px  the title and the line "[Choose a country] · Show map"; the map is closed until
                   "Show map" is pressed, then stands above the grid.

   The look of the grid, the cards and the page numbers is the live site's (backup of
   m28investigates.com/category/investigations): one card per row on a phone, two from 640 px, three from 1024 px,
   four from 1280 px, 2 rem apart; a card is its picture, the headline in heavy type, the summary, the date; a thin
   line under each card that turns red on hover while the card rises 4 px.

   The type is the site's seven settings (core.css), no size of its own:
     the page title            headline
     the intro                 body text
     a card's headline         body text, heavy (21 px, 18 px on a phone and a tablet), at most three lines
     a card's summary          small text, at most three lines
     date and country, "Browse by country", the legend, "Showing 1 to 20 of N results", the page numbers      small text */

/* ---------------------------------------------------------------- the header */
.sx-head { padding-top: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); }
.sx-head__in { position: relative; }
.sx-head h1 { position: relative; padding-top: 1.125rem; font: 800 var(--ts-headline)/var(--ts-headline-lh) var(--f-text); letter-spacing: -.03em; color: var(--head); text-wrap: balance; }
.sx-head h1::before { content: ""; position: absolute; left: 0; top: 0; width: 1.75rem; height: 3px; background: var(--red); }      /* the short red bar of the live site's page titles */
.sx-head__intro { margin-top: clamp(.625rem, .5rem + .5vw, 1rem); max-width: 46rem; font: 400 var(--ts-body)/1.45 var(--f-text); color: var(--ink-2); text-wrap: pretty; }

/* "Browse by country". The menu is a <details> (it opens without a script) that lies over the page, so nothing moves */
.sx-cbar__sw { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sx-cbar__line { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem clamp(1.25rem, .5rem + 1.8vw, 2rem); margin-top: clamp(.875rem, .7rem + .7vw, 1.375rem); font: 400 var(--ts-small)/1.4 var(--f-text); color: var(--ink-2); }
.sx-cbar__grp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.sx-cbar__dot { color: var(--ink-3); }
/* "Browse by type" (Research & Analysis): the same menu, one short column */
.sx-cmenu--type .sx-cmenu__panel { width: max-content; min-width: 17rem; max-width: calc(100vw - 2 * var(--gutter)); }
.sx-cmenu--type .sx-cmenu__panel ul { columns: 1; }
.sx-cmenu { position: relative; }
.sx-cmenu > summary { display: inline-flex; align-items: center; gap: .625rem; min-height: 2.25rem; padding: .3125rem .875rem; border: 1px solid var(--charcoal-t25); border-radius: 4px; color: var(--head); cursor: pointer; list-style: none; transition: border-color .2s; }
.sx-cmenu > summary::-webkit-details-marker { display: none; }
.sx-cmenu > summary::after { content: ""; width: 0; height: 0; margin-top: .125rem; border: .28rem solid transparent; border-top: .34rem solid currentColor; border-bottom-width: 0; transition: transform .2s; }
.sx-cmenu[open] > summary::after { transform: rotate(180deg); }
.sx-cmenu > summary:hover, .sx-cmenu[open] > summary { border-color: var(--grey-s38); }
.sx-cmenu__panel { position: absolute; z-index: 20; top: calc(100% + .5rem); left: 0; width: min(46rem, calc(100vw - 2 * var(--gutter))); max-height: min(70vh, 31rem); overflow: auto; padding: 1rem 1.25rem 1.125rem; background: #0F0F0F; border: 1px solid #262626; border-radius: 4px; box-shadow: 0 18px 44px rgb(0 0 0 / .65); }
.sx-cmenu__panel ul { columns: 3; column-gap: 2.25rem; }
.sx-cmenu__panel li { break-inside: avoid; }
.sx-cmenu__panel li a { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .34rem 0; color: var(--ink); }
.sx-cmenu__panel li a b { font-weight: 400; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.sx-cmenu__panel li a:hover span { color: var(--white); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .22em; }
.sx-cmenu__all { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--charcoal-t12); }
.sx-cmenu__all a, .sx-cbar__map { color: var(--head); text-decoration: underline; text-decoration-color: var(--charcoal-t40); text-underline-offset: .22em; }
.sx-cmenu__all a:hover, .sx-cbar__map:hover { text-decoration-color: var(--red); }
/* "Show map" / "Hide map": a checkbox and its label, no script. Only below 992 px */
.sx-cbar__map { display: inline-flex; align-items: center; min-height: 2.25rem; cursor: pointer; }
.sx-cbar__hide, .sx-cbar__sw:checked ~ .sx-head__txt .sx-cbar__show { display: none; }
.sx-cbar__sw:checked ~ .sx-head__txt .sx-cbar__hide { display: inline; }
.sx-cbar__sw:focus-visible ~ .sx-head__txt .sx-cbar__map { outline: 2px solid var(--focus); outline-offset: 3px; }

/* the map. Below 992 px: closed until the reader asks for it */
.sx-map { display: none; margin-top: 1.125rem; padding-block: 1.25rem; border-block: 1px solid var(--charcoal-t12); }
.sx-cbar__sw:checked ~ .sx-map { display: block; }
.sx-map__fig { position: relative; width: 100%; max-width: min(30rem, 62vh); }
.sx-map .mp a { cursor: pointer; }
.sx-map__legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .875rem; margin-top: .75rem; font: 400 var(--ts-small)/1.4 var(--f-text); color: var(--ink-3); }
.sx-map__legend b { font-weight: 400; }
.sx-map__legend span { display: inline-flex; align-items: center; gap: .375rem; font-variant-numeric: tabular-nums; }
.sx-map__legend i { width: .75rem; height: .75rem; }
.sx-map__legend .lv0 { background: var(--mp-0); } .sx-map__legend .lv1 { background: var(--mp-1); } .sx-map__legend .lv2 { background: var(--mp-2); }
.sx-map__legend .lv3 { background: var(--mp-3); } .sx-map__legend .lv4 { background: var(--mp-4); }
/* a country's own label: its name and its number of stories, on hover, on a tap and on keyboard focus
   (assets/js/section.js; without the script the browser shows the same words as the link's own tooltip) */
.sx-map__tip { position: absolute; z-index: 5; left: 0; top: 0; pointer-events: none; padding: .3125rem .625rem; background: var(--white); color: var(--charcoal); font: 400 var(--ts-small)/1.25 var(--f-text); white-space: nowrap; box-shadow: 0 6px 18px rgb(0 0 0 / .5); }
.sx-map__tip b { font-weight: 700; }
.sx-map__tip[hidden] { display: none; }

/* from 992 px: two columns, the map always there */
@media (min-width: 62em) {
  .sx-head__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center; }
  .sx-cbar__dot, .sx-cbar__map { display: none; }
  .sx-map, .sx-cbar__sw:checked ~ .sx-map { display: block; margin: 0; padding: 0; border: 0; }
  .sx-map__fig { width: auto; max-width: none; }
  .sx-map .mp { display: block; width: auto; height: 23.75rem; }                       /* 380 px */
  .sx-map__legend { flex-wrap: nowrap; justify-content: center; margin-top: .5rem; white-space: nowrap; }
}

/* ---------------------------------------------------------------- the grid */
.sx-list { padding-block: clamp(1.5rem, 1.2rem + 1.3vw, 2.5rem) clamp(2.75rem, 2rem + 3vw, 4.5rem); }
.sx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 2rem; }
@media (min-width: 40em) { .sx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .sx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 80em) { .sx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* a card: the photograph, the headline, the summary, then the date and the country. Nothing else */
.sx-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding-bottom: 1.125rem; border-bottom: 1px solid var(--charcoal-t12); transition: transform .25s cubic-bezier(.4, 0, .2, 1), border-color .25s; }
.sx-card .ph { flex: none; }
.sx-card .ph img { filter: saturate(.85) contrast(1.05); transition: filter .25s; }
.sx-card__t { --lines: 3; margin-top: .9375rem; font: 800 var(--ts-body)/1.22 var(--f-text); letter-spacing: -.015em; color: var(--head); text-wrap: wrap; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines); line-clamp: var(--lines); overflow: hidden; }      /* the whole headline, on at most three lines */
.sx-card__t a { transition: color .2s; }
.sx-card__t a::after { content: ""; position: absolute; inset: 0; z-index: 1; }                                       /* the whole card opens the story */
.sx-card__s { --lines: 3; margin-top: .5625rem; font: 400 var(--ts-small)/1.5 var(--f-text); color: var(--ink-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines); line-clamp: var(--lines); overflow: hidden; }
/* while the script measures a text (assets/js/section.js) the limit is off for an instant */
.sx-card__t.is-fitting, .sx-card__s.is-fitting { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.sx-card__m { display: flex; flex-wrap: wrap; gap: 0 .5rem; margin-top: auto; padding-top: .875rem; font: 400 var(--ts-small)/1.4 var(--f-text); color: var(--ink-3); }
.sx-card__m span::before { content: "·"; margin-right: .5rem; }
.sx-card:hover { transform: translateY(-4px); border-bottom-color: var(--red); }
.sx-card:hover .sx-card__t a { color: var(--red-t45); }
.sx-card:hover .ph img { filter: saturate(1.05) contrast(1.05); }
.sx-card:focus-within { border-bottom-color: var(--red); }
/* a story without a photograph of its own (or whose photograph is withheld): a card of words. The headline stands
   where the photograph would, one step larger and on up to six lines, under the short red bar of the page title */
.sx-card--text { border-top: 1px solid var(--charcoal-t12); }
.sx-card--text .sx-card__t { --lines: 6; position: relative; margin-top: 0; padding-top: 2.25rem; font-size: var(--ts-sub); line-height: 1.16; letter-spacing: -.02em; }
.sx-card--text .sx-card__t::before { content: ""; position: absolute; left: 0; top: 1.25rem; width: 1.75rem; height: 3px; background: var(--red); }
.sx-card--text .sx-card__s { margin-top: .875rem; }
@media (prefers-reduced-motion: reduce) { .sx-card, .sx-card .ph img { transition: none; } .sx-card:hover { transform: none; } }

/* ---------------------------------------------------------------- the pagination, as on the live site */
.sx-pager { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; margin-top: clamp(2.75rem, 2rem + 3vw, 4rem); }
.sx-pager__n { font: 400 var(--ts-small)/1.4 var(--f-text); color: var(--ink-3); }
.sx-pager__n b { font-weight: 700; color: var(--head); }
.sx-pager ul { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .375rem; padding: .5rem; background: #0C0C0C; border: 1px solid #1F2937; }
.sx-pager li { display: flex; }
.sx-pager a, .sx-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .875rem; border-radius: .75rem; font: 700 var(--ts-small)/1 var(--f-text); font-variant-numeric: tabular-nums; color: var(--ink-3); transition: background .2s, color .2s; }
.sx-pager a:hover { background: #121212; color: var(--white); }
.sx-pager a[aria-current] { background: var(--red); color: var(--white); }
.sx-pager svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sx-pager__arr { padding: 0 .625rem; }
.sx-pager a.sx-pager__arr:hover { color: var(--red-t45); }
.sx-pager .is-off { opacity: .32; }

/* ---------------------------------------------------------------- the pitch band, after the pagination
   "Got a story? Pitch it to us." with its line and its two buttons, as at the bottom of the old Investigations page.
   Section heading and body text of the site's type; a thin line above it, no box */
.sx-pitch { padding-block: clamp(2.5rem, 2rem + 2.5vw, 4rem); border-top: 1px solid var(--charcoal-t12); }
.sx-pitch__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; align-items: center; }
.sx-pitch h2 { max-width: 22ch; font: 800 var(--ts-section)/1.12 var(--f-text); letter-spacing: -.02em; color: var(--head); }
.sx-pitch p { margin-top: .75rem; max-width: 44rem; font: 400 var(--ts-body)/var(--ts-body-lh) var(--f-text); color: var(--ink); }
@media (max-width: 54em) { .sx-pitch__in { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- a phone */
@media (max-width: 39.99em) {
  .sx-cbar__k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }      /* the menu itself says "Choose a country": the line stays one line */
  .sx-cmenu > summary, .sx-cbar__map { min-height: 2.75rem; }
  .sx-cmenu { position: static; }
  .sx-cmenu__panel { left: 0; right: 0; width: auto; }
  .sx-cmenu__panel ul { columns: 2; column-gap: 1.5rem; }
  .sx-cmenu__panel li a { padding: .7rem 0; }
  .sx-pager ul { gap: .125rem; padding: .375rem; }                                    /* the two arrows and up to six numbers on one line of a 390 px screen */
  .sx-pager a, .sx-pager span { min-width: 2.5rem; padding: 0 .25rem; }
}
