/*
 * articles.css — Life in Germany: what a guide adds to the reading column,
 * and the list of guides.
 *
 * A guide is read in the news reader (stories.css): same column, same
 * toolbar, same page break. This file holds only what is new: the cover
 * photo's frames, the tinted tile that stands in for a guide without one,
 * the overline, the step heading, the box of office words, the sources and
 * the photo's credit, and the card that /life-in-germany and the home page
 * draw.
 *
 * Tokens come from tokens.css. A tile is the only tinted surface, and it
 * carries a line icon, never text.
 *
 * Linked by a guide page (after stories.css), by /life-in-germany, and by
 * the home page while it has a guide to show.
 */

/* ======================================================================== *
 * The cover photo
 * ======================================================================== */

/* Every guide's photo is cropped to the same frame, whatever its own shape
   (the 9:16 Pfand machine too): the paper shows while it loads. */
.guide-photo {
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--paper-sunken);
}

/* On a guide's page it runs the column at 3:2, where the tile stood. */
.guide-photo-hero {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  margin-top: var(--space-4);
  border-radius: var(--radius-card);
}

/* On a card it is a strip along the card's leading edge, as tall as the
   card: the negative margins take it out to the border, through the
   padding the text keeps. */
.guide-photo-card {
  flex: none;
  align-self: stretch;
  width: 6.5rem;
  min-height: 6rem;
  margin-block: calc(-1 * var(--space-3));
  margin-inline-start: calc(-1 * var(--space-3));
  /* inside the card's 1px hairline border, so 1px less than its radius */
  border-start-start-radius: calc(var(--radius-card) - 1px);
  border-end-start-radius: calc(var(--radius-card) - 1px);
}

/* ======================================================================== *
 * The tile
 * ======================================================================== */

.guide-tint-blue { background: var(--tint-blue); }
.guide-tint-sand { background: var(--tint-sand); }
.guide-tint-sage { background: var(--tint-sage); }
.guide-tint-rose { background: var(--tint-rose); }

/* The card's size. The icon is drawn as a stroke in the text colour. */
.guide-tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-card);
  color: var(--ink);
}

.guide-tile svg {
  width: 2rem;
  height: 2rem;
  stroke-width: 1.5;
}

/* On a guide's page the tile runs the column, low enough that the first
   German line still shows on a phone. */
.guide-tile-hero {
  width: 100%;
  height: clamp(6.5rem, 24vw, 9rem);
  margin-top: var(--space-4);
}

.guide-tile-hero svg {
  width: 3.25rem;
  height: 3.25rem;
  stroke-width: 1.2;
}

/* ======================================================================== *
 * A guide's page
 * ======================================================================== */

/* A guide's title leads with one long German compound
   ("Krankenversicherung:"), which is wider than the narrowest phones at the
   title's size: it steps down there, and may break rather than overflow. */
.guide-article .story-title,
.guide-card-title {
  overflow-wrap: break-word;
}

@media (max-width: 359px) {
  .guide-article .story-title {
    font-size: var(--size-title-l);
  }
}

/* "Life in Germany · Ankommen": where the guide sits, over its title. */
.guide-overline {
  margin-bottom: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  font-weight: var(--weight-bold);
  line-height: var(--leading-ui);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
}

.guide-overline a {
  color: var(--ink);
}

/* Beside Persian or Arabic words, capitals would shout the German name. */
[dir="rtl"] .guide-overline {
  text-transform: none;
}

/* When it was checked and against what, right under the photo or tile. */
.guide-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
  margin-top: var(--space-1);
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

/* The link's 44px of height are tap target, not rhythm: the negative margin
   keeps its line as close to the date as two lines of one note. */
.guide-source {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-block: calc(-1 * var(--space-2));
  color: var(--coral-ink);
}

/* The arrow of a link that leaves the site. */
.guide-out {
  margin-inline-start: var(--space-1);
}

/* ---- Steps ------------------------------------------------------------- */

/* A step opens a part of the text: more room above it than between two
   paragraphs, and its first paragraph close under it. */
.guide-step {
  margin-top: var(--space-5);
  scroll-margin-top: 7rem;
}

.story-para + .guide-step {
  margin-top: var(--space-5);
}

.guide-step + .story-para {
  margin-top: var(--space-2);
}

.guide-step-h {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--size-title-m);
}

/* "Schritt 1": the app's small label, in the one coral that may be text. */
.guide-step-n {
  font-family: var(--font-ui);
  font-size: var(--size-meta);
  font-weight: var(--weight-bold);
  line-height: var(--leading-ui);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--coral-ink);
}

/* The label and the title are two lines here; the dot between them is for
   the heading read as one line. */
.guide-step-dot {
  display: none;
}

/* ---- Words for the office ---------------------------------------------- */

.guide-words {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-3) var(--space-1);
  background: var(--paper-raised);
  border: var(--hairline);
  border-radius: var(--radius-card);
}

.guide-words-h,
.guide-sources-h {
  font-family: var(--font-ui);
  font-size: var(--size-base);
  font-weight: var(--weight-bold);
  line-height: var(--leading-ui);
  letter-spacing: 0;
}

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

.guide-words-list {
  margin-top: var(--space-2);
}

.guide-word {
  padding-block: var(--space-2);
  border-top: var(--hairline);
  scroll-margin-top: 7rem;
}

.guide-word dt {
  font-family: var(--font-reading);
  font-size: 1.0625rem;
  line-height: var(--leading-snug);
  color: var(--ink);
}

.guide-word dd {
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

/* ---- Sources ----------------------------------------------------------- */

.guide-sources {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: var(--hairline);
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

.guide-sources-list {
  margin-top: var(--space-2);
  list-style: none;
}

/* A source's name may run to two lines, so the link is a block whose padding
   makes the 44px, and every row keeps the same rhythm whatever its length. */
.guide-sources-list a {
  display: block;
  padding-block: 0.6875rem;
  color: var(--ink);
}

.guide-outdated {
  margin-top: var(--space-2);
}

.guide-outdated a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
}

/* The cover photo's credit closes the sources, as a news page's closes the
   article: small, and the attribution kept whole. */
.guide-photo-credit {
  margin-top: var(--space-2);
  font-size: var(--size-meta);
  overflow-wrap: anywhere;
}

.guide-photo-credit a {
  color: var(--ink);
}

/* ======================================================================== *
 * The list of guides: /life-in-germany and the home page
 * ======================================================================== */

.guide-category {
  scroll-margin-top: var(--space-4);
}

.guide-category + .guide-category {
  margin-top: var(--space-5);
}

/* What the German category name means, in the page's language. */
.section-head .guide-category-meaning {
  font-weight: var(--weight-semibold);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--space-3);
}

/* A row: the tile, then the title and one meta line. Hairline, never
   shadowed, like every card on the site. */
.guide-card {
  background: var(--paper-raised);
  border: var(--hairline);
  border-radius: var(--radius-card);
  transition: border-color var(--duration) var(--ease);
}

.guide-card:hover {
  border-color: var(--rule-strong);
}

.guide-card a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-3);
  color: inherit;
  text-decoration: none;
}

.guide-card-body {
  min-width: 0;
}

.guide-card-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}

.guide-card a:hover .guide-card-title {
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.guide-card-sub,
.guide-card-meta {
  font-family: var(--font-ui);
  line-height: var(--leading-ui);
  color: var(--ink-2);
}

.guide-card-sub {
  margin-top: 2px;
  font-size: var(--size-ui);
}

.guide-card-meta {
  margin-top: var(--space-1);
  font-size: var(--size-meta);
}
