/* Articles (josun.app/articles): the section front and the article page.
   scripts/render-site.cjs writes the HTML. site.css is loaded first and gives
   everything that is the site's own: the white ground and its marigold shapes,
   the header and footer,
   the breadcrumb line (.crumbs), .eyebrow, .lede, h1 and h2, the bands
   (section.alt), .card, the buttons and the download block.

   The rule (owner, 29 Nov 2026: "the article page looks good, but it should
   have kinda the same style?"): an article page is a Josun page. Same ground,
   same rounded cards with a hairline border, same Figtree for the site's own
   words ("Articles", "More articles", "The writer", bylines, buttons), same
   marigold accent. One thing differs, on purpose: the serif (Newsreader) is
   for the writer's words, which is the headline, the text, a pulled-out line
   and the headline in a tile. Before adding a look here, see whether site.css
   already has it.

   The reading sizes come from measuring the Sydney Morning Herald, the New
   York Times, the Washington Post and the New York Post on 29 Nov 2026:
   headlines 42 to 64px, text 18 to 20px on a 30 to 32px line in a 600 to
   650px column, captions 14 to 15px sans.

   Top and bottom padding only on anything that is also a .wrap: .wrap owns
   the sides, and a padding shorthand would put the words on the screen edge. */
body.art { --serif: Newsreader, Georgia, 'Times New Roman', serif; }
.art a { text-decoration: none; }

.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--rule); }
span.avatar { display: flex; align-items: center; justify-content: center; font: 600 18px/1 Figtree, sans-serif; color: var(--ink2); }
.draft { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--sun-soft); border: 1px solid var(--sun); color: var(--ink); font-size: 14px; }

/* ── One article as a tile: on the front, and under an article. It is the
   site's card (same ground, border and corners) with a picture on top. (Not
   ".card" itself: that one has padding, and the picture runs to the edge.) */
.tile { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: 20px; overflow: hidden; }
.tile { transition: translate .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tile:hover { border-color: var(--sun); translate: 0 -3px; box-shadow: 0 18px 28px -22px rgba(43, 39, 34, .45); }
.tile .pic { display: block; flex: none; }
.tile .pic img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--rule); }
.tile .words { padding: 18px 20px 20px; }
.tile .eyebrow { font-size: 12px; margin: 0 0 8px; }
.tile .hl { font-family: var(--serif); font-weight: 600; font-size: 23px; line-height: 1.16; letter-spacing: -.01em; margin: 0 0 8px; text-wrap: balance; }
.tile .hl a { color: var(--ink); }
/* The whole tile is the link. */
.tile .hl a::after { content: ""; position: absolute; inset: 0; }
.tile .dek { font-size: 16px; line-height: 1.45; color: var(--ink2); margin: 0 0 10px; }
.tile .meta { font-size: 13px; color: var(--muted); margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ── The section front: the same top as a topic page, then the articles. */
.front-head { padding-top: 48px; }
.front-head h1 { margin-bottom: 14px; }
.front-head .lede { max-width: 640px; margin-bottom: 30px; }
.front { padding-bottom: 56px; }
.front-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
/* The lead's picture takes whatever height its card has left, so the card
   can stand as tall as the two beside it with no empty strip under the words. */
.lead .pic { position: relative; flex: 1 1 auto; aspect-ratio: 16 / 9; }
.lead .pic img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.lead .words { padding: 24px 28px 26px; }
.lead .hl { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.018em; margin-bottom: 12px; }
.lead .dek { font-size: 19px; }
.seconds { display: grid; gap: 20px; grid-auto-rows: 1fr; }
.seconds .dek { display: none; }
/* Only one article out: its picture beside its words. */
.front-top.solo { grid-template-columns: 1fr; }
.solo .lead { flex-direction: row; }
.solo .lead .pic { flex: 3 1 0; min-width: 0; }
.solo .lead .words { flex: 2 1 0; min-width: 0; align-self: center; }
.front-grid { margin-top: 20px; }
.writers ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.writers ul.one { grid-template-columns: minmax(0, 640px); }
.writers li { display: flex; gap: 18px; align-items: flex-start; }
.writers .avatar { width: 72px; height: 72px; }
.writers strong { display: block; font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--ink); }
.writers strong a { color: inherit; }
.writers strong a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.writers small { display: block; font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.writers p { font-size: 15px; line-height: 1.5; margin: 0; }

/* ── The article page: headline, byline row, then text beside a rail. */
.art-head { padding-top: 48px; }
.art-head h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 54px); margin-bottom: 16px; max-width: 880px; }
.art-head .lede { max-width: 720px; }
.art-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.who { display: flex; align-items: center; gap: 14px; }
.who strong { display: block; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.who strong a { color: inherit; }
.who strong a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.who small { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); }

