/* ==========================================================================
   Server-rendered layer: the handful of rules the Echos build could not supply.
   Loaded AFTER echos.css, so these win on equal specificity.

   Why this file exists
   --------------------
   The Echos pages are generated by Next, so their image sizing came from
   `next/image`, which writes **inline style attributes**:

       <div style="aspect-ratio:16 / 10" ...>
         <img style="position:absolute;height:100%;width:100%;..." ...>

   Copying that markup verbatim broke every image. This server serves under a
   Content-Security-Policy with `default-src 'self'` and no `style-src`, so
   inline styles are blocked outright - the browser logged

       Applying inline style violates the following Content Security Policy
       directive 'default-src 'self''

   and dropped both attributes. The consequence was not cosmetic: with no
   `aspect-ratio` the figure collapsed to zero height and no image appeared on
   the front page or an article page at all. The CSS file was fine; the markup
   was relying on something the policy forbids.

   So the sizing lives here, as classes, where the policy allows it.

   This is also the place for any utility the generated HTML needs that
   Tailwind never emitted - which happens whenever the class is used by the
   server-rendered layer rather than by a React component.
   ========================================================================== */

/* --- images ---------------------------------------------------------------
   `position:relative` on the frame plus an absolutely-positioned fill on the
   image is what next/image emits, and it is the only way to get "cover this
   box at this ratio" without knowing either dimension. */
.figure {
  position: relative;
  overflow: hidden;
  background: var(--paper-sunk);
  width: 100%;
}
.figure--16x9 { aspect-ratio: 16 / 9; }
.figure--16x10 { aspect-ratio: 16 / 10; }
.figure--4x3 { aspect-ratio: 4 / 3; }
.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The next/image output also inlines `color:transparent`, which is there to stop
   a broken-image icon flash. It is not load-bearing here. */
.figure img { color: inherit; }

/* --- figcaption ----------------------------------------------------------- */
.figure figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.figure figcaption .credit { opacity: 0.85; }

/* --- article body ---------------------------------------------------------
   `prose-news` exists in the Echos stylesheet but is scoped for React-rendered
   markdown; these are the few typographic rules the body needs that the
   generated markup relies on. */
.prose-news p { margin: 1.25rem 0; }
.prose-news h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.prose-news blockquote {
  margin: 1.75rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.prose-news ul { margin: 1.25rem 0; padding-left: 1.25rem; list-style: disc; }
.prose-news li { margin: 0.4rem 0; line-height: 1.7; }

/* --- reading time ---------------------------------------------------------
   Rendered as `2<!-- --> min read`, which is what React's text interpolation
   leaves behind in the exported HTML. The comment node is harmless but the
   adjacent text needs to sit on one baseline. */
.tnum { font-variant-numeric: tabular-nums; }

/* --- dark mode ------------------------------------------------------------
   The Echos palette flips on `prefers-color-scheme`. The variables are already
   redefined for it in echos.css; this only makes sure the figure background
   follows rather than staying on the light value.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  .figure { background: var(--paper-sunk); }
}
