/* Press (press.html) and the archive of earlier coverage (news/index.html), on top of core.css and inner.css.
   The announcements ledger is generated by tools/press/build-press.sh; its rows are the shared ledger (.tx, core.css).
   Here: the chapter head with the type filter, the year groups, the logo plates, the closing band and the archive
   rows. Hidden start states exist only under html.motion (and are covered by the failsafe and print rules below). */

/* == CHAPTER HEAD: the title, with the filter beside it on the right from 1200 px (PHASE3 5.2) and under it, on the
   title's column, below that. A tighter head than other chapters, so announcements reach the first screen == */
.px .ch-head { margin-bottom: clamp(24px, 2.2vw, 32px); }
/* the ledger is the page, as the form is on Apply and the article on a release: its chapter starts closer to the
   head than a reading chapter does, and its rows are 4 px slimmer than the homepage's, so three announcements
   (date, title, plate) are in the first screen at 1440 x 900 and two at 1280 x 720 */
.px { padding-top: clamp(36px, 2.8vw, 48px); }
@media (min-width: 768px) { .px .tx { padding-block: 17px; } }
.px-head-in { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(12px, 1.4vw, 20px); }
/* bottom-aligned (with the filter's -9px margin its labels sit on the title's baseline): the row keeps its height
   while the filter's place is reserved and empty */
@media (min-width: 1200px) { .px-head-in { flex-direction: row; align-items: flex-end; justify-content: space-between; column-gap: 32px; } }

/* == TYPE FILTER: toggle buttons (aria-pressed); a navy rule slides to the chosen label. With JS only. == */
.pf { position: relative; display: flex; flex-wrap: wrap; column-gap: clamp(18px, 2vw, 30px); margin-bottom: -9px; }
/* its place is kept from first paint; it shows once js/press.js has switched it on (.is-on), so a script that failed
   never leaves buttons that do nothing. A working filter is never taken away (a core.js failure at load adds
   no-home after press.js has run). When press.js itself fails (no-home, core fine) the place is given back. When
   core.js fails first (no-esg), press.js still runs after it: the place stays reserved, empty, so the filter's
   arrival moves nothing (if press.js fails too, an empty row of that height remains) */
html:not(.js) .pf, .no-home:not(.no-esg) .pf:not(.is-on) { display: none; }
.pf:not(.is-on) { visibility: hidden; }
.no-esg .pf:not(.is-on) { min-height: 44px; }
.no-esg .pf:not(.is-on) > * { display: none; }
@media (max-width: 767px) { .no-esg .pf:not(.is-on) { min-height: 88px; } }
.pf-btn { display: inline-flex; align-items: center; height: 44px; padding: 0; border: 0; background: none; font: 600 12px/1 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--label); cursor: pointer; transition: color .25s var(--ease-ui); }
/* fixed widths (em), at least each label's width in Hanken Grotesk and in its metric fallback (fix1\tools\pfwidths.js):
   the group never moves or rewraps when the web font arrives (CLS 0) */
.pf-btn[data-filter="all"] { width: 2.4em; }
.pf-btn[data-filter="transaction"] { width: 9.4em; }
.pf-btn[data-filter="ocfo"] { width: 7.7em; }
.pf-btn[data-filter="news"] { width: 12.3em; }
.pf-btn:hover, .pf-btn[aria-pressed="true"] { color: var(--navy); }
.pf-btn:focus-visible { outline-offset: 2px; }
.pf-t { display: inline-block; }
/* a 1 px line scaled to the label's width and moved under it by the filter script (transform only) */
.pf-rule { position: absolute; left: 0; top: 7px; width: 1px; height: 1px; background: var(--navy); transform-origin: 0 0; opacity: 0; pointer-events: none; transition: transform .4s var(--ease), opacity .3s; }
.pf.is-on .pf-rule { opacity: 1; }

/* == YEAR GROUPS: the year, a navy rule that draws, then the year's rows == */
.px-year:not([hidden]) ~ .px-year { margin-top: clamp(52px, 5.2vw, 80px); }
.px-y { position: relative; padding-bottom: 8px; font: 300 clamp(22px, 1.7vw, 26px)/1 var(--sans); letter-spacing: -.01em; color: var(--navy); }
.px-y .fig { font-family: inherit; }
.px-y::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--navy); transform-origin: left; transition: transform 1.1s var(--ease) .12s; }
html.motion .px-y[data-r]:not(.in)::after { transform: scaleX(0); }
.px-ledger .tx-list { border-top: 0; }