.share { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink); font: 500 14px/1 Figtree, sans-serif; cursor: pointer; -webkit-appearance: none; appearance: none; }
.sh:hover { border-color: var(--sun); }
.sh[hidden] { display: none; }
.sh svg { width: 16px; height: 16px; flex: none; }

.art-grid { display: grid; grid-template-columns: minmax(0, 680px) 304px; justify-content: space-between; gap: 56px; padding-top: 28px; padding-bottom: 64px; }
.art-hero { margin: 0 0 30px; }
.art-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; background: var(--rule); }
.art-hero figcaption { font-size: 14px; line-height: 1.45; color: var(--muted); padding-top: 10px; }
.art-hero figcaption span { white-space: nowrap; margin-left: 4px; }

.art-body { font-family: var(--serif); font-size: 20px; line-height: 1.6; color: var(--ink); }
.art-body > * { max-width: 640px; }
.art-body p { color: var(--ink); margin: 0 0 24px; }
.art-body h2 { font-family: var(--serif); font-weight: 600; font-size: 29px; line-height: 1.18; letter-spacing: -.012em; margin: 42px 0 12px; }
.art-body h3 { font-family: var(--serif); font-weight: 600; font-size: 23px; line-height: 1.25; margin: 32px 0 8px; }
.art-body ul { margin: 0 0 24px; padding-left: 24px; }
.art-body li { margin-bottom: 10px; }
.art-body li::marker { color: var(--sun); }
.art-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.art-body a:hover { text-decoration-color: var(--ink); }
/* A line pulled out big, with the marigold bar the site's answer boxes have. */
.art-body blockquote { margin: 36px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--sun); }
.art-body blockquote p { font-style: italic; font-weight: 500; font-size: clamp(25px, 3.2vw, 30px); line-height: 1.24; letter-spacing: -.01em; margin: 0; }

.art-end { max-width: 640px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); }
.bio { display: flex; gap: 18px; align-items: flex-start; margin-top: 26px; }
.bio .avatar { width: 72px; height: 72px; }
.bio p { font-size: 16px; line-height: 1.5; color: var(--ink2); margin: 0; }
.bio a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.bio .note { font-size: 14px; color: var(--muted); margin-top: 8px; }

.rail-in { position: sticky; top: 88px; display: grid; gap: 20px; }
.rail-more { padding: 20px 20px 6px; }
.rail-more h2 { font-size: 20px; line-height: 1.25; letter-spacing: 0; margin: 0 0 2px; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li + li { border-top: 1px solid var(--rule); }
.rail-list a { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; align-items: start; padding: 14px 0; }
.rail-list strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.2; color: var(--ink); }
.rail-list a:hover strong { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.rail-list small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.rail-list img { display: block; width: 84px; height: 63px; object-fit: cover; border-radius: 10px; background: var(--rule); }
.rail-app { border: 1px solid var(--sun); border-radius: 20px; padding: 20px; background: linear-gradient(180deg, var(--sun-soft), var(--card) 60%); }
.rail-app img { display: block; margin-bottom: 10px; }
.rail-app p { font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
.rail-app .btn { color: #FFFFFF; }

/* With few articles the rail already lists them all: show this band only
   where the rail isn't. */
.art-more.dup { display: none; }

@media (max-width: 1040px) {
  .art-grid { grid-template-columns: minmax(0, 680px); justify-content: start; padding-bottom: 44px; }
  .art-rail { display: none; }
  .art-more.dup { display: block; }
}
@media (max-width: 860px) {
  .front-head, .art-head { padding-top: 32px; }
  .front-top { grid-template-columns: 1fr; }
  .seconds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solo .lead { flex-direction: column; }
  .solo .lead .pic { flex: none; }
  .solo .lead .words { flex: none; align-self: auto; }
  .writers ul { grid-template-columns: 1fr; }
  .art-body { font-size: 19px; }
}
@media (max-width: 700px) {
  .art-hero img { border-radius: 16px; }
  .lead .words { padding: 18px 20px 20px; }
  /* Small tiles in a list: words on the left, a small picture on the right. */
  .tiles, .seconds { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 12px; }
  .tiles .tile, .seconds .tile { flex-direction: row-reverse; align-items: flex-start; gap: 14px; padding: 14px; border-radius: 16px; }
  .tiles .tile .pic, .seconds .tile .pic { width: 96px; }
  .tiles .tile .pic img, .seconds .tile .pic img { aspect-ratio: 1; border-radius: 10px; }
  .tiles .tile .words, .seconds .tile .words { flex: 1; min-width: 0; padding: 0; }
  .tiles .tile .hl, .seconds .tile .hl { font-size: 19px; }
  .tiles .tile .dek { display: none; }
  /* On a phone the share sheet covers Facebook and email. */
  .share.has-native .extra { display: none; }
  .who small + small { margin-top: 1px; }
}
