/* ==========================================================================
   Francis Davis Millet Institute - Home page (view "home", front-page.php)
   Figma: "Page 1 · Home" (44:48, 1440 wide) and "Phone 1 · Home" (49:324).
   Loaded after tokens.css and base.css. Desktop first, then the two
   max-width overrides.

   Copy of build/home/home.css. Changed for the theme: the rule that hid the
   tail of the Figma sample title on phones is gone, because the band now
   prints the feature's real title, which has no tail to hide. After the
   client's review of the prototype: the years in the title are smaller
   than the name, and the task cards take the colour of the Featured band.

   Contents
    1. Page measures      3. Task cards
    2. Hero               4. Featured band
   ========================================================================== */

/* 1. Page measures ---------------------------------------------------------- */

/* Sizes drawn in the Home frames that have no token in base/tokens.css. */
.fdm-home {
  --fdm-home-title-measure: 9.375em;          /* 600px at the 64px title: the dates sit on line two */
  --fdm-home-dates-size: 0.55em;              /* the years at 55% of the name: 35px at 64px, 20px at 36px */
  --fdm-home-welcome-measure: 640px;          /* welcome text */
  --fdm-home-portrait-width: 402px;           /* hero photograph */
  --fdm-home-portrait-ratio: 402 / 516;
  --fdm-home-columns: minmax(0, 742fr) minmax(0, 402fr);   /* 742 + 72 + 402 = 1216 */
  --fdm-home-column-gap: clamp(var(--fdm-space-40), 5vw, var(--fdm-space-72));   /* 72px at 1440 */
  --fdm-home-icon-size: 36px;                 /* card icon: 32 grid at 36px */
  --fdm-home-feature-measure: 720px;          /* featured text column */
  --fdm-home-feature-text-measure: 660px;     /* featured paragraph */
  --fdm-home-feature-image-width: 344px;
  --fdm-home-feature-image-ratio: 344 / 240;
  --fdm-home-lh-16-card: 23px;                /* 16 / 145%, phone card text */
}

/* 2. Hero ------------------------------------------------------------------- */

/* 80px above, 72px below; text 742 wide, photograph 402 wide, centred on
   each other. */
.fdm-home__hero-inner {
  display: grid;
  grid-template-columns: var(--fdm-home-columns);
  column-gap: var(--fdm-home-column-gap);
  align-items: center;
  padding-top: var(--fdm-space-80);
  padding-bottom: var(--fdm-space-72);
}

.fdm-home__hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--fdm-space-22);
  min-width: 0;
}

.fdm-home__title {
  max-width: var(--fdm-home-title-measure);
}

/* The years never split at the dash. Smaller and lighter than the name, so
   the name leads (client request); line-height 1 keeps the smaller text
   from making its line taller. */
.fdm-home__dates {
  font-size: var(--fdm-home-dates-size);
  font-weight: var(--fdm-weight-regular);
  line-height: 1;
  white-space: nowrap;
}

/* Two paragraphs from the editor, 14px apart. */
.fdm-home__welcome {
  max-width: var(--fdm-home-welcome-measure);
}

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

.fdm-home__portrait {
  display: flex;
  flex-direction: column;
  gap: var(--fdm-space-10);
  min-width: 0;
}

/* 402 x 516 at 1440, 350 x 449 at 390. The photograph has these proportions,
   so nothing is cut off; another picture would be fitted to the same frame. */
.fdm-home__portrait-image {
  width: 100%;
  height: auto;
  aspect-ratio: var(--fdm-home-portrait-ratio);
  object-fit: cover;
  border-radius: var(--fdm-radius-image);
}

/* 3. Task cards ------------------------------------------------------------- */

.fdm-home__tasks {
  padding-bottom: var(--fdm-space-80);
}

/* Three cards, 24px apart. Each card is as tall as its own text, as drawn. */
.fdm-home__task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--fdm-space-24);
  align-items: start;
}

/* The cards take the colour of the Featured band below them (.fdm-band),
   at the client's request; border, radius and icon stay as drawn. */
.fdm-home__task {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fdm-space-14);
  background: var(--fdm-color-surface-alt);
}

