/* =====================================================================
   traceyang.com - Custom CSS makeover for GeneratePress
   Non-destructive: restyles type, headings, links, code, callouts,
   tables, images, header/nav, mobile. Remove any block to revert it.
   Apply in: Appearance -> Customize -> Additional CSS
   (ASCII-safe build: arrows use CSS escapes so no encoding can break them)
   ===================================================================== */

/* ---- 1. Design tokens (change main color / fonts here only) --------- */
:root {
  --accent:        #4f46e5;   /* main accent: links + heading marker */
  --accent-dark:   #4338ca;   /* hover / darker */
  --accent-tint:   #eef2ff;   /* light fill: callout bg + table head */
  --ink:           #1c2230;   /* body text */
  --muted:         #5b6472;   /* secondary text: dates, captions */
  --border:        #e6e8ec;   /* hairlines */
  --code-bg:       #f6f8fa;   /* code block bg */
  --measure:       45rem;     /* reading line length */

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
               "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas,
               "Liberation Mono", Menlo, monospace;
}

/* ---- 2. Base typography & reading measure --------------------------- */
body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.entry-content p { margin: 0 0 1.35em; }

/* ---- 3. Links ------------------------------------------------------- */
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.entry-content a:hover { border-bottom-color: var(--accent-dark); }

/* ---- 4. Headings ---------------------------------------------------- */
.entry-content h2, .entry-content h3, .entry-content h4 {
  font-weight: 700; letter-spacing: -.01em; line-height: 1.3; color: var(--ink);
  text-align: left;   /* keep headings left-aligned with the body */
}
.entry-content h2 {
  font-size: 1.6em; margin: 2.2em 0 .7em;
  padding-bottom: .3em; border-bottom: 1px solid var(--border);
}
.entry-content h2::before {
  content: ""; display: inline-block; width: .34em; height: .9em;
  margin-right: .45em; vertical-align: -.04em;
  background: var(--accent); border-radius: 2px;
}
.entry-content h3 { font-size: 1.28em; margin: 1.8em 0 .5em; }

/* ---- 5. Lists ------------------------------------------------------- */
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.35em; }
.entry-content li { margin: .35em 0; }
.entry-content ul li::marker { color: var(--accent); }

/* ---- 6. Code -------------------------------------------------------- */
.entry-content :not(pre) > code {
  font-family: var(--font-mono); font-size: .88em;
  background: #f3f4f6; color: #b4297a;
  padding: .12em .4em; border-radius: 5px; border: 1px solid var(--border);
}
.entry-content pre {
  font-family: var(--font-mono); font-size: .85em; line-height: 1.6;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 1em 1.2em; overflow-x: auto;
}
.entry-content pre code { background: none; border: none; padding: 0; color: var(--ink); }

/* ---- 7. Blockquotes / callouts / collapsible rubrics --------------- */
.entry-content blockquote {
  margin: 1.6em 0; padding: .9em 1.2em;
  background: var(--accent-tint);
  border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
  color: #353b49;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content details {
  margin: 1.4em 0; padding: .2em 1.1em;
  border: 1px solid var(--border); border-radius: 10px; background: #fafbfc;
}
.entry-content details[open] { padding-bottom: .8em; }
.entry-content summary {
  cursor: pointer; font-weight: 600; padding: .7em 0; color: var(--accent-dark);
  list-style: none;
}
.entry-content summary::-webkit-details-marker { display: none; }
.entry-content summary::before { content: "\25B8\0020"; color: var(--accent); }
.entry-content details[open] summary::before { content: "\25BE\0020"; }

/* ---- 8. Tables ------------------------------------------------------ */
.entry-content table {
  border-collapse: collapse; width: 100%; font-size: .92em;
  margin: 1.6em 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: table;
}
.entry-content thead th {
  background: var(--accent-tint); color: var(--accent-dark);
  font-weight: 700; text-align: left;
}
.entry-content th, .entry-content td {
  padding: .6em .85em; border-bottom: 1px solid var(--border);
}
.entry-content tbody tr:nth-child(even) { background: #fafbfc; }
.entry-content tbody tr:last-child td { border-bottom: none; }

/* ---- 9. Images & captions ------------------------------------------ */
.entry-content img { border-radius: 10px; }
.entry-content figure {
  margin: 1.8em auto; border: 1px solid var(--border);
  border-radius: 12px; padding: .5em; background: #fff;
  box-shadow: 0 1px 3px rgba(20,24,40,.05), 0 8px 24px rgba(20,24,40,.04);
}
.entry-content figure img { border-radius: 8px; display: block; width: 100%; }
.entry-content figcaption {
  text-align: center; color: var(--muted); font-size: .85em;
  margin-top: .6em; padding: 0 .5em;
}

/* ---- 10. Header / site title / navigation -------------------------- */
.site-header { border-bottom: 1px solid var(--border); }
.main-title, .site-title a { font-weight: 800; letter-spacing: -.02em; }
.main-navigation a { font-weight: 500; transition: color .15s ease; }
.main-navigation a:hover { color: var(--accent); }
.main-navigation .current-menu-item > a { color: var(--accent); }

/* ---- 11. Entry header / meta --------------------------------------- */
.entry-title { font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.entry-meta { color: var(--muted); font-size: .9em; }
.entry-meta a { color: var(--muted); border-bottom: none; }
.entry-meta a:hover { color: var(--accent); }

/* ---- 12. Small delights -------------------------------------------- */
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* ---- 13. Mobile ----------------------------------------------------- */
@media (max-width: 768px) {
  body { font-size: 16.5px; line-height: 1.7; }
  .entry-content h2 { font-size: 1.4em; }
  .entry-content pre { font-size: .8em; padding: .85em 1em; }
  .entry-content table { font-size: .85em; display: block; overflow-x: auto; }
}
