/* ==========================================================================
   Francis Davis Millet Institute - the "default" view
   Requires tokens.css and base.css. Loaded when fdm_current_view() answers
   "default": a page without a designed template (page.php), "Page not
   found" (404.php) and the fallback list (index.php).

   Figma draws none of the three. They follow the research article frame
   (267:605): the page head, a rule, then text in a 760px reading column.

   Contents
    1. A plain page (page.php)       3. Fallback list (index.php)
    2. Page not found (404.php)      4. Phone
   ========================================================================== */

/* 1. A plain page ---------------------------------------------------------- */

/* Sizes used only here; the reading width is --fdm-measure-reading. */
.fdm-page {
  --fdm-page-lh: 32px;          /* 20 / 160% */
  --fdm-page-lh-phone: 29px;    /* 18 / 160% */
}

.fdm-page__title {
  max-width: var(--fdm-listing-title-max);
  overflow-wrap: break-word;
}

.fdm-page__wrap {
  padding-bottom: var(--fdm-space-72);
}

/* A rule above and below; 40px over the text, 48px under it. */
.fdm-page__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fdm-space-28);
  padding-block: var(--fdm-space-40) var(--fdm-space-48);
  border-block: var(--fdm-border);
}

/* Reading column: Crimson Text 20/160%, 760px wide, 18px between paragraphs */
.fdm-page__text {
  width: 100%;
  max-width: var(--fdm-measure-reading);
  font-size: var(--fdm-fs-20);
  line-height: var(--fdm-page-lh);
  color: var(--fdm-ink);
  overflow-wrap: break-word;
}

.fdm-page__text > * + * {
  margin-top: var(--fdm-space-18);
}

.fdm-page__text > * + :is(h2, h3, h4) {
  margin-top: var(--fdm-space-36);
}

/* A table or a wide embed scrolls inside the column instead of widening the page. */
.fdm-page__text > table {
  display: block;
  overflow-x: auto;
}

/* "Pages: 1 2 3" of a text split with the editor's page break */
.fdm-page__pages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fdm-space-12);
  font-size: var(--fdm-fs-17);
  line-height: var(--fdm-lh-17);
}

/* 2. Page not found -------------------------------------------------------- */

.fdm-notfound {
  padding-bottom: var(--fdm-space-72);
}

/* A rule above and below, as on a plain page; the search form, then the links. */
.fdm-notfound__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fdm-space-24);
  padding-block: var(--fdm-space-40) var(--fdm-space-48);
  border-block: var(--fdm-border);
}

.fdm-notfound__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fdm-space-8) var(--fdm-space-24);
}

/* 3. Fallback list --------------------------------------------------------- */

/* The rows look like the Research list: 28px above and below, 10px between
   the parts, a rule under every row and above the first. (lists.css is not
   loaded on this view, so the few rules are repeated under their own names.) */
.fdm-archive {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--fdm-space-72);
}

.fdm-archive__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-archive__item:first-child {
  border-top: var(--fdm-border);
}

.fdm-archive__title {
  max-width: var(--fdm-listing-title-max);
  overflow-wrap: break-word;
}

.fdm-archive__title a {
  color: var(--fdm-link);
  text-decoration-thickness: 0.05em;
  text-underline-offset: 1px;
}

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

.fdm-archive__summary {
  width: 100%;
  max-width: var(--fdm-listing-text-max);
  color: var(--fdm-color-text-muted);
  overflow-wrap: break-word;
}

.fdm-archive__empty {
  padding-block: var(--fdm-space-28);
  border-block: var(--fdm-border);
  color: var(--fdm-color-text-muted);
}

/* WordPress's own page links under a long list (the_posts_pagination()). */
.fdm-archive .pagination {
  padding-top: var(--fdm-space-28);
}

.fdm-archive .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fdm-space-8) var(--fdm-space-18);
  font-size: var(--fdm-fs-17);
  line-height: var(--fdm-lh-17);
}

.fdm-archive .page-numbers.current {
  font-weight: var(--fdm-weight-semibold);
  color: var(--fdm-color-heading);
}

/* 4. Phone ----------------------------------------------------------------- */

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

  .fdm-page__body,
  .fdm-notfound__body {
    gap: var(--fdm-space-20);
    padding-block: var(--fdm-space-24) var(--fdm-space-32);
  }

  .fdm-page__text {
    font-size: var(--fdm-fs-18);
    line-height: var(--fdm-page-lh-phone);
  }

  .fdm-page__text > * + * {
    margin-top: var(--fdm-space-16);
  }

  .fdm-page__text > * + :is(h2, h3, h4) {
    margin-top: var(--fdm-space-28);
  }

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

  .fdm-archive__title {
    font-size: var(--fdm-fs-24);
    line-height: var(--fdm-lh-24-heading);
  }

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