/* Sample emails (newsletters.html): page-specific layout only. Loaded after site.css, scoped to main.pg-mails.
   Six production emails framed in the system: a wayfinding list, a grid of panels that never overflows at 320px,
   each holding a sandboxed preview and the link to the raw HTML. */

/* wayfinding: the six emails, in lifecycle order */
.pg-mails .mail-toc { border-top: 2px solid var(--fg); border-bottom: 1px solid var(--rule); margin-bottom: var(--s6); }
.pg-mails .mail-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.pg-mails .mail-toc li { margin: 0; }
.pg-mails .mail-toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2); color: var(--fg); text-decoration: none; font-weight: 600; font-size: var(--t-1); }
.pg-mails .mail-toc li:first-child a { padding-left: 0; }
@media (hover: hover) and (pointer: fine) { .pg-mails .mail-toc a:hover { text-decoration: underline; text-decoration-thickness: 2px; } }

/* the grid: nothing overflows at 320px */
.pg-mails .mails { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--s5); }
.pg-mails .mails > li { margin: 0; display: flex; min-width: 0; }
.pg-mails .mail { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--s4); min-width: 0; scroll-margin-top: var(--s5); }
.pg-mails .mail-h h2 { font-size: var(--t2); letter-spacing: -.012em; }
.pg-mails .mail-meta { margin-top: var(--s1); font-size: var(--t-1); color: var(--fg-3); }
.pg-mails .mail-subj { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: baseline; font-size: var(--t-1); font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.pg-mails .mail-subj .lbl { padding-top: 2px; }

/* the preview: a sandboxed iframe that scrolls inside, focusable as one tab stop */
.pg-mails .mail-frame { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius); min-width: 0; }
.pg-mails .mail-frame:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pg-mails .mail-view { display: block; width: 100%; height: 640px; border: 0; border-radius: var(--radius); background: var(--bg-2); color-scheme: light dark; }

.pg-mails .mail-f { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); border-top: 1px solid var(--rule); padding-top: var(--s2); font-size: var(--t-1); }
.pg-mails .mail-f a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.pg-mails .mail-size { color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* preview width: desktop shows the 600px card inside a single column */
.pg-mails .mails[data-view="desktop"] { grid-template-columns: minmax(0, 1fr); }
.pg-mails .mails[data-view="desktop"] .mail { max-width: 760px; width: 100%; margin-inline: auto; }
.pg-mails .mails[data-view="desktop"] .mail-view { height: 820px; }

.pg-mails .mail-works code { font: inherit; font-weight: 600; color: var(--fg); }

@media (max-width: 560px) {
  .pg-mails .mail-view { height: 560px; }
  .pg-mails .mails[data-view="desktop"] .mail-view { height: 640px; }
}

/* ===== motion (2 Nov 2026). Tokens from site.css :root; every rule has its reduced-motion path below. ===== */
/* the width switch: the new arrangement fades in (240 ms) from the visible default; the saved view restored at load does not */
.pg-mails .mails { transition: opacity var(--dur-2) ease-out; }
.pg-mails .mails.in { opacity: 0; transition: none; }
/* feedback on the page's links */
.pg-mails .mail-toc a, .pg-mails .mail-f a { transition: opacity var(--dur-1) ease-out; }
.pg-mails .mail-toc a:active, .pg-mails .mail-f a:active { opacity: .72; }
@media (prefers-reduced-motion: reduce) {
  .pg-mails .mails, .pg-mails .mails.in { transition: none; opacity: 1; }
}
