/* writing.css — shared styles for /writing index and individual article pages
 * Served as a static asset by Cloudflare. Edit here; no build script run needed.
 * Linked in both buildIndexPage() and buildArticlePage() inside build-writing.js.
 */

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Base ───────────────────────────────────────────────────────────────── */
body {
  background: #F5F2ED;
  color: #2a2a2a;
  font-family: 'DM Sans', sans-serif;
  padding-top: 80px;
  padding-bottom: 48px;
  padding-left: 24px;
  padding-right: 24px;
}

/* ─── Index layout ───────────────────────────────────────────────────────── */
.layout { max-width: 960px; margin: 0 auto; display: flex; gap: 48px; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: flex-start;
}

.sidebar-heading {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 16px;
}

.cat-link {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.cat-link:hover { color: #1a1a1a; }
.cat-link.active {
  border-left-color: #c8f135;
  color: #1a1a1a;
  font-weight: 600;
  padding-left: 8px;
}

.main { flex: 1; max-width: 680px; }

/* ─── Back link ──────────────────────────────────────────────────────────── */
.back {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #888;
  text-decoration: none;
  display: block;
  margin-bottom: 24px;
}
.back:hover { color: #2a2a2a; }

/* ─── Index heading — intentionally modest; this is a list, not a hero ──── */
.layout h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #1a1a1a;
  margin-bottom: 24px;
}

/* ─── Article list items ─────────────────────────────────────────────────── */
.article { margin-bottom: 36px; }

.date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.title {
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
}
.title:hover { text-decoration: underline; }

.desc { font-size: 15px; color: #555; margin-top: 6px; line-height: 1.5; }

/* ─── Article page layout ────────────────────────────────────────────────── */
.wrap { max-width: 680px; margin: 0 auto; }

.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #c8f135;
  text-transform: uppercase;
  margin-bottom: 16px;
  background: #1a1a1a;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
}

/* Article h1 is the article title — should be large */
.wrap h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #1a1a1a;
  margin-bottom: 40px;
}

/* ─── Article body ───────────────────────────────────────────────────────── */
.body p  { font-size: 17px; line-height: 1.75; margin-bottom: 24px; }
.body h2 { font-size: 22px; font-weight: 600; margin: 40px 0 16px; }
.body h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; }
.body blockquote {
  border-left: 3px solid #c8f135;
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  color: #555;
}
.body pre {
  background: #1a1a1a;
  color: #f0ede8;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
}
.body hr { border: none; border-top: 1px solid #ddd; margin: 40px 0; }
.body ul, .body ol { padding-left: 24px; margin-bottom: 24px; }
.body li { font-size: 17px; line-height: 1.75; margin-bottom: 8px; }
.body a { color: #2a2a2a; text-decoration: underline; text-underline-offset: 3px; }
.body a:hover { color: #35996A; }

/* ─── Share bar ──────────────────────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #ddd;
  flex-wrap: wrap;
}
.share-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-right: 4px;
}
.share-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #2a2a2a;
  text-decoration: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.share-btn:hover { border-color: #35996A; color: #35996A; }
.share-copy { background: #fff; }

/* ─── Related articles ───────────────────────────────────────────────────── */
.related { margin-top: 48px; padding-top: 40px; border-top: 1px solid #ddd; }
.related-heading {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 24px;
}
.related-item { margin-bottom: 28px; }
.related-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.related-title { font-size: 17px; font-weight: 500; color: #1a1a1a; text-decoration: none; }
.related-title:hover { text-decoration: underline; }
.related-desc { font-size: 14px; color: #666; margin-top: 5px; line-height: 1.5; }

/* ─── Author bio ─────────────────────────────────────────────────────────── */
.author-bio {
  border-top: 1px solid #ddd;
  margin-top: 48px;
  padding-top: 48px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.author-bio img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-bio .info { display: flex; flex-direction: column; }
.author-bio .name { font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600; color: #1a1a1a; margin-bottom: 4px; }
.author-bio .bio-text { font-size: 14px; line-height: 1.5; color: #555; margin-bottom: 6px; }
.author-bio .linkedin { font-family: 'DM Mono', monospace; font-size: 11px; color: #888; text-decoration: none; }
.author-bio .linkedin:hover { color: #2a2a2a; }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .layout { flex-direction: column; gap: 24px; }
  .sidebar {
    width: 100%;
    position: static;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    flex-wrap: wrap;
  }
  .sidebar-heading { margin-bottom: 0; margin-right: 12px; white-space: nowrap; }
  .cat-link {
    display: inline-block;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 6px 12px;
    margin-bottom: 0;
  }
  .cat-link.active { border-left-color: transparent; border-bottom-color: #c8f135; }
}
