/*
 * Phones: the pictures first (review 17 Nov).
 *   - Chart cards take the full width of the screen.
 *   - Scroll cards (m-scrolly) that lie over their picture keep one idea: the kicker, the name, the one sentence that
 *     explains the picture, and the numbers. Longer descriptions, second paragraphs and extra quotes are left out on
 *     these screens (they stay in the page for wider screens and for screen readers' full text on desktop); a quote
 *     keeps four lines.
 * A new chart or card follows the same rules without changes here.
 * The scroll-card rules start with m-scrolly, so they win over parts that load later (ui-polish.css).
 */

/* ---- chart cards: the full width of the screen ------------------------------------------------------------------ */
@media (width <= 600px) {
  .media-break, .viewer-break { width: 100vw; }
  /* the card runs edge to edge; its own 16px padding keeps the chart off the screen edge (rail.css pads bare figures) */
  .media-break m-figure[bare] { padding-inline: 0; }
  .media-break m-figure .fig-frame { border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; padding-left: 16px; padding-right: 16px; }
  .media-break .np { box-shadow: none; padding-left: 16px; padding-right: 16px; }
  .media-break .fig-bare > .acm { padding-left: 16px; padding-right: 16px; }
}

/* ---- scroll cards: one idea each ---------------------------------------------------------------------------------- */
@media (width < 900px) {
  m-scrolly .sc-card { padding: 12px 14px 13px; }
  m-scrolly .sc-card p { font-size: 16px; line-height: 1.45; }
  m-scrolly .sc-card .sc-kicker { margin-bottom: 6px; }
  m-scrolly .sc-card .sc-name { font-size: 20px; margin-bottom: 4px; }
  /* the first paragraph only; no paragraph or quote after it */
  m-scrolly .sc-card > p:not(.sc-kicker) ~ p:not(.sc-kicker),
  m-scrolly .sc-card > p:not(.sc-kicker) ~ blockquote,
  m-scrolly .sc-card > blockquote ~ p,
  m-scrolly .sc-card > blockquote ~ blockquote { display: none; }
  /* the paragraph is often the last line left; no gap under it (what follows has its own top margin) */
  m-scrolly .sc-card > p:not(.sc-kicker):not(.sc-name) { margin-bottom: 0; }
  /* descriptions under a name: the name and the numbers say it */
  m-scrolly .sc-card .sc-desc, m-scrolly .sc-card .hp-eg, m-scrolly .sc-card .hp-facts { display: none; }
  /* a quote: four lines, then its speaker */
  m-scrolly .sc-card .sc-quote { margin: 4px 0 0; }
  m-scrolly .sc-card .sc-quote p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; font-size: 16px; }
  m-scrolly .sc-card .sc-quote footer { margin-top: 4px; }
  /* the numbers, tighter */
  m-scrolly .sc-card .sc-stats { margin-top: 8px; padding-top: 8px; }
  m-scrolly .sc-card .hp-geo { margin-top: 10px; padding-top: 10px; }
  m-scrolly .sc-card .hp-key { margin-top: 10px; padding-top: 10px; }
  m-scrolly .sc-card .hp-cs b { font-size: 34px; }
  m-scrolly .sc-card .hp-table { font-size: 11px; }
}
