/*
Theme Name: 생활비서 인사이트
Theme URI: https://example.com/saenghwal-insight
Author: 생활비서 인사이트
Description: 공식 출처 기반 생활정보 블로그를 위한 반응형 WordPress 테마
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: saenghwal-insight
*/

:root {
  --ink: #142238;
  --navy: #29415f;
  --muted: #607086;
  --muted-light: #7a899c;
  --line: #d8e0eb;
  --surface: #f5f8fc;
  --accent: #c64a3c;
  --canvas: #ffffff;
  --wide: 1180px;
  --content: 760px;
  --shadow: 0 12px 32px rgba(20, 34, 56, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.site-shell { width: min(calc(100% - 40px), var(--wide)); margin-inline: auto; }
.reading-shell { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }
.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; }
.screen-reader-text:focus { position: fixed; z-index: 9999; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: 12px 16px; background: #fff; color: var(--ink); }

.site-header { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.header-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: white; background: var(--ink); font-weight: 800; }
.brand-copy { display: grid; line-height: 1.25; }
.brand-name { font-size: 1.08rem; font-weight: 800; letter-spacing: -.03em; }
.brand-tagline { color: var(--muted); font-size: .78rem; }
.menu-toggle { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.primary-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.primary-menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }
.primary-menu a:hover, .primary-menu a:focus-visible { background: var(--surface); color: var(--accent); }

.hero { padding: clamp(54px, 8vw, 96px) 0 44px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 780px; margin: 0; font-size: clamp(2.15rem, 5vw, 4.35rem); line-height: 1.08; letter-spacing: -.055em; }
.hero-lead { max-width: 680px; margin: 22px 0 28px; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.2rem); }
.search-form { display: flex; gap: 10px; max-width: 820px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-field { flex: 1; min-width: 0; min-height: 48px; border: 0; border-radius: 10px; padding: 0 14px; background: #fff; color: var(--ink); }
.search-submit, .button-link { min-height: 48px; border: 0; border-radius: 10px; padding: 0 20px; background: var(--ink); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }

.section { padding: 44px 0; }
.section.surface { background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.3rem); line-height: 1.2; letter-spacing: -.035em; }
.section-heading p { max-width: 560px; margin: 0; color: var(--muted); }
.decision-grid, .post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card-link { position: relative; display: flex; min-width: 0; height: 100%; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 0 0 rgba(20,34,56,0); text-decoration: none; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.card-link:hover, .card-link:focus-visible { transform: translateY(-3px); border-color: var(--navy); box-shadow: var(--shadow); color: var(--ink); }
.card-index { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .1em; }
.card-link h3 { margin: 0; font-size: 1.18rem; line-height: 1.35; letter-spacing: -.025em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-link p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-arrow { margin-top: auto; color: var(--accent); font-weight: 800; }
.post-thumb { aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: var(--surface); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { color: var(--muted-light); font-size: .82rem; }

.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.trust-item { padding-top: 18px; border-top: 3px solid var(--ink); }
.trust-item h3 { margin: 0 0 8px; }
.trust-item p { margin: 0; color: var(--muted); }

.archive-header { padding: 58px 0 26px; }
.archive-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
.archive-header p { max-width: 640px; color: var(--muted); }
.empty-state { padding: 40px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.pagination { margin-top: 30px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.page-numbers.current { border-color: var(--ink); background: var(--ink); color: white; }

.article-header { padding: 58px 0 26px; }
.article-header h1 { margin: 8px 0 14px; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.15; letter-spacing: -.05em; }
.article-summary { color: var(--muted); font-size: 1.08rem; }
.featured-image { width: min(calc(100% - 40px), var(--wide)); margin: 0 auto 36px; overflow: hidden; border-radius: 18px; background: var(--surface); }
.featured-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.article-content { font-size: 1.03rem; }
.article-content h2 { margin: 2.2em 0 .7em; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.3; letter-spacing: -.035em; }
.article-content h3 { margin-top: 1.8em; }
.article-content p { margin: 0 0 1.25em; }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content img { width: 100%; margin: 30px 0; border-radius: 14px; }
.article-content a { font-weight: 700; }
.source-box, .ai-note { margin-top: 34px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.source-box h2 { margin: 0 0 12px; font-size: 1.2rem; }
.source-list { margin: 0; padding-left: 1.2em; }
.source-list a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 800; }
.source-checked { color: var(--muted); font-size: .82rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag-list a { padding: 7px 11px; border-radius: 999px; background: var(--surface); font-size: .82rem; text-decoration: none; }
.related { width: min(calc(100% - 40px), var(--wide)); margin: 54px auto; }

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--ink); color: #dfe7f1; }
.footer-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 44px 0; }
.site-footer a { color: white; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; list-style: none; margin: 0; padding: 0; }
.copyright { margin: 10px 0 0; color: #9fb0c5; font-size: .86rem; }

@media (max-width: 1024px) {
  .decision-grid, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { min-height: 78px; }
}

@media (max-width: 700px) {
  .site-shell, .reading-shell, .featured-image, .related { width: min(calc(100% - 28px), var(--wide)); }
  .header-inner { flex-wrap: wrap; gap: 8px; padding: 12px 0; }
  .brand { flex: 1; }
  .brand-tagline { display: none; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .site-nav { width: 100%; }
  .site-nav[hidden] { display: none; }
  .primary-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .primary-menu a { justify-content: center; padding-inline: 6px; font-size: .88rem; text-align: center; }
  .hero { padding-top: 46px; }
  .search-form { flex-direction: column; }
  .search-submit { width: 100%; }
  .section-heading { align-items: start; flex-direction: column; }
  .decision-grid, .post-grid, .trust-grid { grid-template-columns: 1fr; }
  .card-link { min-height: 0; padding: 20px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 1rem; }
  .primary-menu a { font-size: .8rem; }
  .article-header { padding-top: 42px; }
}

@media (hover: none) {
  .card-link:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .card-link:hover, .card-link:focus-visible { transform: none; }
}
