/* ============================================================
   dwzhou.com — single hand-built theme
   Light, editorial, two-column on desktop, single column on mobile.
   ============================================================ */

/* ---------- Self-hosted serif (Adobe Caslon Pro) ----------
   font-display: swap renders a fallback serif until the woff2 loads,
   so first paint isn't blocked. */
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-SemiboldItalic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Adobe Caslon Pro";
  src: url("/assets/fonts/ACaslonPro-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --accent: #185FA5;
  --accent-soft: #185FA51A;       /* ~10% accent for tints */
  --ink: #1a1a1a;                 /* main text */
  --ink-muted: #5a5a5a;           /* secondary text */
  --ink-faint: #8a8a8a;           /* metadata, dates */
  --rule: #e6e6e6;                /* borders */
  --bg: #fcfbf8;                  /* warm light background */
  --bg-card: #ffffff;
  --bg-soft: #f3f1ec;             /* photo placeholders */

  --serif: "Adobe Caslon Pro", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max-width: 880px;             /* main content max width */
  --sidebar-width: 200px;
  --gutter: 48px;
}

/* ---------- Reset (light) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Base typography ---------- */
body {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

/* ---------- Page grid ---------- */
.page {
  max-width: calc(var(--sidebar-width) + var(--gutter) + var(--max-width));
  margin: 0 auto;
  padding: 64px 32px 96px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  column-gap: var(--gutter);
  row-gap: 64px;
  align-items: start;
}

/* On mobile, collapse to a single column */
@media (max-width: 720px) {
  .page {
    grid-template-columns: 1fr;
    padding: 32px 20px 64px;
    row-gap: 40px;
  }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 48px;
  align-self: start;
}

@media (max-width: 720px) {
  .sidebar { position: static; }
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  text-decoration: none;
}
.avatar:hover { text-decoration: none; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Fallback if you ever go back to initials (used as text inside .avatar) */
.avatar-initials { display: inline-block; }

.name {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 4px;
  line-height: 1.2;
}
.name a { color: var(--ink); }
.name a:hover { text-decoration: none; color: var(--accent); }

.role {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
}
.sidebar-nav a {
  color: var(--ink-muted);
  padding: 2px 0;
}
.sidebar-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Main content area ---------- */
.content {
  min-width: 0; /* allow children to shrink within grid */
}

/* Section spacing */
.content > section { margin-bottom: 64px; }
.content > section:last-of-type { margin-bottom: 0; }

/* Section headings */
.section-heading {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.section-sub {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-muted);
  margin: -12px 0 24px;
}

/* ---------- Hero / bio block ---------- */
.bio {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 20px;
  max-width: 60ch;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--bg-card);
  transition: border-color 120ms ease, color 120ms ease;
}
.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---------- Highlights cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.card-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-title {
  font-family: var(--serif);
  font-size: 23px;
  margin: 0;
}
.card-desc {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}
.card-badge {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-faint);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.02em;
}

/* ---------- Timeline (log on home + log page) ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 24px 1fr;
  column-gap: 12px;
  padding-bottom: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  padding-top: 4px;
  text-align: right;
}

.timeline-marker {
  position: relative;
  display: flex;
  justify-content: center;
}
.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
  z-index: 1;
}
.timeline-line {
  position: absolute;
  top: 8px;
  bottom: -28px;
  left: 50%;
  width: 1px;
  background: var(--rule);
  transform: translateX(-50%);
}
.timeline-item:last-child .timeline-line { display: none; }

.timeline-body { padding-top: 0; }
.timeline-title {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 4px;
  line-height: 1.3;
}
.timeline-title a { color: var(--ink); }
.timeline-title a:hover { color: var(--accent); text-decoration: none; }
.timeline-desc {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 6px;
  line-height: 1.5;
}
.timeline-tags { margin: 4px 0 0; }

@media (max-width: 720px) {
  .timeline-item { grid-template-columns: 64px 18px 1fr; }
  .timeline-date { font-size: 11px; }
}

/* ---------- Tag pills ---------- */
.tag-pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  margin-right: 4px;
}

/* All entries link */
.section-foot {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 13px;
}
.section-foot a { color: var(--accent); }

/* ---------- Photos grid ---------- */
.photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 720px) {
  .photos { grid-template-columns: repeat(2, 1fr); }
}

.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
  display: block;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 200ms ease;
}
.photo:hover img { transform: scale(1.02); }

/* The "soon" placeholder cell — only rendered when no photos exist yet */
.photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-faint);
}

/* --- Photos gallery page (/photos/) ---
   Larger images, visible captions below each. */
.photos-gallery {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
}
@media (max-width: 720px) {
  .photos-gallery { grid-template-columns: repeat(2, 1fr); }
}

.photo-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.photo-caption {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* ---------- Reading list ----------
   Title (serif) + date (sans, muted) per row. Synced from Notion via
   bin/sync-notion.py into _data/reading.yml. */
.reading-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.reading-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.reading-item:last-child { border-bottom: 0; }

.reading-title {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}
.reading-title:hover { color: var(--accent); text-decoration: none; }

.reading-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .reading-item {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
}

/* ---------- Post page ---------- */
.post-content { max-width: 68ch; }

.post-meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.post-title {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 24px;
}
.post-body {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.7;
  color: var(--ink);
}
.post-body h2 { font-size: 26px; margin-top: 1.6em; }
.post-body h3 { font-size: 22px; margin-top: 1.4em; }
.post-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 1em 0;
  padding: 0 0 0 16px;
  color: var(--ink-muted);
  font-style: italic;
}
.post-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
}
.post-body pre {
  background: var(--bg-soft);
  padding: 16px;
  overflow-x: auto;
  border-radius: 4px;
  font-size: 14px;
}
.post-body pre code { background: none; padding: 0; }

.post-back {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
}

/* ---------- Footer ---------- */
.site-footer {
  grid-column: 1 / -1;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: left;
}
.site-footer p { margin: 0; }

/* ---------- Page header (used on /log/) ---------- */
.page-header { margin-bottom: 32px; }
