/* Blog (landing/blog/build.mjs). Loads after tokens.css and styles.css (the bar, .band, .foot, .eg-more).
   Reading layout, Apple Support rhythm: one column of 680 px, large title, a summary line, 17/1.6 body, hairlines instead of cards.
   Light: hero black, article Paper. Dark: article turns black (.band in styles.css). Tokens only. No JS, no animation beyond one chevron. Covers: decorative still lifes (alt=""), 16:9, explicit width/height. */

/* ---------- hero (black) ---------- */
.post-col { width: 100%; max-width: calc(680px + 2 * var(--eg-space-4)); margin-inline: auto; padding-inline: var(--eg-space-4); }
@media (min-width: 720px) { .post-col { max-width: calc(680px + 2 * var(--eg-space-6)); padding-inline: var(--eg-space-6); } }

.post-hero { padding: 112px 0 var(--eg-space-7); }
.post-hero h1 { font-size: var(--eg-size-xl); line-height: 1.12; letter-spacing: 0; text-wrap: balance; }
.post-back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 var(--eg-space-3); color: var(--eg-fg-muted); font-size: var(--eg-size-sm); text-underline-offset: 0.25em; text-decoration-thickness: 1px; -webkit-tap-highlight-color: transparent; transition: color var(--eg-dur-fast) var(--eg-ease-in-out), opacity var(--eg-dur-fast) var(--eg-ease-out), transform var(--eg-dur-fast) var(--eg-ease-out); }
.post-back::before { content: "\2190" / ""; margin-right: var(--eg-space-2); }
@media (hover: hover) { .post-back:hover { color: var(--eg-fg); } }
.post-back:active { opacity: 0.7; transform: scale(var(--eg-press-scale)); transition-duration: var(--eg-dur-press); }
.post-meta { margin-top: var(--eg-space-4); color: var(--eg-fg-muted); font-size: var(--eg-size-sm); }
.post-lead { margin-top: var(--eg-space-4); max-width: 34ch; color: var(--eg-fg-muted); font-size: var(--eg-size-lg); line-height: 1.35; text-wrap: pretty; }
@media (min-width: 720px) {
  .post-hero { padding: 128px 0 var(--eg-space-8); }
  .post-hero h1 { font-size: var(--eg-size-2xl); letter-spacing: -0.025em; line-height: 1.08; }
}

/* Cover under the title: the full column, 16:9. aspect-ratio plus the width/height attributes reserve the space, so nothing shifts. Paper-coloured box shows while the file loads. */
.post-cover { display: block; margin-top: var(--eg-space-6); }
.post-cover img, .post-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--eg-radius-card); background: var(--eg-paper); object-fit: cover; }
@media (min-width: 720px) { .post-cover { margin-top: var(--eg-space-7); } }

/* ---------- article ---------- */
.post-band { padding: var(--eg-space-7) 0 var(--eg-space-8); }
@media (min-width: 720px) { .post-band { padding: var(--eg-space-8) 0 var(--eg-space-9); } }
.post-body { font-size: var(--eg-size-md); line-height: 1.6; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin-top: var(--eg-space-4); }
.post-body strong { font-weight: var(--eg-weight-strong); }
.post-body a { color: var(--eg-accent-text); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; -webkit-tap-highlight-color: transparent; transition: opacity var(--eg-dur-fast) var(--eg-ease-out); }
@media (hover: hover) { .post-body a:hover { text-decoration-thickness: 2px; } }
.post-body a:active { opacity: 0.7; transition-duration: var(--eg-dur-press); }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

/* Summary: the first paragraph. */
.post-body .lead-p { font-size: var(--eg-size-lg); line-height: 1.4; text-wrap: pretty; }
/* Date and update line. */
.post-body .post-note { color: var(--eg-fg-muted); font-size: var(--eg-size-sm); line-height: 1.5; }

.post-body h2 { margin-top: var(--eg-space-7); font-size: var(--eg-size-xl); line-height: 1.15; letter-spacing: 0; text-wrap: balance; }
.post-body h3 { margin-top: var(--eg-space-6); font-size: var(--eg-size-lg); line-height: 1.25; text-wrap: balance; }
.post-body h2 + *, .post-body h3 + * { margin-top: var(--eg-space-3); }
@media (min-width: 720px) { .post-body h2 { margin-top: var(--eg-space-8); } .post-body h3 { margin-top: var(--eg-space-7); } }

