/* 旁註 Field Notes
   Fraunces © The Undercase, Newsreader © Production Type. Both SIL Open Font License. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/fraunces-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F3F0E7;
  --surface: #E7E1D4;
  --ink: #1F1E1B;
  --muted: #5E5A53;
  --rule: #D5CFC3;
  --yellow: #E2B122;
  --yellow-soft: #F0C94A;
  --serif-display: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif SC", PMingLiU, serif;
  --serif-text: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif SC", PMingLiU, serif;
  --sans: "Avenir Next", "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Microsoft JhengHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 40rem;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
}

img { max-width: 100%; }

h1, h2, h3, h4, p { overflow-wrap: anywhere; }

h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 500;
  line-height: 1.15;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--yellow-soft);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1rem;
  z-index: 40;
  text-decoration: none;
}

.skip:focus { transform: none; }

.thread {
  height: 6px;
  background: var(--yellow);
}

.wrap {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.article-page.wrap {
  width: min(46rem, calc(100% - 2rem));
}

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.mast-row {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-height: 44px;
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  background: var(--yellow);
  align-self: center;
  flex: none;
}

.brand-name {
  font-family: var(--serif-display);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-en {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: none;
  color: var(--muted);
}

.mast-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  align-items: center;
}

.lang-switch a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--muted);
}

.lang-switch a[aria-current="true"] {
  color: var(--ink);
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 calc(100% - 0.7rem);
}

.nav-desktop { display: none; }

.nav-desktop a,
.nav-mobile a,
.filters a {
  font-family: var(--sans);
  text-decoration: none;
  color: var(--ink);
}

.nav-desktop a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-desktop a[aria-current="page"],
.filters a[aria-current="page"] {
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 calc(100% - 0.7rem);
}

.nav-mobile { position: relative; }

.nav-mobile summary {
  list-style: none;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  cursor: pointer;
}

.nav-mobile summary::-webkit-details-marker { display: none; }

.nav-mobile nav {
  position: absolute;
  right: 0;
  top: calc(100% - 0.2rem);
  min-width: 9.5rem;
  padding: 0.25rem 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  z-index: 30;
}

.nav-mobile nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
}

.folio { display: none; }

.kicker, .entry-meta, .essay-meta, .footer-label, figcaption, .endmark {
  font-family: var(--sans);
  color: var(--muted);
}

.kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.kicker a { color: inherit; text-underline-offset: 0.2em; }

.kicker-num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.hero {
  display: grid;
  gap: 2rem;
  padding: 2.25rem 0 1rem;
}

.hero h1 {
  margin: 0.2em 0 0.45em;
  font-size: clamp(1.7rem, 0.72rem + 4.6vw, 4.85rem);
  line-height: 1.12;
  letter-spacing: 0;
  max-width: 12em;
}

.mark {
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-size: 100% 0.28em;
  background-position: 0 86%;
}

.lede, .standfirst {
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.28rem);
  line-height: 1.7;
  max-width: 36rem;
}

.lede { margin: 0 0 0.4rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-family: var(--sans);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
}

.arrow { display: inline-block; transition: transform 180ms ease; }

.hero-figure { margin: 0; }

a.hero-frame {
  display: block;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--surface);
}

a.hero-frame img,
.hero-plate {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-plate {
  background:
    linear-gradient(var(--yellow), var(--yellow)) 1.25rem 1.25rem / 4.5rem 0.45rem no-repeat,
    var(--surface);
}

.hero-figure figcaption {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.75rem;
}

.hero-figure strong {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--ink);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 2.5rem 0 0.25rem;
}

.section-head h2,
.letter h2,
.page-head h1 {
  font-family: var(--serif-display);
  font-weight: 500;
}

.section-head h2,
.letter h2 { font-size: 1.65rem; margin: 0; }

.page-head { padding-top: 1.5rem; }

.page-head h1 {
  margin: 0.2em 0;
  font-size: clamp(2.5rem, 1.3rem + 4vw, 4.6rem);
  line-height: 1.02;
}

.page-head .lede { margin-top: 0.4rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin: 0.5rem 0 0.25rem;
}

.filters a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.35rem;
  color: var(--muted);
}

.filters a[aria-current="page"] { color: var(--ink); }

.entries {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.entry { border-top: 1px solid var(--rule); }
.entry:last-child { border-bottom: 1px solid var(--rule); }

.entry-link {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "media media"
    "index body";
  gap: 0.75rem 0.9rem;
  padding: 1.15rem 0;
  text-decoration: none;
  color: inherit;
}

.entry-media {
  grid-area: media;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--surface);
}

.entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 180ms ease;
}

.entry-plate {
  background:
    linear-gradient(var(--yellow), var(--yellow)) 1rem calc(100% - 1rem) / 2.4rem 0.4rem no-repeat,
    var(--surface);
}

.entry-index {
  grid-area: index;
  font-family: var(--serif-display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 0.15rem;
}

.entry-body { grid-area: body; min-width: 0; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.8rem;
  margin: 0;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.entry-title {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.9rem);
  line-height: 1.2;
}

.entry-summary {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.letter {
  display: grid;
  gap: 0.8rem;
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.letter p {
  margin: 0 0 0.9rem;
  max-width: 40rem;
}

.crumbs { padding-top: 1.1rem; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.crumbs a { color: var(--muted); }

.crumbs li + li::before {
  content: "/";
  margin: 0 0.45rem;
  color: var(--rule);
}

.essay-head,
.prose,
.endmark,
.essay-nav,
.back-row,
.article-page .crumbs {
  width: min(100%, var(--measure));
  margin-inline: auto;
}

.essay-head { padding-top: 1.4rem; }

.essay-head h1 {
  margin: 0.28em 0 0.4em;
  font-size: clamp(2.05rem, 1.25rem + 2.8vw, 3.7rem);
  line-height: 1.12;
}

.standfirst { margin: 0 0 1rem; }

.essay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.essay-cover {
  margin: 1.6rem 0 0.4rem;
}

.essay-cover img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface);
}

.essay-cover figcaption {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.prose {
  margin-top: 1.8rem;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.9;
}

.prose[lang="en"] {
  line-height: 1.7;
  font-size: 1.1875rem;
}

.prose p { margin: 0 0 1.05em; }

.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.25;
  margin: 1.8em 0 0.55em;
}

.prose h2 { font-size: clamp(1.5rem, 1.25rem + 0.7vw, 2rem); }
.prose h3 { font-size: 1.35rem; }
.prose h4 { font-size: 1.15rem; }

.prose a {
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.prose ul,
.prose ol { margin: 0 0 1.1em; padding-left: 1.2rem; }

.prose li + li { margin-top: 0.35em; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 2px solid var(--yellow);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose[lang="en"] blockquote { font-style: italic; }

.prose hr {
  width: 3rem;
  height: 2px;
  margin: 2rem 0;
  border: 0;
  background: var(--yellow);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.08em 0.32em;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.2em;
  padding: 1rem 1.05rem;
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose figure { margin: 1.6rem 0; }
.prose figure img { width: 100%; height: auto; display: block; }
.prose figcaption { margin-top: 0.45rem; font-size: 0.8rem; }

.endmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 2.8rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
}

.endmark i {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--yellow);
  display: block;
}

.essay-nav {
  display: grid;
  gap: 0.5rem;
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-top: 0.4rem;
}

.essay-nav a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-height: 44px;
  padding: 0.7rem 0;
  text-decoration: none;
}

.essay-nav small {
  font-family: var(--sans);
  color: var(--muted);
  letter-spacing: 0.08em;
}

.essay-nav strong {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.2rem;
}

.back-row { margin: 0.4rem auto 3rem; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 1.5rem 0 3rem;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

.pager ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pager a,
.pager span {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
}

.pager [aria-current="page"] { background: var(--yellow-soft); }

.empty {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--rule);
}

.empty-title {
  margin: 0 0 0.4rem;
  font-family: var(--serif-display);
  font-size: clamp(1.8rem, 1.3rem + 1.5vw, 2.6rem);
  font-weight: 500;
}

.empty p:last-child { margin: 0; color: var(--muted); max-width: 28rem; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

.footer-name {
  margin: 0 0 0.35rem;
  font-family: var(--serif-display);
  font-size: 1.4rem;
}

.footer-grid p { margin: 0; max-width: 28rem; }

.footer-label {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 1rem;
  font-family: var(--sans);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-footer a:hover { border-bottom-color: var(--yellow); }

@media (max-width: 479px) {
  .brand-en { display: none; }
}

@media (min-width: 768px) {
  .wrap { width: min(72rem, calc(100% - 4rem)); }
  .article-page.wrap { width: min(52rem, calc(100% - 4rem)); }
  .nav-desktop { display: flex; gap: 1.35rem; }
  .nav-mobile { display: none; }
  .entry-link {
    grid-template-columns: 3.2rem 11.5rem minmax(0, 1fr);
    grid-template-areas: "index media body";
    align-items: center;
    gap: 1.15rem 1.35rem;
  }
  .essay-nav { grid-template-columns: 1fr 1fr; }
  .essay-nav .older { text-align: right; }
  .essay-nav .older a { align-items: flex-end; }
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr; align-items: start; }
  .letter {
    grid-template-columns: 0.7fr 1.3fr;
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
    grid-template-areas:
      "kicker kicker"
      "title title"
      "copy figure";
    column-gap: 3.5rem;
    row-gap: 0;
    align-items: end;
    padding: 3.2rem 0 1.5rem;
  }
  .hero > .kicker { grid-area: kicker; }
  .hero > h1 { grid-area: title; }
  .hero-copy { grid-area: copy; align-self: start; padding-top: 0.4rem; }
  .hero-figure { grid-area: figure; }
}

@media (min-width: 1100px) {
  .article-page.wrap { width: min(52rem, calc(100% - 4rem)); }
}

@media (min-width: 1440px) {
  .wrap { width: min(76rem, calc(100% - 8rem)); }
  .folio {
    display: block;
    position: fixed;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    margin: 0;
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: none;
    color: var(--muted);
    pointer-events: none;
  }
}

@media (hover: hover) {
  .text-link:hover .arrow,
  .section-head .text-link:hover .arrow { transform: translateX(4px); }
  .entry-link:hover .entry-title {
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.12em;
  }
  .entry-link:hover img,
  a.hero-frame:hover img { transform: scale(1.03); }
  .prose a:hover { text-decoration-color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .thread, .mast, .folio, .filters, .pager, .nav-mobile, .text-link .arrow { display: none !important; }
  body { background: #fff; color: #000; }
  .prose, .essay-head { max-width: none; }
  a { text-decoration: underline; }
}
