/* Tech + Train by Pasta — pppasta.com/weekly/ (served by support-web, routes/weekly-public.ts).
   Layout: iOS Dev Weekly's issue page. Dark by default with a light mode on the nav toggle
   (body[data-mode]); two stone-plaster bands frame a 700px reading column; each section opens
   with a coloured pill tag. Cormorant throughout, Nunito on the tags and buttons.
   Designed in the newsletter's Issue 1 artifact, 2026-11-13. */

@font-face {
  font-family: "Cormorant";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/cormorant-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant";
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/cormorant-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/nunito-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #060606;
  --band: #12110e;
  --fg: #ede9e2;
  --muted: #9d958c;
  --nav: #d6d0c8;
  --rule: #2f2b28;
  --link: #2797e7;
  --gold: #d9a94a;
  --gold-hover: #e9bf66;
  --on-gold: #060606;
  --tag-text: #fafafa;
  --tag-note: #514944;
  --tag-sponsored: #f48433;
  --tag-news: #2797e7;
  --tag-gear: #b52d81;
  --tag-science: #00a38d;
  --tag-apps: #b536cd;
  --tag-tips: #2aaf6f;
  --tag-finally: #6646f2;
  --text-shade: rgba(10, 3, 3, 0.6);
  --field-shade: rgba(10, 3, 3, 0.6);
  --nav-hover: #d9a94a;
  --band-fg: #ede9e2;
  --band-nav: #d6d0c8;
  --note-gold: #d9a94a;
  --note-gold-text: #060606;
  --field: #ede9e2;
  --field-text: #060606;
  --placeholder: #74675e;
  --input-bg: #141210;
  --input-border: #3a3430;
  --ok: #6fcf97;
  --err: #f08a7a;
  --serif: "Cormorant", "Cormorant Garamond", "EB Garamond", Garamond, Georgia, serif;
  --sans: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
body[data-mode="light"] {
  color-scheme: light;
  --bg: #f7f5f1;
  --fg: #141210;
  --muted: #6e665e;
  --nav: #3b3631;
  --nav-hover: #9a6f16;
  --rule: #dcd6cd;
  --link: #0073c5;
  --note-gold: #8f6512;
  --note-gold-text: #fafafa;
  --tag-note: #2a2622;
  --tag-sponsored: #d8640f;
  --tag-news: #0073c5;
  --tag-gear: #a61c70;
  --tag-science: #00806f;
  --tag-apps: #732582;
  --tag-tips: #198a52;
  --tag-finally: #3d21be;
  --band: #baafa1;
  --band-fg: #141210;
  --band-nav: #2f2a25;
  --text-shade: transparent;
  --field: #ffffff;
  --field-shade: rgba(60, 45, 30, 0.18);
  --input-bg: #ffffff;
  --input-border: #d4cdc2;
  --ok: #1d7a46;
  --err: #a8321f;
}
body[data-mode="light"] .band { background-image: url("band-light-head.webp"); }
body[data-mode="light"] .site-footer { background-image: url("band-light-foot.webp"); }

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; }

.wrap, .wrap-wide {
  box-sizing: content-box;
  max-width: 700px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.wrap-wide { max-width: 1180px; }

main { flex: 1 0 auto; }

/* Nav */
.site-nav { position: relative; z-index: 2; }
.site-nav .wrap-wide {
  padding-block: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}
.home {
  display: flex;
  gap: 11px;
  align-items: center;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.home img { width: 34px; height: 34px; }
/* "by Pasta": smaller, thinner, italic (Tim) */
.home .by { margin-left: 0.08em; font-size: 0.66em; font-style: italic; font-weight: 400; letter-spacing: 0; }
.nav-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nav);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--nav-hover); }
.mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--nav);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s ease;
}
.mode-toggle:hover { color: var(--nav-hover); }
.mode-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mode-toggle svg { width: 19px; height: 19px; }
body[data-mode="light"] .icon-sun, body:not([data-mode="light"]) .icon-moon { display: none; }

/* Textured bands */
.band {
  color: var(--band-fg);
  background: var(--band) url("band-dark-head.webp") center top / cover no-repeat;
}
.band p { text-shadow: 0 1px 16px var(--text-shade); }
.masthead .wrap {
  padding-block: 52px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.preamble {
  margin: 0;
  max-width: 640px;
  font-size: 29px;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}
.subscribe {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  padding: 8px;
  background: var(--field);
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--field-shade);
}
.subscribe input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font: 500 20px/1.2 var(--serif);
  color: var(--field-text);
  background: transparent;
  border: 0;
  border-radius: 5px;
}
.subscribe input::placeholder { color: var(--placeholder); }
.subscribe input:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.subscribe button, .btn {
  flex-shrink: 0;
  padding: 11px 20px;
  font: 600 16px/1.25 var(--sans);
  color: var(--on-gold);
  background: var(--gold);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.subscribe button:hover, .btn:hover { background: var(--gold-hover); }
.subscribe button:focus-visible, .btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.subscribe button[disabled], .btn[disabled] { opacity: 0.6; cursor: progress; }
.subscribe-note { margin: 0; max-width: 500px; font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--band-fg); text-wrap: balance; }
.subscribe-note a { color: var(--nav-hover); }
.subscribe-note.is-ok { font-weight: 700; }
.site-footer .subscribe-note { margin-top: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Issue */
.issue { padding-block: 40px 56px; }
.issue-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 8px 20px;
}
.issue-header img { flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule); }
.issue-header h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
}
.issue-header h1 + p { margin-top: 2px; }
.issue-header p { margin: 0; font-size: 17px; font-weight: 500; color: var(--muted); font-variant-numeric: lining-nums; }
.issue-header sup { font-size: 70%; line-height: 0; }