/* Lists: styles.css resets ul. Restore markers, muted, with room for tap-free reading. */
.post-body :is(.bullets, .steps) { margin-top: var(--eg-space-4); padding-inline-start: 1.25em; }
.post-body .bullets { list-style: disc; }
.post-body .steps { list-style: decimal; }
.post-body li { padding-inline-start: var(--eg-space-1); }
.post-body li + li { margin-top: var(--eg-space-2); }
.post-body li::marker { color: var(--eg-fg-muted); }

/* "Detalle geek:" line (voice.md): the exact figure and its source, after the plain explanation. */
.post-body .geek-line { color: var(--eg-fg-muted); font-size: var(--eg-size-sm); line-height: 1.5; }
.post-body .geek-label { font-weight: var(--eg-weight-strong); }
.post-body .geek-label + * { margin-left: 0.25em; }
@media (prefers-contrast: more) { .post-body .geek-line, .post-body .post-note { color: var(--eg-fg); } }

/* Jump links under the date line. */
.jump ul { display: flex; flex-wrap: wrap; gap: 0 var(--eg-space-4); margin-top: var(--eg-space-2); }
.post-body .jump a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--eg-size-sm); }

/* ---------- tables: hairlines, no cards. A table with a lot of text (.wide) stacks under 720 px: the first cell is the row heading, every other cell shows its column name beside the value. Nothing scrolls sideways, so nothing is hidden. A narrow table keeps the bleed-to-edge wrapper and scrolls if it must. ---------- */
.tbl { margin: var(--eg-space-5) calc(var(--eg-space-4) * -1) 0; padding-inline: var(--eg-space-4); overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (min-width: 720px) { .tbl { margin-inline: 0; padding-inline: 0; } }
.tbl:focus-visible { outline-offset: 0; border-radius: 4px; }
.tbl-t { width: 100%; border-collapse: collapse; font-size: var(--eg-size-sm); line-height: 1.45; font-variant-numeric: tabular-nums; }
.tbl-t th, .tbl-t td { padding: var(--eg-space-3) var(--eg-space-4) var(--eg-space-3) 0; border-top: 1px solid var(--eg-hairline); text-align: left; vertical-align: top; }
.tbl-t th { color: var(--eg-fg-muted); font-size: var(--eg-size-xs); font-weight: var(--eg-weight-strong); border-top: 0; border-bottom: 1px solid var(--eg-hairline); }
.tbl-t tbody tr:last-child > * { border-bottom: 1px solid var(--eg-hairline); }
.tbl-t td:first-child { font-weight: var(--eg-weight-strong); }
@media (max-width: 719.98px) {
  .tbl:has(.wide) { margin-inline: 0; padding-inline: 0; overflow: visible; }
  .tbl-t.wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl-t.wide, .tbl-t.wide tbody, .tbl-t.wide tr, .tbl-t.wide td { display: block; }
  .tbl-t.wide tbody tr { padding-block: var(--eg-space-3); border-top: 1px solid var(--eg-hairline); }
  .tbl-t.wide tbody tr:last-child { border-bottom: 1px solid var(--eg-hairline); }
  .tbl-t.wide tbody tr:last-child > * { border-bottom: 0; }
  .tbl-t.wide td { display: grid; grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr); gap: 0 var(--eg-space-3); padding: var(--eg-space-1) 0; border-top: 0; }
  .tbl-t.wide td::before { content: attr(data-label); color: var(--eg-fg-muted); font-size: var(--eg-size-xs); font-weight: var(--eg-weight-strong); line-height: 1.6; }
  .tbl-t.wide td:first-child { display: block; padding-bottom: var(--eg-space-2); font-size: var(--eg-size-md); }
  .tbl-t.wide td:first-child::before { content: none; }
}
@media (prefers-contrast: more) { .tbl-t.wide td::before { color: var(--eg-fg); } }
@media (prefers-contrast: more) { .tbl-t th, .tbl-t td { border-color: var(--eg-fg-muted); } .tbl-t th { color: var(--eg-fg); } }

