/* minisite readable theme — inly.kr 스타일 모방 (자체 작성) */

:root {
  --c-text: #1a1a1a;
  --c-muted: #6b7280;
  --c-line: #e5e7eb;
  --c-bg: #ffffff;
  --c-bg-alt: #fafafa;
  --c-accent: #2563eb;
  --c-accent-soft: #dbeafe;
  --c-cat: #f3f4f6;
  --c-summary-bg: #fffbeb;
  --c-summary-border: #f59e0b;
  --c-overlay: rgba(0,0,0,0.5);
  --radius: 10px;
  --container: 760px;
  --container-wide: 1100px;
  --font-base: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --fs-base: 16px;
}

/* 다크 모드 */
body[data-theme="dark"] {
  --c-text: #e5e7eb;
  --c-muted: #9ca3af;
  --c-line: #374151;
  --c-bg: #0f172a;
  --c-bg-alt: #1e293b;
  --c-accent: #60a5fa;
  --c-accent-soft: #1e3a8a;
  --c-cat: #334155;
  --c-summary-bg: #422006;
  --c-summary-border: #f59e0b;
  --c-overlay: rgba(0,0,0,0.7);
}

/* 글자 크기 */
[data-size="large"]  { --fs-base: 18px; }
[data-size="xlarge"] { --fs-base: 20px; }

* { box-sizing: border-box; }
html { font-size: var(--fs-base); }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-accent); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--container-wide); margin: 0 auto; padding: 0 16px; }

/* ── 속보 배너 ── */
.breaking-news {
  background: var(--c-summary-bg); border-bottom: 1px solid var(--c-line);
  padding: 10px 16px; display: flex; align-items: center; gap: 12px;
  max-width: var(--container-wide); margin: 0 auto;
}
.breaking-badge { font-size: 0.8125rem; font-weight: 700; color: #b45309; flex-shrink: 0; }
.breaking-link { font-size: 0.9375rem; font-weight: 600; }

/* ── 헤더 ── */
.site-header { border-bottom: 1px solid var(--c-line); position: sticky; top: 0; background: var(--c-bg); z-index: 10; }
.site-header .container { display: flex; align-items: center; gap: 24px; padding: 14px 16px; }
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }
.primary-nav { display: flex; gap: 18px; flex: 1; }
.primary-nav a { font-size: 0.9375rem; color: var(--c-muted); font-weight: 500; }
.primary-nav a:hover { color: var(--c-text); }

/* 헤더 우측 액션 (검색·다크모드·Aa) */
.hdr-actions { display: flex; gap: 2px; align-items: center; }
.hdr-icon {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--c-text);
  transition: background .15s;
}
.hdr-icon:hover { background: var(--c-cat); }
.hdr-icon svg { width: 18px; height: 18px; }
.hdr-text { font-weight: 800; font-size: 0.8125rem; }
/* 다크모드 아이콘 토글 */
.theme-icon-dark { display: none; }
body[data-theme="dark"] .theme-icon-light { display: none; }
body[data-theme="dark"] .theme-icon-dark { display: inline-block; }

