/*
Theme Name: eunmin.dev
Theme URI: https://eunmin-blog.test
Author: Eunmin Kim
Author URI: https://eunmin-blog.test
Description: Dark developer-focused blog theme for IT/tech writing. 코드 블록·TOC·읽기 진행바를 1급 시민으로 다루는 다크 테마.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: eunmin-dev
*/

:root {
  --bg: #0d1117;
  --bg-deep: #010409;
  --surface: #161b22;
  --border: #21262d;
  --border-strong: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-faint: #6e7681;
  --accent: #58a6ff;
  --accent-2: #7ee787;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Top nav ===== */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  max-width: var(--maxw); margin: 0 auto;
}
.site-logo { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--text); }
.site-logo b { color: var(--accent); }
.nav-menu { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.nav-menu a { color: var(--text-dim); }
.nav-menu a:hover, .nav-menu .current-menu-item a { color: var(--text); }
.nav-search { font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 5px 10px; background: transparent; cursor: pointer; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }

/* ===== Reading progress ===== */
.read-progress { position: sticky; top: 0; height: 2px; background: var(--accent); width: 0; z-index: 50; transition: width .1s linear; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 56px; padding: 24px;
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  display: flex; justify-content: space-between; max-width: var(--maxw); margin-left: auto; margin-right: auto;
}
.site-footer a { color: var(--text-faint); }

/* ===== Section heading ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 18px; }
.section-head h2 { font-size: 18px; margin: 0; }
.section-head .more { font-size: 13px; color: var(--accent); }

/* ===== Post cards (home/archive) ===== */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--bg); transition: border-color .15s; }
.post-card:hover { border-color: var(--border-strong); }
.post-cat { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.post-card h3 { font-size: 15.5px; font-weight: 700; margin: 8px 0 6px; line-height: 1.35; }
.post-card h3 a { color: var(--text); }
.post-excerpt { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin: 0; }
.post-meta { margin-top: 14px; font-size: 11.5px; color: var(--text-faint); display: flex; gap: 10px; }

/* ===== Tag chips ===== */
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 3px 11px; }
.tag-chip:hover { color: var(--text); border-color: var(--accent); }

/* ===== Hero (featured) ===== */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 26px; align-items: center;
  border: 1px solid var(--border); border-radius: 14px; padding: 26px;
  background: linear-gradient(135deg, #0d1117, #10151d); margin-top: 34px; }
.hero .tag { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--accent-2);
  background: rgba(126,231,135,.1); border: 1px solid rgba(126,231,135,.25); padding: 3px 10px; border-radius: 20px; }
.hero h2 { font-size: 28px; font-weight: 800; line-height: 1.2; margin: 14px 0 10px; letter-spacing: -.5px; }
.hero h2 a { color: var(--text); }
.hero .hero-excerpt { font-size: 14px; color: var(--text-dim); line-height: 1.65; margin: 0; }
.hero .meta { display: flex; gap: 12px; align-items: center; margin-top: 16px; font-size: 12.5px; color: var(--text-faint); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex-shrink: 0; }
.hero-code { background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text-dim); overflow: auto; }

/* ===== Single article ===== */
.article { display: grid; grid-template-columns: 1fr 200px; gap: 40px; max-width: 920px; margin: 0 auto; padding: 36px 24px; }
.article-main { min-width: 0; }
.crumb { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.crumb b { color: var(--accent-2); }
.article h1 { font-size: 30px; font-weight: 800; line-height: 1.22; letter-spacing: -.6px; margin: 14px 0; }
.byline { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-dim);
  padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }

.entry-content p { font-size: 15.5px; line-height: 1.85; color: #c9d1d9; margin: 0 0 18px; }
.entry-content h2 { font-size: 20px; font-weight: 700; margin: 34px 0 14px; scroll-margin-top: 20px; }
.entry-content h2::before { content: "# "; color: var(--accent); font-family: var(--mono); }
.entry-content h3 { font-size: 17px; margin: 26px 0 12px; }
.entry-content a { color: var(--accent); }
.entry-content ul, .entry-content ol { color: #c9d1d9; line-height: 1.85; }
.entry-content :not(pre) > code {
  font-family: var(--mono); font-size: 13px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; color: #79c0ff; }
.entry-content blockquote {
  background: rgba(88,166,255,.07); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 0 0 22px; color: #c9d1d9; }

/* code block decoration (added by theme.js) */
.codeblock { background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: 10px; margin: 8px 0 22px; overflow: hidden; }
.codeblock-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.codeblock-copy { background: none; border: 0; color: var(--text-faint); cursor: pointer; font-family: var(--mono); font-size: 11.5px; }
.codeblock-copy:hover { color: var(--accent); }
.codeblock pre, .entry-content pre { margin: 0; padding: 14px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; background: var(--bg-deep); }

/* ===== TOC ===== */
.toc { position: sticky; top: 16px; align-self: start; }
.toc .toc-label { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.toc a { display: block; font-size: 12.5px; color: var(--text-dim); padding: 5px 0 5px 12px; border-left: 2px solid var(--border); }
.toc a.active { color: var(--text); border-left-color: var(--accent); }

/* ===== Author box ===== */
.author-box { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 30px; }
.author-box .avatar { width: 48px; height: 48px; }
.author-box .a-name { font-weight: 700; font-size: 14px; }
.author-box .a-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }

/* ===== Archive / list ===== */
.archive-head { padding: 36px 0 8px; }
.archive-head .label { font-family: var(--mono); font-size: 12px; color: var(--accent-2); }
.archive-head h1 { font-size: 26px; margin: 8px 0; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 18px 0; border-bottom: 1px solid var(--border); }
.post-list .post-cat { margin-bottom: 4px; }
.post-list h3 { margin: 0 0 6px; font-size: 17px; }
.post-list h3 a { color: var(--text); }

/* ===== Page (About) ===== */
.page-content { max-width: 760px; margin: 0 auto; padding: 40px 24px; }
.page-content h1 { font-size: 28px; margin-bottom: 20px; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 10px; justify-content: center; margin: 32px 0; font-family: var(--mono); font-size: 13px; }
.pagination .page-numbers { color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; }
.pagination .page-numbers.current { color: var(--text); border-color: var(--accent); }

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 80px 24px; }
.error-404 .code { font-family: var(--mono); font-size: 48px; color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .article { grid-template-columns: 1fr; }
  .toc { display: none; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
  .nav-menu.open { display: flex; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 40; }
  .nav-menu.open li { padding: 12px 24px; border-top: 1px solid var(--border); }
  .nav-toggle { display: block; }
  .site-nav { position: relative; }
}

/* ===== Utilities / misc ===== */
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#eunmin-search { display: none; padding-top: 12px; }
#eunmin-search.open { display: block; }

.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; font-size: 13px; }
.post-navigation a { color: var(--accent); }