/* ---------- folds (<details>): the same row as the spec sheets' groups ---------- */
.fold { margin-top: var(--eg-space-5); border-top: 1px solid var(--eg-hairline); border-bottom: 1px solid var(--eg-hairline); }
.fold + .fold { margin-top: 0; border-top: 0; }
.fold summary { display: flex; align-items: center; gap: var(--eg-space-4); min-height: 56px; margin-inline: calc(var(--eg-space-3) * -1); padding: var(--eg-space-3); border-radius: var(--eg-radius-control); cursor: pointer; list-style: none; font-weight: var(--eg-weight-strong); -webkit-tap-highlight-color: transparent; transition: background-color var(--eg-dur-fast) var(--eg-ease-in-out), transform var(--eg-dur-fast) var(--eg-ease-out); }
@media (hover: hover) { .fold summary:hover { background: color-mix(in srgb, var(--eg-fg) 6%, transparent); } }
.fold summary:active { background: color-mix(in srgb, var(--eg-fg) 10%, transparent); transform: scale(var(--eg-press-scale-lg)); transition-duration: var(--eg-dur-press); }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform var(--eg-dur-fast) var(--eg-ease-in-out); }
.fold[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
.fold-body { padding-bottom: var(--eg-space-4); }
.fold-body > :first-child { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .fold summary::after { transition: none; } }
/* Content fade on open (opacity only, kept under reduced motion). */
@keyframes eg-fade { from { opacity: 0; } }
.fold[open] > :not(summary) { animation: eg-fade var(--eg-dur) var(--eg-ease-out); }

/* ---------- sources: quiet, at the end ---------- */
.post-sources { margin-top: var(--eg-space-8); padding-top: var(--eg-space-5); border-top: 1px solid var(--eg-hairline); }
.post-body .post-sources h2 { margin-top: 0; font-size: var(--eg-size-md); line-height: 1.4; }
.post-sources ul { margin-top: var(--eg-space-2); font-size: var(--eg-size-sm); line-height: 1.45; }
.post-sources li { display: grid; padding: var(--eg-space-2) 0; }
.post-body .post-sources li + li { margin-top: 0; }
.post-body .post-sources a { display: inline-block; justify-self: start; min-height: 24px; color: var(--eg-fg); overflow-wrap: anywhere; }
.src-host { color: var(--eg-fg-muted); font-size: var(--eg-size-xs); }
@media (prefers-contrast: more) { .src-host { color: var(--eg-fg); } }
.post-end { margin-top: var(--eg-space-6); }

/* ---------- index ---------- */
.post-thumb { display: block; margin-bottom: var(--eg-space-4); }
.post-list { border-top: 1px solid var(--eg-hairline); }
.post-list li { border-bottom: 1px solid var(--eg-hairline); }
.post-link { display: block; margin-inline: calc(var(--eg-space-3) * -1); padding: var(--eg-space-5) var(--eg-space-3); border-radius: var(--eg-radius-control); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: transform var(--eg-dur-fast) var(--eg-ease-out); }
.post-link time { display: block; color: var(--eg-fg-muted); font-size: var(--eg-size-xs); }
.post-link h2 { margin-top: var(--eg-space-1); font-size: var(--eg-size-lg); line-height: 1.25; letter-spacing: 0; text-wrap: balance; transition: color var(--eg-dur-fast) var(--eg-ease-in-out); }
.post-link p { margin-top: var(--eg-space-2); color: var(--eg-fg-muted); font-size: var(--eg-size-md); line-height: 1.5; text-wrap: pretty; }
@media (hover: hover) { .post-link:hover h2 { color: var(--eg-accent-text); } }
.post-link:active { transform: scale(var(--eg-press-scale-lg)); transition-duration: var(--eg-dur-press); }
@media (min-width: 720px) { .post-link { padding-block: var(--eg-space-6); } .post-link h2 { font-size: var(--eg-size-xl); line-height: 1.15; } }
@media (prefers-contrast: more) { .post-link p, .post-link time { color: var(--eg-fg); } }
