/* themes/alder/css/alder-wide.css
   Education site, the desktop width rule (Eric, 11-09: "columns across the
   site are full width"). From 1024px no page section sits in a narrow
   column with the other half empty: the other column is filled with what
   belongs beside it, the title's lede or a render. A blog post is the
   exception by request (Eric, 11-16): one 50rem column on the logo's line,
   the author at its foot, all in alder-article.css. Card grids run three
   or four across. Phones keep one column: nothing below 1024px changes
   except the article date plate (all widths) and the Ask art, which phones
   never show or fetch.

   Linked last, education mode only, from partials/_shell-head.tpl.php, so
   it wins ties against the page sheets it adjusts: alder-article.css (the
   content hero, a post, the blog index), alder-profile.css (the partner
   page), alder-utility.css (404), alder-ask.css (the Ask opening) and
   alder.css (article cards). It must never set a width on a phone. */

/* Article cards without a picture: a sand date plate in place of the shared
   green notebook tile, so a missing image reads as a choice, and no two
   plates in a grid look the same. partials/_article-card.tpl.php. */
.al-post__plate {
  position: absolute; inset: 0; display: grid; align-content: end; gap: 2px;
  padding: 18px 20px; background: var(--al-sand-2); color: var(--al-ink);
}
.al-post__plate::before { content: ""; width: 28px; height: 3px; margin-bottom: 10px; border-radius: 2px; background: var(--al-moss); }
.al-post__plate-d { font: 800 clamp(44px, 9vw, 64px)/.9 var(--al-display); letter-spacing: -.04em; }
.al-post__plate-m { font: italic 400 16px/1.3 var(--al-serif); color: var(--al-moss); }
.al-post--row .al-post__plate { gap: 0; padding: 10px; }
.al-post--row .al-post__plate::before { display: none; }
.al-post--row .al-post__plate-d { font-size: 26px; }
.al-post--row .al-post__plate-m { font-size: 11px; }
/* Phones: a full card's plate was a tall blank block above the title, so it
   folds to one short date strip (Hal's Articles gate, 11-11). */
@media (max-width: 639px) {
  .al-post:not(.al-post--row):not(.al-post--lead) > .al-post__pic:has(> .al-post__plate) { aspect-ratio: auto; }
  .al-post:not(.al-post--row):not(.al-post--lead) .al-post__plate {
    position: static; display: flex; align-items: baseline; gap: 8px; padding: 12px 16px;
  }
  .al-post:not(.al-post--row):not(.al-post--lead) .al-post__plate::before { display: none; }
  .al-post:not(.al-post--row):not(.al-post--lead) .al-post__plate-d { font-size: 28px; }
}

/* A post without a picture: its header is a sand band (every width). */
.al-chead--band { margin-bottom: 36px; padding: 28px 0 40px; background: var(--al-sand); }
.al-chead--band .al-crumbs { margin-bottom: 20px; }

/* The Ask opening art: no box on a phone, so a lazy image is never fetched. */
.al-ask__art { display: none; }

/* 404 quick links: one column per tile (three on this site), not four
   slots with one left empty. */
@media (min-width: 640px) { .al-err__tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

@media (min-width: 1024px) {
  /* Content hero, the wide sizes (the blog index) and the no-picture band:
     title in the left column, lede, meta and actions in the right, all
     sitting on the same bottom line. Crumbs and eyebrow run across. The
     lede's row is the flexible one, so the right column stacks tight and
     meets the title's last line whichever side is taller. */
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    column-gap: 64px; align-items: end;
  }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-crumbs { grid-column: 1 / -1; grid-row: 1; align-self: start; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-chead__eyebrow { grid-column: 1 / -1; grid-row: 2; align-self: start; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > :is(.al-chead__h, .al-chead__row) { grid-column: 1; grid-row: 3 / span 4; max-width: none; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-chead__lede { grid-column: 2; grid-row: 3; margin-top: 0; max-width: none; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-chead__meta { grid-column: 2; grid-row: 4; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-chead__actions { grid-column: 2; grid-row: 5; }
  :is(.al-chead--wide, .al-chead--xwide, .al-chead--band) .al-chead__wrap > .al-chead__extras { grid-column: 2; grid-row: 6; }
  .al-chead--band .al-chead__h { font-size: clamp(2.25rem, 4.2vw, 3.25rem); }
  .al-chead--band { padding: 40px 0 56px; }
}

@media (min-width: 1440px) {
  /* Partner page: the Details rail sits beside About only; the articles
     and apps rows below run the full width. */
  .al-pg--partner .al-pgrid { grid-template-rows: auto auto; }
  .al-pg--partner .al-pbody > .al-pgrid > .al-rail { grid-row: 1; }
  .al-pg--partner .al-pcol--rest { grid-column: 1 / -1; }

  /* Ask, the opening: copy and starter questions left, the render right,
     wider than the chat column, centred on it. The column itself (and so
     every message and the composer) keeps its measure. */
  .al-ask__app[data-mode="page"] .al-ask__empty {
    --w: min(1080px, 100vw - 2 * var(--al-gutter, 20px));
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); column-gap: 56px; align-items: center;
    width: var(--w); margin: auto calc((100% - var(--w)) / 2); text-align: left;
  }
  .al-ask__app[data-mode="page"] .al-ask__empty > :not(.al-ask__art) { grid-column: 1; }
  .al-ask__app[data-mode="page"] .al-ask__lede { margin-inline: 0; }
  .al-ask__app[data-mode="page"] .al-ask__starts { justify-content: flex-start; }
  .al-ask__app[data-mode="page"] .al-ask__art { display: block; grid-column: 2; grid-row: 1 / span 4; width: 100%; height: auto; }
}