/* rows the filter keeps re-run a short stagger (opacity and an 8 px rise, 40 ms apart, eight steps at most) */
@keyframes pfIn { from { opacity: 0; transform: translateY(8px); } }
html.motion .px-ledger li.pf-in { animation: pfIn .5s var(--ease) calc(var(--k, 0) * 40ms) both; }

/* == ROWS: the type (or source) stays visible below 1200 px, under the date == */
@media (min-width: 768px) and (max-width: 1199px) {
  .px .tx { grid-template-columns: 8.5rem minmax(0, 1fr) 10rem 22px; grid-template-areas: "date title logo arrow" "cat title logo arrow"; row-gap: 3px; }
  .px .tx-date { grid-area: date; align-self: end; }
  .px .tx-cat { display: block; grid-area: cat; align-self: start; }
  .px .tx-title { grid-area: title; }
  .px .tx-logo { grid-area: logo; }
  .px .tx-arrow { grid-area: arrow; }
}
@media (max-width: 767px) {
  .px .tx { grid-template-areas: "date arrow" "cat arrow" "title arrow" "logo arrow"; }
  .px .tx-cat { display: block; grid-area: cat; margin-top: -7px; }
}

/* == LOGO PLATES: the ledger's white plate, two columns wide here so a sponsor and its company fit side by side.
   Sizes come from the generator (--h: desktop px); --ps scales them on narrower plates. == */
.px .tx-logo { --ps: 1; overflow: hidden; }
@media (min-width: 1200px) { .px .tx-logo { justify-self: stretch; width: auto; } }
@media (max-width: 1359px) { .px .tx-logo { --ps: .85; } }
/* a long wordmark is capped at 120 px, so single marks sit in one optical range (MIN-09) */
.px .tx-logo > img { max-width: min(100%, 120px); }
.px .tx-logo img[style*="--h"] { width: auto; height: calc(var(--h) * var(--ps) * 1px); max-width: 100%; max-height: none; min-width: 0; object-fit: contain; }
/* sponsor and company side by side, or sponsor over company (two long wordmarks) */
.tx-logo--pair { gap: 10px; }
.tx-logo-rule { flex: none; width: 1px; height: 24px; background: var(--rule); }
.px .tx-logo--col { flex-direction: column; gap: 4px; padding-block: 6px; }
.tx-logo--col .tx-logo-rule { width: 22px; height: 1px; }
/* a sponsor's mark cut from its client-wall tile (a window onto the tile's centre) */
.tx-cut { flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; width: calc(var(--bw) * var(--ps) * 1px); height: calc(var(--bh) * var(--ps) * 1px); }
.px .tx-cut img { flex: none; width: auto; height: calc(var(--ih) * var(--ps) * 1px); max-width: none; max-height: none; }
/* a podcast: the featured partner's round portrait, cut from the episode artwork */
.px .tx-logo--art { position: relative; }
.px .tx-logo--art img { position: absolute; left: 50%; top: 50%; width: auto; height: calc(var(--z) * 100%); max-width: none; max-height: none;
  transform: translate(calc(var(--x) * -1), calc(var(--y) * -1)); clip-path: circle(var(--r) at var(--x) var(--y)); }
/* artwork shown whole on its own edge colour (the archive's HBR episode) */
.px .tx-logo--whole { padding: 0; }
.px .tx-logo--whole img { width: auto; height: 100%; max-width: none; max-height: none; }
/* a mark set on a large sheet or tile: --z times the plate's height, cropped to its centre */
.px .tx-logo--crop img { flex: none; width: auto; height: calc(var(--z) * 100%); max-width: none; max-height: none; }
@media (max-width: 767px) {
  .px .tx-logo { --ps: .8; }
  .px .tx-logo--pair { flex-direction: row; gap: 8px; width: auto; min-width: 96px; }
  .px .tx-logo--pair .tx-logo-rule { width: 1px; height: 18px; }
}

