/*
 * authors.css — a classic author's page: the portrait, one timeline that
 * holds the life and the stories, "More stories" and "More authors".
 *
 * The page is a story page's reading column (stories.css): the title block,
 * the introduction, the language row and the page break come from there,
 * and this file holds only what is new. Tokens come from tokens.css.
 *
 * Every side is a logical one. On a Persian or Arabic page the year column,
 * the coral rule beside a story and its padding move to the right with the
 * page's direction, and nothing here has to say so.
 *
 * Linked by an author's page, after stories.css.
 */

/* ======================================================================== *
 * The title block and the portrait
 * ======================================================================== */

/* Persian and Arabic letters have no italic: the place and the years stand
   upright there. */
[dir="rtl"] .author-life {
  font-style: normal;
}

.author-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-5);
}

/* An upright photo, cropped to 3:4 a little above its middle, where the face
   is; the paper shows while it loads. */
.author-portrait img {
  display: block;
  width: 18rem;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: var(--radius-card);
  background: var(--paper-sunken);
}

/* The credit the licence asks for, small, and never wider than the column. */
.author-portrait figcaption {
  margin-top: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  line-height: var(--leading-ui);
  color: var(--ink-2);
  text-align: center;
  overflow-wrap: anywhere;
}

/* The source link's arrow, spaced as on a guide (articles.css .guide-out),
   whose sheet this page does not link. */
.author-portrait .guide-out {
  margin-inline-start: var(--space-1);
}

/* ======================================================================== *
 * The timeline
 * ======================================================================== */

/* "Life and stories" opens a section of the page, under a hairline. It, or
   the count line where no timeline is shown, is the target of a story page's
   "N stories on Mitlesen" (#stories); 7rem clears the sticky preview bar, as
   for a paragraph link (.story-para). */
.author-heading {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: var(--hairline);
  font-size: var(--size-title-m);
  scroll-margin-top: 7rem;
}

.author-count {
  margin-top: var(--space-1);
  scroll-margin-top: 7rem;
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

/* An author with no year left to show has no heading: the count line opens
   the section in its place. */
.story-intro + .author-count {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: var(--hairline);
}

.author-timeline {
  margin-top: var(--space-3);
  list-style: none;
}

/* A year in a column of its own, and everything the year holds beside it. */
.author-year-group {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  column-gap: var(--space-3);
  padding-block: 1.25rem;
}

.author-year-group + .author-year-group {
  border-top: var(--hairline);
}

/* The digits line up down the column. A little padding sets the year on the
   first line of the larger reading text beside it. */
.author-year {
  padding-top: 0.25em;
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

/* A year a story appeared in: the one coral that may be text. */
.author-year-story {
  color: var(--coral-ink);
}

.author-entries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.author-event {
  font-size: var(--size-body);
  line-height: var(--leading-body);
}

/* ---- A story ----------------------------------------------------------- */

/* One link around the cover and the words, on a coral rule at the text's
   leading edge. */
.author-story {
  display: flex;
  gap: 1.25rem;
  padding-inline-start: var(--space-3);
  border-inline-start: 2px solid var(--coral);
  color: var(--ink);
  text-decoration: none;
}

/* A 2:3 book cover, framed by a hairline so a pale one keeps its edge. */
.author-story-cover {
  flex: none;
  width: 96px;
  height: 144px;
  object-fit: cover;
  border: var(--hairline);
  border-radius: var(--radius-card);
  background: var(--paper-sunken);
}

.author-story-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.author-story-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.author-story-meta {
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

.author-story-note {
  margin-top: var(--space-2);
  font-size: var(--size-base);
  line-height: var(--leading-body);
  color: var(--ink-2);
}

/* "Read the preview": the words on the coral underline, as the byline's
   author link. */
.author-story-cta {
  align-self: flex-start;
  margin-top: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

/* ---- More stories ------------------------------------------------------ */

/* The stories the timeline has no year for, under a small label. */
.author-more-heading {
  margin-top: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  font-weight: var(--weight-bold);
  line-height: var(--leading-ui);
  letter-spacing: 0;
  color: var(--ink-2);
}

.author-more {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: var(--space-3);
}

/* ======================================================================== *
 * More authors
 * ======================================================================== */

/* A row of names under a hairline, each one a full tap target. */
.author-others {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-2);
  border-top: var(--hairline);
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  color: var(--ink-2);
}

.author-others-label {
  font-size: var(--size-meta);
  font-weight: var(--weight-bold);
}

.author-others a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-2);
  color: var(--ink);
  text-decoration: none;
}

.author-others a:hover {
  color: var(--coral-ink);
}

/* ======================================================================== *
 * Narrow screens
 * ======================================================================== */

@media (max-width: 560px) {
  .author-year-group {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .author-story {
    gap: var(--space-3);
  }

  .author-story-cover {
    width: 64px;
    height: 96px;
  }
}
