/* ace-tip.com — 에이스팁 */
:root {
  --bg: #faf9f7;
  --fg: #1b1b1b;
  --muted: #6e6a64;
  --card: #ffffff;
  --line: #e8e4de;
  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, 0.08);
  --header: #111111;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --fg: #ebebeb;
    --muted: #9d9a95;
    --card: #1d1d1d;
    --line: #2c2c2c;
    --accent: #ff5063;
    --accent-soft: rgba(255, 80, 99, 0.12);
    --header: #0c0c0c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ── */
.site-header { background: var(--header); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: 0.5px; }
.logo .spade { color: #fff; font-size: 24px; line-height: 1; }
.logo small { font-size: 12px; font-weight: 500; color: #aaa; margin-left: 2px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: #c9c9c9; font-size: 14.5px; font-weight: 600; padding: 6px 11px; border-radius: 8px; }
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.site-nav .nav-search { display: flex; align-items: center; padding: 8px 10px; }
.site-nav .nav-search svg { display: block; }

/* ── 히어로 ── */
.hero { text-align: center; padding: 64px 0 44px; }
.hero-spade { font-size: 38px; line-height: 1; margin-bottom: 12px; color: var(--fg); }
.hero h1 { font-size: 34px; font-weight: 800; line-height: 1.35; margin: 0 0 14px; }
.hero h1 strong { color: var(--accent); }
.hero-sub { color: var(--muted); font-size: 16.5px; margin: 0 auto; max-width: 560px; }
.hero-sub a { color: var(--accent); font-weight: 600; }

/* ── 카드 목록 ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  padding-bottom: 72px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 24px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09); }
.card-cat {
  align-self: flex-start;
  font-size: 12.5px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px; border-radius: 99px;
  margin-bottom: 12px;
}
.card-title { font-size: 19px; font-weight: 700; line-height: 1.45; margin: 0 0 8px; }
.card-desc { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin: 0 0 16px; flex: 1; }
.card-date { color: var(--muted); font-size: 13px; }

/* ── 카테고리 목록 페이지 ── */
.listing { padding: 48px 0 72px; }
.listing-title { font-size: 28px; font-weight: 800; margin: 0 0 24px; }
.empty { color: var(--muted); }

/* ── 페이지네이션 ── */
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 0 0 64px; }
.pager a { font-weight: 700; color: var(--accent); }
.pager a:hover { text-decoration: underline; }
.pager span { color: var(--muted); font-size: 14.5px; }

/* ── 검색 ── */
.search-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-count { color: var(--muted); font-size: 14px; margin: 10px 2px 20px; }

/* ── 본문 (글, 페이지) ── */
.post { max-width: 720px; margin: 48px auto 72px; }
.post-head { margin-bottom: 32px; }
.post-cat {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px; border-radius: 99px;
  margin-bottom: 14px;
}
.post-head h1 { font-size: 30px; font-weight: 800; line-height: 1.4; margin: 0 0 10px; }
.post-head time { color: var(--muted); font-size: 14px; }
.post-body { font-size: 16.5px; }
.post-body h2 {
  font-size: 22px; font-weight: 700;
  margin: 2.2em 0 0.7em;
  padding-left: 13px;
  border-left: 4px solid var(--accent);
  line-height: 1.4;
}
.post-body h3 { font-size: 18px; font-weight: 700; margin: 1.8em 0 0.5em; }
.post-body p { margin: 1em 0; }
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin: 0.4em 0; }
.post-body strong { font-weight: 700; }
.post-body blockquote {
  margin: 1.4em 0; padding: 14px 20px;
  background: var(--card);
  border-left: 4px solid var(--line);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}
.post-body blockquote p { margin: 0.3em 0; }
.post-body table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: 15px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.post-body th { background: var(--card); font-weight: 700; }
.post-body code {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; font-size: 14px;
}
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.8em 0;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.post-body a { color: var(--accent); font-weight: 600; }
.post-body a:hover { text-decoration: underline; }
.ad-box { margin: 2.2em 0; }

/* ── 이전/다음 글 ── */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pnav-item {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--card);
  transition: border-color 0.15s ease;
}
.pnav-item:hover { border-color: var(--accent); }
.pnav-item span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.pnav-item strong { font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.pnav-next { text-align: right; }
.pnav-empty { border: none; background: none; pointer-events: none; }

/* ── 관련 글 ── */
.related { margin: 16px 0 8px; }
.related-title { font-size: 22px; font-weight: 800; margin: 0 0 18px; }
.related .cards { padding-bottom: 24px; }

.post-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-foot a { color: var(--muted); font-weight: 600; font-size: 15px; }
.post-foot a:hover { color: var(--accent); }

/* ── 푸터 ── */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; }
.foot-links { margin: 0 0 10px; font-size: 14.5px; font-weight: 600; }
.foot-links a:hover { color: var(--accent); }
.copy { color: var(--muted); font-size: 13px; margin: 0; }

/* ── 모바일 ── */
@media (max-width: 640px) {
  .header-inner { height: auto; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 0; }
  .hero { padding: 44px 0 32px; }
  .hero h1 { font-size: 26px; }
  .post-head h1 { font-size: 25px; }
  .post-body { font-size: 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .pnav-next { text-align: left; }
  .pnav-empty { display: none; }
}
