/* The Sunfly
   A two-ink newspaper: everything is printed in blue ink and orange ink on
   white stock, slightly out of register, with press grain over the top. */

@font-face {
  font-family: "Bowlby One";
  src: url("fonts/bowlby-one-latin-400-normal.1091c6be388e.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-opsz-normal.069cb90e11a3.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-opsz-italic.fa7ce081be5e.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --paper: #fffefb;
  --ink: #16207a;          /* blue ink: all text */
  --blue: #2b50e8;
  --orange: #ff6a13;
  --blue-wash: #e9eeff;
  --orange-wash: #ffe7d6;
  --rule: 3px solid var(--ink);
  --display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

/* Press grain over the whole sheet. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
  opacity: .34;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .13 0 0 0 0 .48 0 0 0 .9 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 200; background: var(--paper); padding: .5rem 1rem; }

/* ---- Top strip --------------------------------------------------------- */

.strip { background: var(--blue); color: #fff; font-size: .9rem; font-weight: 500; }
.strip .wrap { display: flex; justify-content: space-between; gap: 1rem; padding-block: .35rem; }
.strip a { color: #fff; }

/* ---- Masthead ---------------------------------------------------------- */

.masthead { text-align: center; padding: 1.5rem 0 1.1rem; position: relative; overflow: hidden; }
/* halftone fade bleeding in from both edges */
.masthead::before, .masthead::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 34%;
  background-image: radial-gradient(var(--orange) 34%, transparent 36%);
  background-size: 9px 9px;
  pointer-events: none;
}
.masthead::before { left: 0; -webkit-mask-image: linear-gradient(90deg, #000, transparent); mask-image: linear-gradient(90deg, #000, transparent); }
.masthead::after { right: 0; -webkit-mask-image: linear-gradient(270deg, #000, transparent); mask-image: linear-gradient(270deg, #000, transparent); }

.masthead a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: clamp(.5rem, 2vw, 1.25rem);
  color: var(--ink); text-decoration: none;
}
.masthead img { width: clamp(4rem, 13vw, 8.5rem); height: auto; flex: none; }
.masthead .name {
  font-family: var(--display);
  font-size: clamp(2.6rem, 11vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.01em;
  /* second ink, printed out of register */
  text-shadow: .055em .055em 0 var(--orange);
}
.masthead a:hover .name { text-shadow: -.055em .055em 0 var(--orange); }

.nav { border-top: var(--rule); border-bottom: var(--rule); }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 clamp(1rem, 4vw, 2.75rem);
}
.nav a {
  display: block; padding: .55rem .15rem;
  font-family: var(--display); font-size: 1.02rem; letter-spacing: .02em;
  color: var(--ink); text-decoration: none;
}
.nav a:hover { color: var(--orange); }
.nav a[aria-current="page"] { box-shadow: inset 0 -.5rem 0 var(--orange); }

main { flex: 1; padding: clamp(1.5rem, 4vw, 3rem) 0 4rem; }

/* ---- Shared type ------------------------------------------------------- */

.headline {
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 .35em;
  text-wrap: balance;
}
.headline a { color: inherit; text-decoration: none; }
.headline a:hover { color: var(--blue); }

.dek {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.35; font-style: italic; font-weight: 400;
  margin: 0 0 1.25rem; max-width: 48ch;
}

/* Fraunces swaps in swashy "wonky" italics at display sizes; hold italics at
   the text cut so long italic passages stay easy to read. */
em, i, .dek, .prose blockquote, .role, .by, figcaption { font-optical-sizing: none; font-variation-settings: "opsz" 14; }

.page-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05;
  margin: 0 0 .4em;
  text-shadow: .05em .05em 0 var(--orange);
}
.page-intro { max-width: 52ch; margin: 0 0 2rem; font-size: 1.2rem; }

.byline { display: flex; align-items: center; gap: .85rem; margin: 0 0 1.75rem; line-height: 1.3; }
.byline .who { font-weight: 700; }
.byline .who a { color: var(--ink); }
.byline .who a:hover { color: var(--orange); }
.byline .meta { font-size: .95rem; }

.badge {
  display: inline-block; margin-bottom: .9rem; padding: .15rem .7rem;
  background: var(--orange); color: var(--ink);
  font-family: var(--display); font-size: .95rem;
  box-shadow: 4px 4px 0 var(--ink);
}
.badge.draft { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--orange); }

/* Portraits print as blue duotones. */
.portrait {
  position: relative; display: block; flex: none; overflow: hidden;
  aspect-ratio: 1; background: var(--blue-wash);
  border: var(--rule);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); }
.portrait.photo::after {
  content: ""; position: absolute; inset: 0;
  background: var(--blue); mix-blend-mode: lighten;
}
.portrait.bug img { filter: none; object-fit: contain; padding: 8%; }
.portrait.small { width: 3.25rem; border-radius: 50%; border-width: 2px; }

/* ---- Essay body -------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; hanging-punctuation: first; }
.prose h2 { font-weight: 800; font-size: 1.6rem; line-height: 1.2; margin: 2em 0 .6em; }
.prose h3 { font-weight: 800; font-size: 1.25rem; margin: 1.75em 0 .5em; }
.prose blockquote {
  margin: 1.75em 0; padding: 0 0 0 1.25rem;
  border-left: .5rem solid var(--orange);
  font-size: 1.4rem; line-height: 1.35; font-style: italic; font-weight: 500;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 9px; margin: 2.5em auto; width: 8rem;
  background-image: radial-gradient(var(--orange) 34%, transparent 36%); background-size: 9px 9px; }
.prose img { margin: 1.5em 0; border: var(--rule); }
.prose li { margin-bottom: .4em; }

.dropcap > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 400;
  float: left; font-size: 4em; line-height: .8;
  padding: .04em .09em 0 0;
  color: var(--orange); text-shadow: .04em .04em 0 var(--ink);
}

.figure { margin: 0 0 1.75rem; }
.figure img { width: 100%; border: var(--rule); box-shadow: 8px 8px 0 var(--orange); }
.figure figcaption { font-size: .92rem; margin-top: 1rem; font-style: italic; }

.button {
  display: inline-block; padding: .6rem 1.2rem;
  font-family: var(--display); font-size: 1rem; text-decoration: none;
  background: var(--blue); color: #fff;
  border: var(--rule); box-shadow: 5px 5px 0 var(--orange);
}
.button:hover { color: #fff; background: var(--ink); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--orange); }

/* ---- Home -------------------------------------------------------------- */

.front { display: grid; gap: 3rem; }
@media (min-width: 60rem) {
  .front { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; }
}

.earlier { align-self: start; background: var(--blue-wash); border: var(--rule); box-shadow: 8px 8px 0 var(--blue); padding: 1.25rem 1.25rem .5rem; }
.earlier h2 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin: 0 0 .75rem; }
.earlier ol { list-style: none; margin: 0; padding: 0; }
.earlier li { border-top: 2px solid var(--ink); padding: .8rem 0; line-height: 1.3; }
.earlier time { display: block; font-size: .88rem; font-weight: 600; color: var(--blue); }
.earlier li a { font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none; }
.earlier li a:hover { color: var(--orange); }
.earlier .by { display: block; font-size: .92rem; font-style: italic; }
.earlier .all { display: block; border-top: 2px solid var(--ink); padding: .8rem 0; font-weight: 700; }

.empty { max-width: 40rem; margin: 2rem auto; text-align: center; }
.empty img { width: 11rem; margin: 0 auto 1rem; }

/* ---- Archive ----------------------------------------------------------- */

.month { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 2.5rem 0 0; padding-bottom: .4rem; border-bottom: var(--rule); }
.listing { list-style: none; margin: 0; padding: 0; }
.listing li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0 1.25rem; padding: 1.1rem 0; border-bottom: 2px solid var(--blue-wash); }
.listing .day { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--orange); text-shadow: 2px 2px 0 var(--ink); }
.listing .weekday { display: block; font-family: var(--serif); font-size: .85rem; font-weight: 600; color: var(--ink); text-shadow: none; margin-top: .35rem; }
.listing h3 { margin: 0 0 .2rem; font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.listing h3 a { color: var(--ink); text-decoration: none; }
.listing h3 a:hover { color: var(--orange); }
.listing p { margin: 0; line-height: 1.4; }
.listing .by { font-size: .95rem; font-style: italic; margin-top: .25rem; }

.pager { display: flex; justify-content: space-between; margin-top: 2rem; font-weight: 700; }

/* ---- Article page ------------------------------------------------------ */

.essay { max-width: 46rem; margin: 0 auto; }
.essay .prose { font-size: 1.2rem; }

.endnote { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start;
  margin-top: 3rem; padding: 1.25rem; background: var(--orange-wash); border: var(--rule); box-shadow: 8px 8px 0 var(--orange); }
.endnote h2 { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.endnote h2 a { color: var(--ink); }
.endnote .role { margin: 0 0 .5rem; font-style: italic; }
.endnote .prose { font-size: 1rem; line-height: 1.5; }
.endnote .prose p:last-child { margin-bottom: 0; }

.neighbours { display: grid; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: var(--rule); }
@media (min-width: 40rem) { .neighbours { grid-template-columns: 1fr 1fr; } .neighbours .next { text-align: right; grid-column: 2; } }
.neighbours span { display: block; font-size: .9rem; font-weight: 600; }
.neighbours a { font-weight: 800; font-size: 1.15rem; line-height: 1.25; color: var(--ink); text-decoration: none; }
.neighbours a:hover { color: var(--orange); }

/* ---- Contributors ------------------------------------------------------ */

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem 2rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.people .portrait { box-shadow: 8px 8px 0 var(--orange); margin-bottom: 1.25rem; }
.people li:nth-child(even) .portrait { box-shadow: 8px 8px 0 var(--blue); }
.people h2 { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.people h2 a { color: var(--ink); text-decoration: none; }
.people h2 a:hover { color: var(--orange); }
.people .role { margin: .1rem 0 .5rem; font-style: italic; }
.people .prose { font-size: 1rem; line-height: 1.5; }

.profile { display: grid; gap: 2rem; margin-bottom: 1rem; }
@media (min-width: 46rem) { .profile { grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; } }
.profile .portrait { box-shadow: 8px 8px 0 var(--orange); max-width: 16rem; }
.profile .role { font-size: 1.25rem; font-style: italic; margin: 0 0 1rem; }

/* ---- Footer ------------------------------------------------------------ */

.foot { border-top: var(--rule); background: var(--blue); color: #fff; font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.1rem; }
.foot a { color: #fff; }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; }

@media (max-width: 30rem) {
  body { font-size: 1.06rem; }
  .strip .tag { display: none; }
  .nav ul { gap: 0 .9rem; }
  .nav a { font-size: .84rem; }
  .endnote { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .listing li { grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 .9rem; }
  .listing .day { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  body::after, .strip, .nav, .foot, .earlier, .neighbours { display: none; }
}
