/* ==========================================================================
   Editorial design system — applies to the whole site (home, articles,
   about, contact, archive, projects, 404, podcast redirect page).
   Scope: #ye-blog / body.ye-site only. Do not leak into legacy selectors.
   ========================================================================== */

/* --- Host reset: neutralise legacy global body rules (styles.css has
   `body{padding:50px;font:13px Menlo...}`), applied site-wide now. --- */
body.ye-site {
  --ye-paper: #FAF9F6;
  --ye-ink: #202C2A;
  --ye-soft: #586460;
  --ye-line: #D8DED9;
  --ye-link: #176348;
  --ye-wash: #EDF2ED;

  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--ye-paper);
  color: var(--ye-ink);
  font: 16px/1.65 system-ui, sans-serif;
  font-weight: 400;
}

@media (prefers-color-scheme: dark) {
  body.ye-site {
    --ye-paper: #171C1B;
    --ye-ink: #E7ECE8;
    --ye-soft: #A5B1AC;
    --ye-line: #3A4742;
    --ye-link: #92CFB5;
    --ye-wash: #222E29;
  }
}

/* Respect the site's existing (currently dormant) dark-mode class hook,
   without adding a new theme switcher to the nav. */
body.ye-site.dark-mode {
  --ye-paper: #171C1B;
  --ye-ink: #E7ECE8;
  --ye-soft: #A5B1AC;
  --ye-line: #3A4742;
  --ye-link: #92CFB5;
  --ye-wash: #222E29;
}

/* --- Skip link (keyboard accessibility) --- */
.ye-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ye-link);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  font: 14px system-ui, sans-serif;
}
.ye-skip-link:focus {
  left: 8px;
  top: 8px;
}

/* --- Container --- */
#ye-blog {
  width: 100%;
  max-width: 1024px;
  margin-inline: auto;
  box-sizing: border-box;
  padding: 30px 48px;
  min-height: 690px;
}
#ye-blog * {
  box-sizing: border-box;
}

#ye-blog a {
  color: var(--ye-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
#ye-blog a:focus-visible,
#ye-blog button:focus-visible {
  outline: 2px solid var(--ye-link);
  outline-offset: 5px;
}

/* --- Header --- */
.ye-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--ye-line);
  padding-bottom: 20px;
}
.ye-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--ye-ink);
  text-decoration: none;
  padding: 8px 0;
}
.ye-name .ye-dot {
  color: var(--ye-link);
}
.ye-header nav {
  display: flex;
  gap: 22px;
  font-size: 16px;
}
.ye-header nav a {
  color: var(--ye-ink);
  text-decoration: none;
  padding: 8px 0;
}
.ye-header nav a[aria-current="page"] {
  color: var(--ye-link);
  text-decoration: underline;
  text-underline-offset: 8px;
}
.ye-header nav a.ye-external {
  color: var(--ye-link);
}

/* --- Intro / hero --- */
.ye-intro {
  padding: 45px 0 36px;
  max-width: 740px;
}
.ye-kicker {
  font: 12px/1.5 ui-monospace, monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ye-soft);
}
#ye-blog h1 {
  font: 400 clamp(32px, 5vw, 49px) / 1.15 Georgia, serif;
  letter-spacing: -1.1px;
  margin: 14px 0 18px;
  color: var(--ye-ink);
}
.ye-lead {
  font-size: 18px;
  line-height: 1.65;
  max-width: 640px;
  margin: 0;
  color: var(--ye-soft);
}

/* --- Editorial grid --- */
.ye-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  column-gap: 50px;
}

.ye-feature {
  border-top: 2px solid var(--ye-link);
  padding-top: 22px;
}
.ye-label {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ye-soft);
  margin-bottom: 14px;
}
#ye-blog .ye-feature h2 {
  font: 400 25px/1.3 Georgia, serif;
  letter-spacing: -0.35px;
  margin: 0 0 10px;
  color: var(--ye-ink);
}
.ye-feature p {
  color: var(--ye-soft);
  margin: 10px 0 15px;
}
.ye-read {
  display: inline-block;
  color: var(--ye-link);
  text-decoration: underline;
  text-underline-offset: 5px;
  padding: 8px 0;
}