.sec { --tag: var(--tag-note); --accent: var(--tag); }
.sec.note { --tag: var(--note-gold); --accent: var(--note-gold); }
.sec.note .tag { color: var(--note-gold-text); }
.sec.sponsored { --tag: var(--tag-sponsored); }
.sec.news { --tag: var(--tag-news); }
.sec.gear { --tag: var(--tag-gear); }
.sec.science { --tag: var(--tag-science); }
.sec.apps { --tag: var(--tag-apps); }
.sec.tips { --tag: var(--tag-tips); }
.sec.finally { --tag: var(--tag-finally); }

.tag {
  width: fit-content;
  margin: 48px 0 22px;
  padding: 3px 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tag-text);
  background: var(--tag);
  border-radius: 5px;
}
.item-title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.22;
  text-wrap: balance;
}
.sec a { color: var(--accent); }
.item-title a { color: var(--accent); text-decoration: none; }
.item-title a:hover { text-decoration: underline; }
.sec p { margin: 6px 0 14px; }
.sec ul, .sec ol { margin: 6px 0 14px; padding-left: 1.3em; }
.sec li + li { margin-top: 4px; }
.signoff { font-size: 19px; font-style: italic; color: var(--muted); }
/* Items in a section are separated by space, not rules (Tim). */
.sec .item + .item { margin-top: 28px; }
.sec .item > :last-child { margin-bottom: 0; }
sub { font-size: 70%; line-height: 0; }

/* Draft preview banner (console links only) */
.draft-banner {
  margin: 0;
  padding: 10px max(20px, env(safe-area-inset-left, 0px));
  font: 700 14px/1.4 var(--sans);
  text-align: center;
  color: var(--on-gold);
  background: var(--gold);
}

/* Plain pages: archives, sponsorship, submit, the empty state */
.page { padding-block: 44px 64px; }
.page h1 {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page .lede { margin: 0 0 28px; font-size: 22px; color: var(--muted); font-weight: 500; }
.page h2 { margin: 32px 0 8px; font-size: 25px; font-weight: 700; line-height: 1.22; }
.page p { margin: 6px 0 14px; }
.page a { color: var(--nav-hover); }

/* Archives: like iosdevweekly.com/issues/ */
.archives { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 40px; margin: 8px 0 0; padding: 0; list-style: none; }
.archives li > a { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; color: var(--fg); text-decoration: none; }
.archives h2 { margin: 0; font-size: 23px; font-weight: 700; line-height: 1.2; color: var(--link); }
.archives a:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.archives .date { font-size: 15px; font-weight: 500; text-align: right; color: var(--muted); font-variant-numeric: lining-nums; white-space: nowrap; }
.archives .date sup { font-size: 70%; line-height: 0; }
.archives .summary { grid-column: 1 / -1; margin: 4px 0 0; color: var(--fg); }
.archives .summary.missing { color: var(--muted); font-weight: 500; }
@media (max-width: 768px) { .archives { grid-template-columns: 1fr; } }
.archive-empty { color: var(--muted); font-weight: 500; }
/* Nothing published yet: no masthead band; the message is centred above the footer, which
   sits at the bottom of the window (Tim). */
main.is-empty { display: grid; align-content: center; }
.page-empty { padding-block: 72px; }
.page-empty .lede { margin-bottom: 14px; }

.form { display: grid; gap: 18px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field label { font: 700 14px/1.3 var(--sans); letter-spacing: 0.04em; }
.field .hint { font-size: 17px; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  font: 500 20px/1.35 var(--serif);
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 7px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-status { margin: 0; font-size: 18px; font-weight: 600; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-err { color: var(--err); }
.sent-card { padding: 24px; border: 1px solid var(--rule); border-radius: 10px; }
.sent-card h2 { margin-top: 0; }

/* Footer */
.site-footer { background-image: url("band-dark-foot.webp"); background-position: center; }
.site-footer .wrap {
  padding-block: 48px 52px;
  display: grid;
  grid-template-columns: 5fr 2fr;
  gap: 32px 80px;
  align-items: start;
}
.footer-line { margin: 0 0 18px; font-size: 24px; font-weight: 500; line-height: 1.32; text-wrap: balance; }
.footer-links { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--band-nav);
}
.footer-links a:hover { color: var(--nav-hover); }

@media (max-width: 768px) {
  body { font-size: 20px; }
  .issue-header { flex-direction: column; text-align: center; gap: 14px; }
  .preamble { font-size: 25px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .item-title { font-size: 23px; }
  .home { font-size: 24px; }
  .nav-links { gap: 4px 18px; }
  .nav-links a { font-size: 12px; }
  .footer-links a { font-size: 14px; }
}

/* Previous / next issue */
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); }
.pager a { font: 700 14px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--nav); }
.pager a:hover { color: var(--nav-hover); }
