/* 자료실(블로그) 전용 스타일. style.css 뒤에 로드됩니다. 색은 ink/mist 토큰만 사용합니다. */

/* 글 목록 */
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.post-card { position: relative; border-radius: 20px; background: #f4f6f9; }
.post-card-link { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; color: inherit; border-radius: 20px; transition: background 0.15s ease; }
.post-card:hover .post-card-link { background: #e5e8ee; }
/* 제목 링크를 카드 전체로 넓혀 어디를 눌러도 글로 갑니다. */
.post-card-anchor { color: inherit; text-decoration: none; }
.post-card-anchor::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.post-card-anchor:focus-visible::after { outline: 2px solid #1f2430; outline-offset: 3px; }
/* 태그는 카드 링크 위에 떠 있어야 각자 주제 페이지로 갑니다. */
.post-card-meta { position: relative; z-index: 1; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: #9aa3b0; }
.post-card-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.post-card-title { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 700; color: #1f2430; letter-spacing: -0.01em; }
.post-card-summary { margin: 0; font-size: 15px; line-height: 1.65; color: #6b7280; }
@media (min-width: 1024px) { .post-card-title { font-size: 20px; } }

.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: #fff; color: #6b7280; font-size: 12px; font-weight: 500; text-decoration: none; transition: background 0.15s ease, color 0.15s ease; }
.tag:hover { background: #e5e8ee; color: #1f2430; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: #9aa3b0; }
.post-meta .tag { background: #f4f6f9; }
.post-updated::before { content: "·"; margin-right: 12px; }

/* 목차 */
.toc { border-radius: 20px; background: #f4f6f9; padding: 20px 22px; }
.toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #9aa3b0; letter-spacing: 0.02em; }
.toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.5; }
.toc a { color: #1f2430; text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 본문 */
.prose { font-size: 16px; line-height: 1.85; color: #3b3f48; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.4em; font-size: 22px; line-height: 1.4; font-weight: 700; color: #1f2430; letter-spacing: -0.01em; scroll-margin-top: 88px; }
.prose h3 { margin-top: 1.8em; font-size: 18px; line-height: 1.45; font-weight: 700; color: #1f2430; letter-spacing: -0.01em; scroll-margin-top: 88px; }
.prose h4 { margin-top: 1.5em; font-size: 16px; font-weight: 700; color: #1f2430; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.prose p { margin-bottom: 0; }
.prose a { color: #1f2430; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #9aa3b0; }
.prose a:hover { text-decoration-color: #1f2430; }
.prose strong { font-weight: 700; color: #1f2430; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: #6b7280; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 18px 22px; border-radius: 16px; background: #f4f6f9; color: #3b3f48; }
.prose blockquote > * + * { margin-top: 0.6em; }
.prose hr { border: 0; height: 1px; background: #e5e8ee; margin: 2.4em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 16px; }
.prose code { font-size: 0.92em; padding: 2px 6px; border-radius: 6px; background: #f4f6f9; }
.prose pre { padding: 18px 20px; border-radius: 16px; background: #f4f6f9; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose .table-wrap { overflow-x: auto; border-radius: 16px; background: #f4f6f9; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #e5e8ee; }
.prose th { font-weight: 700; color: #1f2430; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
@media (min-width: 1024px) {
  .prose { font-size: 17px; }
  .prose h2 { font-size: 24px; }
  .prose h3 { font-size: 19px; }
}

/* 핵심 요약 */
.key-points { padding: 22px 24px; border-radius: 20px; background: #f4f6f9; }
.key-points-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #9aa3b0; letter-spacing: 0.02em; }
.key-points ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.65; color: #1f2430; }
.key-points li::marker { color: #9aa3b0; }

/* 자주 묻는 질문 */
.post-faq { display: flex; flex-direction: column; gap: 16px; }
.post-faq-title { margin: 0; font-size: 22px; font-weight: 700; color: #1f2430; letter-spacing: -0.01em; }
.post-faq dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.post-faq-item { padding: 20px 22px; border-radius: 20px; background: #f4f6f9; }
.post-faq dt { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.5; color: #1f2430; }
.post-faq dd { margin: 0; font-size: 16px; line-height: 1.7; color: #4b5563; }
@media (min-width: 1024px) { .key-points ul { font-size: 17px; } .post-faq-title { font-size: 24px; } }

/* 안내 박스 */
.notice { padding: 18px 22px; border-radius: 16px; background: #f4f6f9; font-size: 14px; line-height: 1.7; color: #6b7280; }
.notice p { margin: 0; }

/* 다른 글 */
.post-others { display: flex; flex-direction: column; gap: 16px; }
.post-others-title { margin: 0; font-size: 18px; font-weight: 700; color: #1f2430; letter-spacing: -0.01em; }

/* 열이 많은 표는 좁은 화면에서 눌리지 않고 가로 스크롤 */
@media (max-width: 640px) {
  .prose .table-wrap.cols-4 table, .prose .table-wrap.cols-5 table, .prose .table-wrap.cols-6 table { min-width: 640px; }
  .prose .table-wrap.cols-3 table { min-width: 480px; }
}

/* ── 주제별 보기 ── */
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.topic { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px; border: 0; border-radius: 999px; background: #f4f6f9; color: #6b7280; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.topic span { font-size: 12px; color: #9aa3b0; font-variant-numeric: tabular-nums; }
.topic:hover { background: #e5e8ee; }
.topic.is-on { background: #1f2430; color: #fff; }
.topic.is-on span { color: #d3d8e0; }

/* ── 목록 격자 ── */
.post-list.is-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .post-list.is-grid { grid-template-columns: 1fr 1fr; } }
.post-card.is-featured { grid-column: 1 / -1; background: #1f2430; }
.post-card.is-featured:hover .post-card-link { background: #2d3340; }
.post-card.is-featured .post-card-title { color: #fff; }
.post-card.is-featured .post-card-summary { color: #d3d8e0; }
.post-card.is-featured .post-card-meta { color: #9aa3b0; }
.post-card.is-featured .tag { background: rgba(255, 255, 255, 0.12); color: #e5e8ee; }
.post-card-lead { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: #fff; color: #1f2430; font-size: 12px; font-weight: 700; }
.post-card-time { font-variant-numeric: tabular-nums; }
.post-card-time::before { content: "·"; margin-right: 12px; }
@media (min-width: 1024px) {
  .post-card.is-featured .post-card-link { padding: 30px 30px 32px; gap: 12px; }
  .post-card.is-featured .post-card-title { font-size: 25px; }
  .post-card.is-featured .post-card-summary { font-size: 16px; max-width: 62ch; }
}

/* ── 글 머리 읽는 시간 ── */
.post-time { font-variant-numeric: tabular-nums; }
.post-time::before { content: "·"; margin-right: 12px; }

/* ── 이전·다음 글 ── */
.post-pager { display: grid; gap: 12px; margin-top: 2.4em; }
@media (min-width: 640px) { .post-pager { grid-template-columns: 1fr 1fr; } }
.post-pager-link { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 16px; background: #f4f6f9; color: inherit; text-decoration: none; transition: background 0.15s ease; }
.post-pager-link:hover { background: #e5e8ee; }
.post-pager-link span { font-size: 12px; font-weight: 500; color: #9aa3b0; letter-spacing: 0.02em; }
.post-pager-link strong { font-size: 15px; font-weight: 700; line-height: 1.45; color: #1f2430; letter-spacing: -0.01em; }
.post-pager-link.is-next { text-align: right; }

/* ── 글 레이아웃: 넓은 화면에서는 목차를 옆에 고정 ── */
.post-layout { display: flex; flex-direction: column; gap: 28px; }
.post-header, .post-main { min-width: 0; max-width: 640px; }
.post-aside { min-width: 0; }
.post-aside:empty { display: none; }
@media (min-width: 1024px) {
  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(0, 260px);
    grid-template-areas: "header aside" "main aside";
    column-gap: 64px;
    row-gap: 40px;
    align-items: start;
  }
  .post-header { grid-area: header; }
  .post-main { grid-area: main; }
  .post-aside { grid-area: aside; position: sticky; top: 96px; }
  .post-aside .toc { background: transparent; padding: 0 0 0 20px; border-left: 2px solid #e5e8ee; border-radius: 0; }
  .post-aside .toc ol { padding-left: 0; list-style: none; gap: 9px; font-size: 14px; }
  .post-aside .toc a { color: #6b7280; }
  .post-aside .toc a:hover { color: #1f2430; }
}

/* ── 대표 이미지 ── */
/* 목록 카드에는 넣지 않습니다. 글 페이지 상단에서만 씁니다. */
.post-cover { margin: 0; border-radius: 20px; overflow: hidden; background: #e5e8ee; line-height: 0; }
.post-cover img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }

/* 주제 칩이 링크가 되었습니다. */
a.topic { text-decoration: none; }

/* ── 글 공유 ── */
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 1px solid #e5e8ee; border-radius: 16px; background: #fff;
  font-size: 15px; font-weight: 700; color: #1f2430; letter-spacing: -0.01em;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.share-btn:hover { background: #f4f6f9; border-color: #d3d8e0; }
.share-btn:focus-visible { outline: 2px solid #1f2430; outline-offset: 2px; }
.share-btn svg { color: #6b7280; }
.share-status { font-size: 14px; color: #6b7280; }

/* ── 자료실 검색 ── */
/* 스크립트가 없으면 폼이 hidden 인 채로 남고 목록은 그대로 다 보입니다. */
.post-search { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; }
.post-search-label { font-size: 13px; font-weight: 700; color: #9aa3b0; letter-spacing: 0.02em; }
.post-search-field {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px;
  border: 1px solid #e5e8ee; border-radius: 16px; background: #fff;
  transition: border-color 0.15s ease;
}
.post-search-field:focus-within { border-color: #9aa3b0; }
.post-search-icon { color: #9aa3b0; flex-shrink: 0; }
.post-search-field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 15px; color: #1f2430;
}
.post-search-field input::placeholder { color: #9aa3b0; }
.post-search-status { margin: 0; font-size: 13px; color: #6b7280; min-height: 18px; }
.post-search-empty { margin: 24px 0 0; font-size: 15px; line-height: 1.7; color: #6b7280; }
.post-card[hidden] { display: none; }
@media (min-width: 1024px) { .post-search { max-width: 640px; } }