.ye-archive {
  margin-top: 30px;
}
#ye-blog .ye-archive h3 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  margin: 0 0 12px;
  color: var(--ye-ink);
}
.ye-row {
  border-top: 1px solid var(--ye-line);
  padding: 15px 0;
  display: flex;
  gap: 20px;
  align-items: baseline;
}
.ye-date {
  font: 12px ui-monospace, monospace;
  color: var(--ye-soft);
  min-width: 38px;
  flex-shrink: 0;
}
.ye-row a {
  color: var(--ye-ink);
  text-decoration: none;
}
.ye-row a:hover,
.ye-row a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ye-row .ye-status {
  color: var(--ye-soft);
}

/* --- Right column --- */
#ye-blog aside {
  border-left: 1px solid var(--ye-line);
  padding-left: 25px;
}
#ye-blog aside h3 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  margin: 0 0 12px;
  color: var(--ye-ink);
}
#ye-blog aside p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ye-soft);
  margin: 0 0 18px;
}
.ye-topics {
  margin-top: 24px;
  list-style: none;
  padding: 0;
  font-size: 14px;
  color: var(--ye-soft);
}
.ye-topics li {
  padding: 5px 0;
}

/* --- Footer --- */
#ye-blog > footer {
  border-top: 1px solid var(--ye-line);
  margin-top: 32px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ye-soft);
}
#ye-blog > footer a {
  padding: 8px 0;
}

/* --- Article / generic content pages (posts, about, contact, archive,
   projects, paginator). Reuses the same tokens and container as the home. --- */
.ye-article {
  max-width: 680px;
  margin: 30px auto;
  padding-top: 22px;
  border-top: 2px solid var(--ye-link);
}
#ye-blog .ye-article h1 {
  font: 400 clamp(28px, 4vw, 40px) / 1.2 Georgia, serif;
  letter-spacing: -0.8px;
  margin: 10px 0 24px;
  color: var(--ye-ink);
}
.ye-article .ye-kicker {
  margin-bottom: 6px;
}
.ye-article-body {
  font: 18px/1.8 Georgia, serif;
  color: var(--ye-ink);
}
.ye-article-body p,
.ye-article-body ul,
.ye-article-body ol {
  margin: 0 0 18px;
}
.ye-article-body ul,
.ye-article-body ol {
  padding-left: 22px;
}
.ye-article-body h2,
.ye-article-body h3 {
  font: 400 22px/1.3 Georgia, serif;
  letter-spacing: -0.3px;
  margin: 34px 0 14px;
  color: var(--ye-ink);
}
.ye-article-body a {
  color: var(--ye-link);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ye-article-body blockquote {
  border-left: 2px solid var(--ye-line);
  margin: 0 0 18px;
  padding-left: 16px;
  color: var(--ye-soft);
  font-style: italic;
}
.ye-article-body img {
  max-width: 100%;
  height: auto;
}
.ye-article-body pre {
  background: var(--ye-wash);
  padding: 14px 16px;
  overflow-x: auto;
  font: 14px/1.5 ui-monospace, monospace;
}
.ye-article-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}
.ye-article-body pre code {
  font-size: 1em;
}

#paginator {
  display: flex;
  justify-content: space-between;
  max-width: 680px;
  margin: 20px auto 0;
  font-size: 14px;
}
#paginator a {
  color: var(--ye-link);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --- Mobile (<=640px) --- */
@media (max-width: 640px) {
  #ye-blog {
    padding: 20px 22px;
  }
  .ye-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ye-name {
    font-size: 20px;
  }
  .ye-header nav {
    flex-wrap: wrap;
  }
  .ye-intro {
    padding: 32px 0;
  }
  .ye-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  #ye-blog aside {
    border-left: 0;
    border-top: 1px solid var(--ye-line);
    padding-left: 0;
    padding-top: 22px;
  }
  .ye-article {
    margin: 20px auto;
  }
  .ye-article-body {
    font-size: 17px;
  }
  /* Touch targets ~44px tall on mobile only; desktop geometry untouched. */
  .ye-header nav a,
  .ye-name,
  .ye-read,
  #ye-blog > footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Explicit check range around the breakpoint (641px): no layout-breaking
   change needed above 640px, grid stays 2 columns as soon as viewport > 640px. */