.fdm-home__task-icon {
  width: var(--fdm-home-icon-size);
  height: var(--fdm-home-icon-size);
  color: var(--fdm-green-900);
}

.fdm-home__task-text {
  font-size: var(--fdm-fs-18);
  line-height: var(--fdm-lh-18-ui);
  color: var(--fdm-color-text-muted);
}

/* The link's hit area covers the whole card. */
.fdm-home__task-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--fdm-radius-card);
}

/* 4. Featured band ---------------------------------------------------------- */

/* 56px above and below; text column 720 wide, 48px gap, picture 344 x 240. */
.fdm-home__feature-inner {
  display: flex;
  align-items: center;
  gap: var(--fdm-space-48);
  padding-top: var(--fdm-space-56);
  padding-bottom: var(--fdm-space-56);
}

.fdm-home__feature-body {
  display: flex;
  flex: 0 1 var(--fdm-home-feature-measure);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fdm-space-14);
  min-width: 0;
}

.fdm-home__feature-title {
  font-size: var(--fdm-fs-38);
  line-height: var(--fdm-lh-38);
}

.fdm-home__feature-text {
  max-width: var(--fdm-home-feature-text-measure);
  color: var(--fdm-color-text-muted);
}

/* The frame crops the picture to 344 x 240. */
.fdm-home__feature-image {
  flex: none;
  width: var(--fdm-home-feature-image-width);
  height: auto;
  aspect-ratio: var(--fdm-home-feature-image-ratio);
  object-fit: cover;
  border-radius: var(--fdm-radius-image);
}

/* Phone and tablet ---------------------------------------------------------- */

@media (max-width: 1023.98px) {
  /* One column: title, welcome text, photograph, caption. */
  .fdm-home__hero-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--fdm-space-32);
    padding-top: var(--fdm-space-56);
    padding-bottom: var(--fdm-space-56);
  }

  .fdm-home__portrait {
    max-width: var(--fdm-home-portrait-width);
  }

  .fdm-home__tasks {
    padding-bottom: var(--fdm-space-56);
  }

  .fdm-home__task-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--fdm-space-16);
  }

  .fdm-home__feature-inner {
    gap: var(--fdm-space-32);
    padding-top: var(--fdm-space-40);
    padding-bottom: var(--fdm-space-40);
  }

  .fdm-home__feature-body {
    flex: 1 1 0;
  }

  .fdm-home__feature-image {
    width: 36%;
  }
}

/* Phone --------------------------------------------------------------------- */

@media (max-width: 599.98px) {
  /* 32px above and below, 16px between title, text, photograph and caption. */
  .fdm-home__hero-inner {
    row-gap: var(--fdm-space-16);
    padding-top: var(--fdm-space-32);
    padding-bottom: var(--fdm-space-32);
  }

  .fdm-home__hero-text {
    gap: var(--fdm-space-16);
  }

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

  .fdm-home__portrait {
    gap: var(--fdm-space-16);
    max-width: none;
  }

  .fdm-home__tasks {
    padding-bottom: var(--fdm-space-32);
  }

  .fdm-home__task-list {
    gap: var(--fdm-space-12);
  }

  /* Short card: heading and one line. The card itself is the link. */
  .fdm-home__task {
    gap: var(--fdm-space-6);
  }

  .fdm-home__task-icon,
  .fdm-home__task-more {
    display: none;
  }

  .fdm-home__task-text {
    font-size: var(--fdm-fs-16);
    line-height: var(--fdm-home-lh-16-card);
  }

  /* The link text stays for screen readers and the focus ring surrounds the
     card. */
  .fdm-home__task-link {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--fdm-radius-card);
    text-indent: -200vw;
    white-space: nowrap;
  }

  /* Label, title and button only. */
  .fdm-home__feature-inner {
    padding-top: var(--fdm-space-28);
    padding-bottom: var(--fdm-space-28);
  }

  .fdm-home__feature-body {
    gap: var(--fdm-space-12);
  }

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

  .fdm-home__feature-text,
  .fdm-home__feature-image {
    display: none;
  }
}
