/* =========================================================
   ARTICLE PAGE TEMPLATE  (pages/about.html)
   desktop (1512 design): meta 14 · title 64 · text 20, two columns
   phone:                 meta 10 · title 32 · text 14, one column
   ========================================================= */
@font-face { font-family: 'Cottorway'; font-weight: 700; src: url('../fonts/Cottorway_Typeface_Bold.ttf') format('truetype'); font-display: swap }

/* arriving through the bar transition: hidden (accent-coloured) until page.js has the bars in place */
html.tx0 { background: var(--acc) }
html.tx0 body > *:not(#tx) { visibility: hidden }

/* #nav is only the soft blurred strip behind Back + Menu (menu.js also measures it for its padding).
   Strip, Back and Menu slide away together on scroll down and return on scroll up (js/page.js). */
#nav { display: block; pointer-events: none; min-height: calc(var(--top) + var(--nfs) * 1.6 + 18px) }
#nav > * { display: none }

.art {
  --a-meta: clamp(10px, .926 * var(--vw), 22px);   /* 14px at 1512 */
  --a-ttl: clamp(32px, 4.233 * var(--vw), 96px);   /* 64px at 1512 */
  --a-txt: clamp(14px, 1.323 * var(--vw), 28px);   /* 20px at 1512 */
  --a-gap: clamp(16px, 1.6 * var(--vw), 32px);
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--top) + env(safe-area-inset-top, 0px)) var(--pad) calc(var(--bot) + env(safe-area-inset-bottom, 0px))
}

/* pills (Back / Return) */
.more.pill {
  display: inline-flex; align-items: center;
  padding: .1em .75em .16em;
  border: 1px solid var(--acc); border-radius: 999px;
  color: var(--acc); font: 400 var(--nfs)/1.2 'Outfit', sans-serif;
  transition: background-color .35s, color .35s
}
.more.pill:hover { background: var(--acc); color: #000 }
.ft .more.pill { justify-self: start; align-self: end }  /* grid items stretch: keep the pill the size of its text */

/* .bar only holds the space; Back itself is fixed, in line with Menu */
.bar { min-height: calc(var(--nfs) * 1.5) }
.bar .pill.back { position: fixed; z-index: 52; top: calc(var(--top) + env(safe-area-inset-top, 0px)); left: var(--pad) }

.meta {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .3em 1.5em;
  margin-top: clamp(4px, .6 * var(--vw), 14px);
  font: 400 var(--a-meta)/1.2 'Outfit', sans-serif; color: var(--fg); opacity: .9
}

.ttl {
  max-width: 13.5em; margin: clamp(10px, 1.1 * var(--vw), 24px) auto 0;
  text-align: center; text-transform: uppercase;
  font: 700 var(--a-ttl)/.98 'Cottorway', 'Outfit', sans-serif; letter-spacing: -.005em
}
/* title words sit in masks and rise out of them (page.js) */
.ttl .wm { display: inline-block; overflow: hidden; vertical-align: top; padding: .06em 0; margin: -.06em 0 }
.ttl .wi { display: inline-block }

.hero { margin: var(--a-gap) 0 0; overflow: hidden; aspect-ratio: 2.87 / 1 }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none }

.body {
  margin-top: var(--a-gap);
  column-count: 2; column-gap: clamp(24px, 3.8 * var(--vw), 80px);
  font: 300 var(--a-txt)/1.28 'Outfit', sans-serif; color: var(--fg)
}
.body p { margin: 0 0 1.25em; orphans: 2; widows: 2 }

/* a picture in the middle of the text: breaks out across both columns (add col: true in data.js to keep it in one) */
.body .fig { column-span: all; margin: .4em 0 1.6em }
.body .fig.col { column-span: none; break-inside: avoid; margin: .2em 0 1.25em }
.body .fig img { display: block; width: 100%; height: auto; -webkit-user-drag: none }
.body .fig figcaption { margin-top: .7em; font-size: .72em; line-height: 1.3; color: var(--mut) }

/* optional GitHub button after the text */
.cta { margin-top: var(--a-gap) }
.cta .more.pill .arr { color: inherit }
.cta .more.pill:hover .arr { color: #000 }

.ft {
  margin-top: auto; padding-top: clamp(56px, 8 * var(--vw), 140px);
  display: grid; grid-template-columns: 1fr 1fr; align-items: end
}
.more.nxt {
  display: block; justify-self: start; margin-left: 36%;
  font: 400 var(--nfs)/1.2 'Outfit', sans-serif; color: var(--fg);
  text-transform: none; border: 0; padding: 0
}
.more.nxt small { display: block; font-size: .8em; color: var(--fg) }
.more.nxt .nl { color: var(--acc); transition: color .3s }
.more.nxt .arr { color: inherit }
.more.nxt:hover .nl { color: var(--fg) }

@media (max-width: 700px) {
  .art { --a-meta: 10px; --a-ttl: 32px; --a-txt: 14px; --a-gap: 18px }
  /* phone: Back is plain text, like Menu */
  .more.pill.back { border: 0; padding: 0; color: var(--fg); font-size: var(--nfs) }
  .more.pill.back:hover { background: none; color: var(--acc) }
  .ttl { max-width: 9.5em }
  .hero { aspect-ratio: 2 / 1 }
  .body { column-count: 1 }
  .ft { grid-template-columns: 1fr auto; padding-top: 56px }
  .more.nxt { margin-left: 0 }
}

/* reading progress line (js/page.js) */
#rp { position: fixed; left: 0; top: 0; width: 100%; height: 3px; background: var(--acc); transform: scaleX(0); transform-origin: 0 50%; z-index: 90; pointer-events: none }
