/* Research index, from references/redesign-2026-10/final/Research.dc.html */

/* Hero: the line, the digest explainer's launcher and the four-step figure */
.research-hero {
  position: relative;
  background: var(--bl-field);
}

.research-hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 48px;
  background: linear-gradient(to bottom, rgba(238, 234, 228, 0), var(--bl-page));
  pointer-events: none;
}

.research-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6vw;
  row-gap: 64px;
  padding: clamp(48px, 5vw, 96px) 5.5% 48px max(20px, 8.5%);
}

/* The column grows with the heading past 1440px, so it breaks as it does there. */
.research-hero__text {
  flex: 1 1 300px;
  max-width: max(25em, min(27.78vw, 584px));
}

.research-hero h1 {
  max-width: 11em;
  font-size: clamp(28px, 2.474vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.research-hero__line {
  max-width: 20em;
  margin-top: 1.4em;
  font-size: clamp(17px, 1.302vw, 27px);
  line-height: 1.4;
  text-wrap: pretty;
}

.research-hero__launch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 28px;
}

.research-hero__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 32px;
  margin-top: 16px;
  font-size: clamp(15px, 1.042vw, 21px);
}

.research-hero__link,
.research-hero__quiet {
  display: inline-flex;
  align-items: center;
  gap: .8em;
  min-height: 44px;
}

.research-hero__link svg {
  flex: none;
  width: 1.05em;
  height: .62em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}

.research-hero__quiet,
.research-hero__quiet:hover {
  color: var(--bl-muted);
}

.digest-button {
  gap: 16px;
}

/* The launcher's small icon: the four stages, cycling slowly */
.digest-icon {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
}

.digest-icon > span {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: 4s linear infinite;
}

.digest-icon__grid {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-auto-rows: 5px;
  gap: 2.5px;
}

.digest-icon__grid i {
  box-shadow: inset 0 0 0 1px var(--bl-ink-on);
}

.digest-icon__grid i.on {
  background: var(--bl-ink-on);
}

.digest-icon .f1 { animation-name: bl-f1; }
.digest-icon .f2 { animation-name: bl-f2; }
.digest-icon .f3 { animation-name: bl-f3; }

.digest-icon .f4 {
  opacity: 1;
  animation-name: bl-f4;
}

.digest-icon__sheet {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 14px;
  height: 18px;
  border: 1px solid var(--bl-ink-on);
}

.digest-icon__sheet::before,
.digest-icon__sheet::after {
  content: '';
  position: absolute;
  left: 3px;
  height: 1px;
  background: var(--bl-ink-on);
}

.digest-icon__sheet::before {
  top: 4px;
  width: 7px;
}

.digest-icon__sheet::after {
  top: 7px;
  width: 5px;
}

@keyframes bl-f1 { 0% { opacity: 0; } 5% { opacity: 1; } 20% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; } }
@keyframes bl-f2 { 0%, 20% { opacity: 0; } 25% { opacity: 1; } 40% { opacity: 1; } 45% { opacity: 0; } 100% { opacity: 0; } }
@keyframes bl-f3 { 0%, 40% { opacity: 0; } 45% { opacity: 1; } 60% { opacity: 1; } 65% { opacity: 0; } 100% { opacity: 0; } }
@keyframes bl-f4 { 0% { opacity: 1; } 5% { opacity: 0; } 60% { opacity: 0; } 65% { opacity: 1; } 100% { opacity: 1; } }

/* The figure: a grid of sheets that thins out until one page is left */
.digest-flow {
  flex: 1.75 1 520px;
  max-width: 1240px;
  min-width: 0;
  margin: 0;
}

.digest-flow .subhead {
  text-wrap: balance;
  margin-bottom: clamp(28px, 2.6vw, 44px);
}

.digest-flow__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px clamp(20px, 2.2vw, 36px);
}

.digest-flow__picture {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 25;
}

.digest-flow__picture--page {
  justify-content: center;
}

.digest-flow__sheets {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.digest-flow__sheets i {
  aspect-ratio: 3 / 4;
}

.digest-flow__sheets.is-found i { background: #d3cac2; }
.digest-flow__sheets.is-examined i { box-shadow: inset 0 0 0 1px #d9d0c8; }
.digest-flow__sheets.is-examined i.is-kept { background: #8f847b; box-shadow: none; }
.digest-flow__sheets.is-selected i { box-shadow: inset 0 0 0 1px #ddd5cd; }
.digest-flow__sheets.is-selected i.is-chosen { background: var(--bl-ink); box-shadow: none; }

.digest-flow__page {
  display: flex;
  flex-direction: column;
  gap: 7%;
  width: 82%;
  aspect-ratio: 3 / 4;
  padding: 12% 11%;
  background: var(--bl-paper);
  box-shadow: inset 0 0 0 1px var(--bl-rule-light);
}

.digest-flow__bars,
.digest-flow__lines {
  display: flex;
  flex-direction: column;
}

.digest-flow__bars {
  gap: 6px;
}

.digest-flow__bars i {
  height: 6px;
  background: var(--bl-ink);
}

.digest-flow__lines {
  gap: 5px;
}

.digest-flow__bars + .digest-flow__lines {
  margin-top: 6%;
}

.digest-flow__lines i {
  height: 3px;
  background: #cfc6be;
}

.digest-flow__link {
  width: 38%;
  height: 3px;
  margin-top: auto;
  background: var(--bl-accent);
}

.digest-flow__words {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--bl-rule);
}

.digest-flow__number {
  color: var(--bl-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
}

.digest-flow__words h3 {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.digest-flow__words p + p,
.digest-flow__words h3 + p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.research-hero .text-version {
  margin-top: 0;
}

/* Latest digests: two large 3:2 cards */
.research-latest {
  padding: calc(clamp(112px, 10vw, 184px) - 48px) var(--bl-side) 0;
}

.research-latest__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(360px, calc((100% - 5vw) / 2))), 1fr));
  gap: clamp(64px, 6vw, 104px) 5vw;
  margin-top: clamp(28px, 3vw, 48px);
}

.research-tile__art {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
}

/* The square crop is the drawing's centre panel. */
.research-tile__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.research-tile__art:hover {
  text-decoration: none;
}

.research-tile__meta a,
.research-row__meta a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--bl-underline);
  text-underline-offset: .25em;
  overflow-wrap: anywhere;
}

