/* ==========================================================================
   Francis Davis Millet Institute - the shared list layout

   This is build/research/research.css under a neutral name. Only this
   comment changed, and the five --fdm-listing-* sizes moved to tokens.css.

   Loaded by inc/view-assets.php (handle fdm-lists) after base.css and before
   the view's own stylesheet, on these views:
     research         stacked rows, linked titles          Figma 48:228
     research-single  the tag (the row parts are there if wanted)
     featured         one stacked row with a larger title  Figma 249:626
     sponsors         split rows: heading left, names right Figma 249:712
     videos           rows with a poster beside the text
     search           result rows

   Block: fdm-listing. A row is fdm-listing__item. Everything else is a part
   of a row. Type and colour come from base classes where one exists
   (fdm-tag, fdm-meta, fdm-btn, fdm-link, h2).

     fdm-listing                    the list; use with fdm-container
     fdm-listing__item              a stacked row (--feature, --split)
     fdm-listing__tag--now          gold tag on the current feature
     fdm-listing__title             row title, h2 (--feature is 40px)
     fdm-listing__meta              byline; one <span> per part, no spaces between
     fdm-listing__summary           row text, takes fdm-prose
     fdm-listing__actions           button and "Copy citation" side by side
     fdm-listing__note              italic note under the buttons
     fdm-listing__heading, __body, __names, __empty   parts of a split row
   ========================================================================== */

/* 1. The list ------------------------------------------------------------- */

/* Use with .fdm-container. 72px under the last row. */
.fdm-listing {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--fdm-space-72);
}

/* 2. A stacked row (Research, Featured) ------------------------------------ */

/* 28px above and below, 10px between parts, a rule under every row and
   above the first one. */
.fdm-listing__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fdm-space-10);
  padding-block: var(--fdm-space-28);
  border-bottom: var(--fdm-border);
}

.fdm-listing__item:first-child {
  border-top: var(--fdm-border);
}

/* The current feature opens the Featured page without a rule above it. */
.fdm-listing__item--feature:first-child {
  border-top: 0;
}

/* Tag on the item that is the current feature: gold tint instead of paper. */
.fdm-listing__tag--now {
  background: var(--fdm-gold-tint);
}

/* Row title: h2, 32/115%. On Research it holds a link, which keeps the link
   colour and its underline. */
.fdm-listing__title {
  max-width: var(--fdm-listing-title-max);
}

/* The underline is drawn at the weight Figma gives a 32px Cormorant link
   (1.6px, one pixel lower than the browser default). */
.fdm-listing__title a {
  color: var(--fdm-link);
  text-decoration-thickness: 0.05em;
  text-underline-offset: 1px;
}

.fdm-listing__title a:hover {
  text-decoration-thickness: 0.09em;
}

/* Feature title: 40/115% */
.fdm-listing__title--feature {
  font-size: var(--fdm-fs-40);
  line-height: var(--fdm-lh-40);
}

/* Byline. Use with .fdm-meta. Each part after the first is set off by a
   middle dot with two spaces either side, as drawn. */
.fdm-listing__meta {
  display: flex;
  flex-wrap: wrap;
}

.fdm-listing__meta > * + *::before {
  content: "\00a0\00a0\00b7\00a0\00a0";
}

/* Row text: 18/155% muted, 900px wide. Takes .fdm-prose for editor content. */
.fdm-listing__summary {
  width: 100%;
  max-width: var(--fdm-listing-text-max);
  color: var(--fdm-color-text-muted);
  overflow-wrap: break-word;
}

/* Button and "Copy citation" side by side, 18px apart */
.fdm-listing__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fdm-space-10) var(--fdm-space-18);
}

/* "Copy citation" needs script, so it is hidden without it. */
html:not(.fdm-js) [data-fdm-copy],
html:not(.fdm-js) [data-fdm-copy-from] {
  display: none;
}

/* Italic note under the buttons: 17px on a 22px line, muted */
.fdm-listing__note {
  font-size: var(--fdm-fs-17);
  line-height: var(--fdm-lh-17-menu);
  font-style: italic;
  color: var(--fdm-color-text-muted);
}

/* 3. A split row (Sponsors & Contributors) --------------------------------- */

/* Heading in a 384px column, names beside it; 40px above and below. */
.fdm-listing__item--split {
  flex-direction: row;
  gap: var(--fdm-space-48);
  padding-block: var(--fdm-space-40);
}

.fdm-listing__heading {
  flex: none;
  width: var(--fdm-listing-heading-width);
}

/* Right-hand column: starts 8px lower so the names sit on the heading's
   baseline. 19px on a 28px line. */
.fdm-listing__body {
  flex: 1 1 0;
  min-width: 0;
  padding-top: var(--fdm-space-8);
  font-size: var(--fdm-fs-19);
  line-height: var(--fdm-listing-name-lh);
}

/* Names: three 240px columns at 1440, 32px apart, 14px between lines */
.fdm-listing__names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--fdm-listing-name-min), 100%), 1fr));
  gap: var(--fdm-space-14) var(--fdm-space-32);
}

/* Shown in place of the names while a list has none */
.fdm-listing__empty {
  font-style: italic;
  color: var(--fdm-color-text-muted);
}

/* 4. Phone and tablet ------------------------------------------------------ */

@media (max-width: 1023.98px) {
  /* Split rows stack: heading, then the names across the full width. */
  .fdm-listing__item--split {
    flex-direction: column;
    gap: var(--fdm-space-8);
    padding-block: var(--fdm-space-32);
  }

  .fdm-listing__heading {
    width: auto;
  }

  .fdm-listing__body {
    flex: none;
    width: 100%;
    padding-top: 0;
  }
}

@media (max-width: 599.98px) {
  .fdm-listing {
    padding-bottom: var(--fdm-space-40);
  }

  .fdm-listing__item {
    gap: var(--fdm-space-8);
    padding-block: var(--fdm-space-20);
  }

  /* Row titles and split headings: 24/115% */
  .fdm-listing__title,
  .fdm-listing__heading {
    font-size: var(--fdm-fs-24);
    line-height: var(--fdm-lh-24-heading);
  }

  /* Feature title: 30/115% */
  .fdm-listing__title--feature {
    font-size: var(--fdm-fs-30);
    line-height: var(--fdm-lh-30);
  }

  /* A long byline runs on as ordinary text, so it breaks between words and
     the dot never starts a line. Keep the parts free of spaces between
     their tags, as in the markup. */
  .fdm-listing__meta {
    display: block;
  }

  .fdm-listing__summary {
    font-size: var(--fdm-fs-17);
    line-height: var(--fdm-lh-17);
  }

  .fdm-listing__actions {
    margin-top: var(--fdm-space-4);
  }

  .fdm-listing__note {
    font-size: var(--fdm-fs-16);
  }

  .fdm-listing__item--split {
    gap: var(--fdm-space-8);
    padding-block: var(--fdm-space-24);
  }

  .fdm-listing__body {
    font-size: var(--fdm-fs-18);
  }

  .fdm-listing__names {
    gap: var(--fdm-space-6) var(--fdm-space-20);
  }
}
