/* cecilchao.org — quiet archive. System fonts only (no font CDNs: they fail in the Chinese Mainland). */
:root {
  --paper: #f7f3ec;
  --paper-2: #efe8dc;
  --ink: #281e19;
  --ink-2: #5c4d42;
  --rule: #d9cdbb;
  --gold: #a8742f;
  --gold-soft: #bda588;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti TC", "Songti SC", "Noto Serif CJK TC", "Source Han Serif TC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK TC", Helvetica, Arial, sans-serif;
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1613; --paper-2: #241d18; --ink: #efe6da; --ink-2: #bfb0a0;
    --rule: #3d332b; --gold: #d3a466; --gold-soft: #8a7357; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1613; --paper-2: #241d18; --ink: #efe6da; --ink-2: #bfb0a0;
  --rule: #3d332b; --gold: #d3a466; --gold-soft: #8a7357; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--ink); }
h2 { font-size: 1.55rem; margin: 2.6rem 0 0.8rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.6rem 2rem;
  padding: 1.4rem clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.wordmark .zh { color: var(--gold); margin-left: 0.3em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.3rem; font-size: 0.95rem; }
.site-header nav a { color: var(--ink-2); text-decoration: none; padding: 0.2rem 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }

main { padding: 0 clamp(16px, 4vw, 48px) 4rem; max-width: 76rem; margin: 0 auto; }

/* Home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; padding: clamp(2rem, 6vw, 5rem) 0 2.5rem; }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.05; }
.hero h1 span { display: block; }
.hero h1 .zh { color: var(--gold); font-size: 0.82em; margin-top: 0.15em; letter-spacing: 0.08em; }
.hero .dates { margin: 1.2rem 0 0; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; }
.hero-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; align-items: end; }
.hero-photos figure { margin: 0; }
.hero-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; filter: saturate(0.9); }
.intro { font-size: 1.12rem; }
.intro p:first-child { font-family: var(--serif); font-size: 1.4rem; line-height: 1.45; }

.facts { list-style: none; padding: 0; margin: 3rem 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts li { padding: 1.3rem 1rem 1.3rem 0; display: flex; flex-direction: column; gap: 0.2rem; }
.facts li + li { padding-left: 1rem; border-left: 1px solid var(--rule); }
.facts .year { font-family: var(--serif); font-size: 2rem; color: var(--gold); line-height: 1; }
.facts span:last-child { color: var(--ink-2); font-size: 0.95rem; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card { display: block; padding: 1.3rem; background: var(--paper-2); color: var(--ink); text-decoration: none; border-top: 2px solid var(--gold-soft); }
.card:hover { border-top-color: var(--gold); color: var(--ink); }
.card p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* Text pages */
.page-head { padding: clamp(2rem, 5vw, 4rem) 0 0.5rem; max-width: var(--measure); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0; }
.lede { color: var(--ink-2); }
.prose { max-width: var(--measure); }
.prose h2:first-child { margin-top: 1.5rem; }
.prose blockquote { margin: 2rem 0; padding: 0 0 0 1.2rem; border-left: 2px solid var(--gold); font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 2rem; font-size: 0.97rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 1rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; color: var(--ink-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.prose td:first-child { white-space: nowrap; font-family: var(--serif); color: var(--gold); }
.prose ul { padding-left: 1.2rem; }

/* Photographs */
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 1rem; }
.gallery-section { scroll-margin-top: 1rem; }
.gallery { columns: 3 16rem; column-gap: 1.2rem; }
.gallery figure { break-inside: avoid; margin: 0 0 1.4rem; }
.gallery img { width: 100%; background: var(--paper-2); }
.gallery figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.45rem; }
.gallery .note { margin: 0.4rem 0 0; font-size: 0.88rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule); padding: 2rem clamp(16px, 4vw, 48px) 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; color: var(--ink-2); font-size: 0.9rem;
}
.site-footer p { margin: 0 0 0.3rem; }
.foot-name { font-family: var(--serif); color: var(--ink); font-size: 1.05rem; }
.foot-links { display: flex; gap: 1.2rem; align-items: flex-start; }
.updated { width: 100%; font-size: 0.82rem; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .facts, .cards { grid-template-columns: 1fr 1fr; }
  .facts li:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
}

/* Featured photo: full width, never cropped */
.gallery-section .feature { margin: 0 0 1.6rem; }
.gallery-section .feature img { width: 100%; }
.gallery-section .feature figcaption { font-size: 1rem; color: var(--ink); margin-top: 0.6rem; max-width: var(--measure); }

/* Single photo page */
.photo-nav { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 1rem; font-size: 0.95rem; }
.photo-full { margin: 0; }
.photo-full img { width: 100%; max-height: 82vh; object-fit: contain; background: var(--paper-2); }
.photo-full figcaption { max-width: var(--measure); margin-top: 1rem; }
.photo-full .cap { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; margin: 0 0 0.8rem; }
.photo-full .zoom { font-size: 0.9rem; }

/* Photos inside page copy: wider than the text column, never cropped */
.prose .inline-photos {
  width: min(64rem, calc(100vw - 2 * clamp(16px, 4vw, 48px)));
  margin: 1.6rem 0 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.2rem; align-items: start;
}
.prose .inline-photos.single { grid-template-columns: 1fr; }
.prose .inline-photos figure { margin: 0; }
.prose .inline-photos img { width: 100%; background: var(--paper-2); }
.prose .inline-photos figcaption { font-size: 0.88rem; color: var(--ink-2); margin-top: 0.45rem; line-height: 1.45; }

/* Green double-C mark */
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; }
.wordmark img { width: 34px; height: 34px; }
.wordmark .zh { margin-left: 0; }
.foot-name { position: relative; padding-left: 52px; min-height: 40px; }
.foot-mark { position: absolute; left: 0; top: 0.1rem; width: 40px; height: 40px; }

/* Language switch */
.site-header nav.lang { gap: 0.2rem 0.7rem; font-size: 0.9rem; }
.site-header nav.lang a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }
:lang(zh-Hant) .prose, :lang(zh-Hans) .prose { line-height: 1.85; }