/* More recent digests: square tiles */
.research-more {
  padding: clamp(112px, 10vw, 184px) var(--bl-side) 0;
}

.research-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(48px, 5.5vw, 88px) clamp(16px, 4vw, 64px);
}

.research-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.research-tile__title {
  margin-top: 18px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  text-wrap: balance;
}

.research-tile__meta {
  margin-top: 8px;
  color: var(--bl-muted);
  font-size: 14px;
  line-height: 1.5;
}

.research-tile__meta span {
  display: block;
}

.research-tile__meta a,
.research-row__meta a {
  color: var(--bl-muted);
  text-decoration-color: var(--bl-outline);
}

/* Dive deeper: the rest, one per row */
.research-all {
  padding: clamp(112px, 10vw, 184px) var(--bl-side) 0;
}

.research-all__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bl-ink);
}

/* A rabbit looks out of its hole beside "Dive deeper", drawn in the homepage
   cat's line. The hole sits on the rule under the heading: the head's 20px
   padding, plus 6 of the drawing's 64 units, plus half the rule, below the
   heading's bottom edge. */
.research-all__head h2 {
  position: relative;
}

.rabbit-hole {
  position: absolute;
  bottom: calc(-20px - 2.4em * 6 / 64 - .5px);
  left: 100%;
  width: auto;
  height: 2.4em;
  margin-left: 0;
  overflow: visible;
  fill: none;
  stroke: var(--bl-ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rabbit-hole .rabbit-hole__fur {
  fill: var(--bl-page);
}

/* Now and then the rabbit ducks into its hole and looks out again, as if
   asking you to follow. It holds still for readers who ask for less motion. */
.rabbit-hole__bunny {
  animation: rabbit-hole-dive 8s cubic-bezier(.45, 0, .35, 1) infinite;
}

@keyframes rabbit-hole-dive {
  0%, 52% { transform: translateY(0); }
  64%, 74% { transform: translateY(60px); }
  86% { transform: translateY(-1.5px); }
  92%, 100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rabbit-hole__bunny {
    animation: none;
  }
}

.rabbit-hole .rabbit-hole__dark,
.rabbit-hole .rabbit-hole__ink {
  fill: var(--bl-ink);
  stroke: none;
}

.research-all__count {
  color: var(--bl-muted);
  font-size: 15px;
}

.research-row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4vw;
  row-gap: 8px;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--bl-rule);
}

.research-row[hidden] {
  display: none;
}

.research-row__meta {
  flex: 0 1 22%;
  min-width: 9em;
  padding-top: .3em;
  color: var(--bl-muted);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.research-row__meta time {
  display: block;
}

.research-row__words {
  flex: 1 1 28em;
  min-width: 0;
  max-width: 46em;
}

.research-row__title {
  font-size: clamp(19px, 1.43vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  text-wrap: pretty;
}

.research-row__summary {
  max-width: 40em;
  margin-top: 10px;
  color: var(--bl-muted);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

.research-all__more {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4vw;
  row-gap: 12px;
  padding-top: 32px;
}

.research-all__more > span {
  flex: 0 1 22%;
  min-width: 9em;
}

.research-all__more > div {
  display: flex;
  flex: 1 1 28em;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.research-all__more .button-outline {
  padding: 0 22px;
}

.research-all__more .button-outline[hidden] {
  display: none;
}

.research-all__shown {
  color: var(--bl-muted);
  font-size: 14px;
}

@media (max-width: 759px) {
  .digest-flow__steps,
  .research-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* On wider screens the hero starts closer to the header: half the space it
   had. Short screens, most laptops among them, also tighten the space under
   the figure's title, so the four steps' words fit the first screen. */
@media (min-width: 760px) {
  .research-hero__inner {
    padding-top: clamp(28px, 2.5vw, 48px);
  }
}

@media (min-width: 760px) and (max-height: 760px) {
  .digest-flow .subhead {
    margin-bottom: 20px;
  }
}

/* Between 960 and 1080 wide the figure's full basis would push it under the
   text by a pixel or two; a smaller one keeps the two side by side. */
@media (min-width: 960px) and (max-width: 1079px) {
  .digest-flow {
    flex-basis: 440px;
  }
}

/* Tablets: two tiles across, as on phones; five across leaves them 112px wide. */
@media (min-width: 760px) and (max-width: 1023px) {
  .research-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .digest-icon > span,
  .digest-icon .f4 {
    animation: none;
  }

  .digest-icon .f4 {
    opacity: 1;
  }

  .digest-icon .f1,
  .digest-icon .f2,
  .digest-icon .f3 {
    display: none;
  }
}