/* 검색 오버레이 */
.search-overlay {
  position: fixed; inset: 0; background: var(--c-overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 16px 16px; z-index: 100;
}
.search-overlay[hidden] { display: none; }
.search-panel { width: 100%; max-width: 600px; }
.search-box {
  background: var(--c-bg); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.search-input-icon { width: 18px; height: 18px; color: var(--c-muted); flex-shrink: 0; }
.search-box input {
  flex: 1; padding: 8px 0; font-size: 1rem;
  border: none; outline: none; background: transparent; color: var(--c-text);
  font-family: inherit;
}
.search-close {
  background: none; border: none; cursor: pointer;
  color: var(--c-muted); font-size: 1.125rem; padding: 6px 10px;
  border-radius: 6px;
}
.search-close:hover { background: var(--c-cat); color: var(--c-text); }

.search-results {
  margin-top: 8px; background: var(--c-bg);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  max-height: 60vh; overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.search-results:empty { display: none; }
.search-result {
  display: block; padding: 14px 16px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text); transition: background .15s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--c-bg-alt); }
.search-result .sr-cat { font-size: 0.75rem; font-weight: 700; color: var(--c-accent); margin-bottom: 4px; }
.search-result .sr-title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.search-result .sr-meta { font-size: 0.75rem; color: var(--c-muted); }
.search-empty { padding: 20px; text-align: center; color: var(--c-muted); font-size: 0.875rem; }
/* ── 메인 ── */
main.container { padding-top: 24px; padding-bottom: 60px; }

/* ── 메인 상단 hero (큰 글 1개 + 사이드 4개) — inly.kr 스타일 ── */
.home-hero {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 36px;
  align-items: stretch;
}
@media (max-width: 768px) {
  .home-hero { grid-template-columns: 1fr; }
}

/* 좌측 큰 hero */
.hero-main {
  display: flex; flex-direction: column;
  background: var(--c-bg-alt); border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.hero-main:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.hero-img {
  width: 100%; aspect-ratio: 16/9; background: var(--c-cat);
  background-size: cover; background-position: center; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.hero-img-fallback {
  color: #fff; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hero-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.hero-cat { color: var(--c-accent); font-size: 0.8125rem; font-weight: 700; }
.hero-title {
  font-size: 1.5rem; line-height: 1.35; margin: 10px 0 12px; font-weight: 800;
  color: var(--c-text);
}
.hero-desc {
  font-size: 0.9375rem; line-height: 1.6; color: var(--c-muted); margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { font-size: 0.8125rem; color: var(--c-muted); margin-top: auto; }
.hero-meta .sep { margin: 0 6px; }

/* 우측 사이드 4개 */
.hero-side { display: flex; flex-direction: column; gap: 10px; }
.side-card {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px;
  background: var(--c-bg-alt); border: 1px solid var(--c-line);
  border-radius: 10px; overflow: hidden; transition: transform .15s, box-shadow .15s;
  flex: 1;
}
.side-card:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.06); }
.side-img {
  aspect-ratio: 1/1; background: var(--c-cat);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.side-img-fallback {
  color: #fff; font-size: 0.8125rem; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  text-align: center; padding: 0 6px;
}
.side-body {
  padding: 10px 12px 10px 0; display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0;
}
.side-cat { color: var(--c-accent); font-size: 0.75rem; font-weight: 700; }
.side-title {
  font-size: 0.875rem; margin: 4px 0; line-height: 1.4; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.side-meta { font-size: 0.6875rem; color: var(--c-muted); margin-top: auto; }
.side-meta .sep { margin: 0 4px; }

/* ── 카테고리 칩 ── */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  display: inline-block; padding: 6px 12px; background: var(--c-cat);
  border-radius: 999px; font-size: 0.8125rem; font-weight: 500;
}
.chip--all { background: #1f2937; color: #fff; }

/* ── 섹션 헤드 ── */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-head h2 { font-size: 1.25rem; margin: 0; }
.more-link { font-size: 0.875rem; color: var(--c-muted); }

/* ── 글 목록 (row) ── */
.post-list { display: flex; flex-direction: column; gap: 24px; }
.post-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 20px;
  padding-bottom: 24px; border-bottom: 1px solid var(--c-line);
}
.post-row:last-child { border-bottom: none; }
.post-row-img img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; }
.post-row-cat { font-size: 0.75rem; font-weight: 700; color: var(--c-accent); }
.post-row-title { font-size: 1.125rem; margin: 8px 0; line-height: 1.4; font-weight: 700; }
.post-row-desc { font-size: 0.875rem; color: var(--c-muted); margin: 0 0 8px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row-meta { font-size: 0.75rem; color: var(--c-muted); }
.post-row-meta .sep { margin: 0 6px; }
@media (max-width: 600px) {
  .post-row { grid-template-columns: 1fr; }
}

/* ── 페이지네이션 ── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 40px; font-size: 0.875rem; }
.pagination a { padding: 8px 14px; border: 1px solid var(--c-line); border-radius: 8px; }
.page-info { color: var(--c-muted); }

/* ── 글 상세 ── */
.post-page-layout { max-width: var(--container); margin: 0 auto; }
.post-header h1 { font-size: 1.875rem; line-height: 1.3; margin: 12px 0; font-weight: 800; }
.breadcrumb { font-size: 0.8125rem; color: var(--c-muted); }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb-category { color: var(--c-accent); font-weight: 600; }
.post-meta-detail { font-size: 0.8125rem; color: var(--c-muted); margin: 12px 0 20px; }
.meta-sep { margin: 0 6px; }
.featured-image img { width: 100%; border-radius: var(--radius); margin: 16px 0 24px; }

/* 핵심요약 박스 */
.summary-box {
  background: var(--c-summary-bg); border-left: 4px solid var(--c-summary-border);
  border-radius: 8px; padding: 16px 18px; margin: 20px 0;
}
.summary-box-header { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #b45309; margin-bottom: 8px; }
.summary-box-header svg { width: 16px; height: 16px; fill: #b45309; }
.summary-box-excerpt { margin: 0; line-height: 1.7; font-size: 0.9375rem; white-space: pre-line; }

/* 목차 */
.toc { background: var(--c-bg-alt); border: 1px solid var(--c-line); border-radius: 8px; padding: 12px 16px; margin: 20px 0; }
.toc-title { font-weight: 700; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { font-size: 0.875rem; line-height: 1.8; }

/* 본문 */
.post-content { font-size: 1.0625rem; line-height: 1.85; }
.post-content h2 { font-size: 1.375rem; margin: 36px 0 16px; padding-top: 8px; font-weight: 800; }
.post-content h3 { font-size: 1.125rem; margin: 24px 0 12px; font-weight: 700; }
.post-content p { margin: 14px 0; }
.post-content ul, .post-content ol { padding-left: 22px; }
.post-content li { margin: 6px 0; }
.post-content strong { font-weight: 700; }
.post-content blockquote { border-left: 4px solid var(--c-accent); padding: 6px 16px; color: var(--c-muted); margin: 16px 0; }
.post-content code { background: var(--c-cat); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.post-content table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.post-content table th, .post-content table td { border: 1px solid var(--c-line); padding: 8px 12px; text-align: left; }
.post-content table th { background: var(--c-bg-alt); }

/* 광고 슬롯 */
.ad-slot { margin: 32px 0; min-height: 90px; }
.ad-placeholder {
  border: 1px dashed var(--c-line); color: var(--c-muted);
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; border-radius: 8px; font-size: 0.8125rem;
  background: var(--c-bg-alt);
}

/* FAQ */
.faq { margin: 40px 0; padding: 24px; background: var(--c-bg-alt); border-radius: var(--radius); }
.faq h3 { margin: 0 0 16px; font-size: 1.125rem; }
.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 6px 0 0; color: var(--c-muted); }

/* 공유 버튼 */
.share-box { display: flex; align-items: center; gap: 8px; margin: 32px 0; padding: 16px; background: var(--c-bg-alt); border-radius: 8px; flex-wrap: wrap; }
.share-label { font-size: 0.875rem; font-weight: 700; margin-right: 4px; color: var(--c-muted); }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 8px;
  font-weight: 700; font-size: 0.875rem; color: var(--c-text); cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.share-btn:hover { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.share-btn.copied { background: #10b981; color: #fff; border-color: #10b981; }

/* 이전/다음 글 네비 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 40px 0 20px; }
.post-nav-item { padding: 16px; background: var(--c-bg-alt); border: 1px solid var(--c-line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s; }
.post-nav-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: var(--c-accent); }
.post-nav-label { font-size: 0.75rem; color: var(--c-accent); font-weight: 700; }
.post-nav-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-next { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }

/* 작성자 박스 */
.author-box { display: flex; gap: 16px; align-items: center; padding: 20px; background: var(--c-bg-alt); border-radius: var(--radius); margin: 32px 0; }
.author-img { width: 56px; height: 56px; border-radius: 50%; }
.author-name { font-weight: 700; }
.author-title { font-size: 0.8125rem; color: var(--c-muted); }
.author-bio { margin: 6px 0 0; font-size: 0.875rem; color: var(--c-muted); }

/* 관련 글 */
.related { margin: 40px 0; }
.related h3 { font-size: 1rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--c-text); display: inline-block; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: 0.9375rem; }

/* 카테고리 헤드 */
.cat-head { margin-bottom: 28px; }
.cat-head h1 { font-size: 1.75rem; margin: 8px 0 4px; }
.cat-count { color: var(--c-muted); margin: 0; }
.empty { color: var(--c-muted); text-align: center; padding: 40px 0; }

/* 정적 페이지 */
.static-page { max-width: var(--container); margin: 0 auto; }
.static-page h1 { font-size: 1.75rem; margin-bottom: 16px; line-height: 1.3; }
.static-page h2 { font-size: 1.25rem; margin-top: 36px; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--c-line); }
.static-page p { line-height: 1.85; margin: 12px 0; }
.static-page p.lead { font-size: 1.0625rem; color: var(--c-muted); padding: 12px 16px; background: var(--c-bg-alt); border-radius: 8px; border-left: 3px solid var(--c-accent); }
.static-page ul { padding-left: 22px; line-height: 1.85; }
.static-page li { margin: 4px 0; }
.static-page a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.meta-line { font-size: 0.8125rem; color: var(--c-muted); margin-top: 24px; }

.author-card { display: flex; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--c-line); }
.author-card:last-child { border-bottom: none; }
.author-card img { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.author-card h2 { margin: 0 0 4px; padding: 0; border: none; font-size: 1.125rem; }
.author-card .author-title { color: var(--c-muted); font-size: 0.875rem; margin: 0 0 8px; }
.author-card .author-fields,
.author-card .author-source { font-size: 0.875rem; color: var(--c-muted); margin: 6px 0; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--c-line); margin-top: 60px; padding: 36px 0 24px; background: var(--c-bg-alt); font-size: 0.875rem; }
.site-footer .container { display: flex; flex-direction: column; gap: 12px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; }
.footer-brand-block { display: flex; flex-direction: column; gap: 4px; }
.footer-brand { font-weight: 700; }
.footer-contact { font-size: 0.8125rem; color: var(--c-muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-nav a { color: var(--c-muted); }
.footer-business { font-size: 0.75rem; color: var(--c-muted); padding-top: 12px; border-top: 1px dashed var(--c-line); }
.footer-disclaimer { font-size: 0.75rem; color: var(--c-muted); line-height: 1.7; padding: 8px 0; }
.footer-copy { color: var(--c-muted); font-size: 0.75rem; padding-top: 12px; border-top: 1px dashed var(--c-line); }

/* 404 페이지 */
.error-page { max-width: var(--container); margin: 60px auto; text-align: center; padding: 0 16px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--c-accent); margin: 0; line-height: 1; letter-spacing: -3px; }
.error-page h1 { font-size: 1.5rem; margin: 12px 0 16px; }
.error-desc { color: var(--c-muted); line-height: 1.8; margin-bottom: 32px; }
.error-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 10px 20px; border: 1px solid var(--c-line); border-radius: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--c-text); }
.btn--primary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn:hover { opacity: 0.85; }
.error-cats-title { font-size: 1rem; margin: 24px 0 12px; color: var(--c-muted); font-weight: 600; }
.error-page .cat-chips { justify-content: center; margin-bottom: 32px; }
.error-help { font-size: 0.875rem; color: var(--c-muted); }