/* == EARLIER PRESS COVERAGE: one row in the ledger's grammar, on stone (navigation to the archive) == */
.px-more { padding-block: clamp(44px, 4.6vw, 72px); }
.px-more-link { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; padding: clamp(20px, 2vw, 28px) 0; border-block: 1px solid var(--stone-rule); color: var(--navy); text-decoration: none; }
.px-more-link::before { content: ""; position: absolute; top: 0; bottom: 0; left: -20px; right: -20px; z-index: -1; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.px-more-link:hover::before, .px-more-link:focus-visible::before { transform: none; }
.px-more-link:focus-visible { outline-offset: -2px; }
.px-more-t { grid-column: 4 / span 8; font: 400 var(--t-d2)/1.15 var(--serif); letter-spacing: -.01em; transition: transform .6s var(--ease); }
.px-more-link:hover .px-more-t, .px-more-link:focus-visible .px-more-t { transform: translateX(14px); }
.px-more-arrow { grid-column: 12; justify-self: end; width: 22px; height: 22px; fill: none; stroke: var(--navy); stroke-width: 1.5; transition: transform .35s var(--ease-ui); }
.px-more-link:hover .px-more-arrow, .px-more-link:focus-visible .px-more-arrow { transform: translateX(6px); }
@media (max-width: 1199px) { .px-more-t { grid-column: 1 / span 11; } }
@media (max-width: 767px) {
  .px-more-link { grid-template-columns: minmax(0, 1fr) 22px; column-gap: 12px; padding: 18px 0; }
  .px-more-link::before { left: -12px; right: -12px; }
  .px-more-t { grid-column: 1; font-size: 24px; }
  .px-more-arrow { grid-column: 2; }
}

/* == ARCHIVE (news/index.html): external links, and three items with no link == */
.tx--ext:hover .tx-arrow, .tx--ext:focus-visible .tx-arrow { transform: translate(4px, -4px); }
.tx--plain::before { display: none; }
/* the one item with no date: its source takes the date's place */
@media (min-width: 768px) { .px .tx--nodate .tx-cat { grid-row: 1 / 3; grid-column: 1 / 4; align-self: center; } }
@media (min-width: 768px) and (max-width: 1199px) { .px .tx--nodate .tx-cat { grid-column: 1; } }
@media (max-width: 767px) { .px .tx--nodate .tx-cat { margin-top: -10px; } }
.px .reg { font-size: .62em; vertical-align: .55em; line-height: 0; }
.px--archive .tx-list { border-top-color: var(--navy); }

/* -- phones: the filter as two tidy rows of two (it wraps freely below 360 px) -- */
@media (max-width: 767px) {
  .px-head-in { row-gap: 10px; }
  .pf { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 16px; margin-bottom: -6px; }
  .pf-btn { font-size: 11px; letter-spacing: .1em; }
  .pf-btn[data-filter="all"] { width: 2.25em; }
  .pf-btn[data-filter="transaction"] { width: 8.8em; }
  .pf-btn[data-filter="ocfo"] { width: 7.2em; }
  .pf-btn[data-filter="news"] { width: 11.45em; }
}
@media (max-width: 359px) { .pf { display: flex; } }

/* -- failsafe: the year rule is hidden deeper than [data-r], so it gets the core failsafe too -- */
html.motion:not(.ready) .px-y::after { animation: esg-failsafe .01s 2.5s forwards; }

/* -- forced colours: the chosen type is underlined; the year rules keep a system colour (core.css keeps the logo
   plates white) -- */
@media (forced-colors: active) {
  .pf-rule, .px-more-link::before { display: none; }
  .pf-btn[aria-pressed="true"] .pf-t { text-decoration: underline 2px; text-underline-offset: 6px; }
  .px-y::after { forced-color-adjust: none; background: CanvasText; }
  .px-more-arrow { stroke: currentColor; }
}

/* -- print: every row as it stands, no controls -- */
@media print {
  .pf { display: none !important; }
  .px-y::after { transform: none !important; }
  html.motion .px-ledger li { opacity: 1 !important; transform: none !important; }
  .px-more { padding-block: 16px; }
  .px-more-link::before, .px-more-arrow { display: none; }
}
