/* 안전 소식 목록·글 (WP 게시판 전용 — home.php·single.php 마크업과 board/news*.html 시안). style.css 뒤에 로드한다.
   .entry-content 안은 AutoBlog 발행 HTML 그대로라 그 셀렉터로만 스타일을 건다 (site/CLAUDE.md §게시판). */
:root { --c-mark: rgba(43, 162, 58, 0.28); }

/* =====================================================================
   Board — news.html (list) + news-post.html (post)
   The post body (.entry-content) is AutoBlog's WordPress output verbatim:
   aside.post-summary, h2/h3.wp-block-heading, ul/ol.wp-block-list,
   figure.wp-block-table, figure.wp-block-image, blockquote.wp-block-quote,
   p.authority-references, div.faq-section > details. Keep selectors on those.
   ===================================================================== */
.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;
}
.sample {
  font-family: var(--font-num); font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #9CA3AF;
  border: 1px dashed #D1D5DB; padding: 3px 6px; border-radius: 4px; line-height: 1.2;
}
.post-tag {
  display: inline-block; align-self: flex-start;
  font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--c-blue);
  background: var(--c-blue-tint); padding: 6px 11px; border-radius: 999px;
}

/* ----- List ----- */
.board { padding: clamp(56px, 7vw, 104px) 0 0; }
.board-head { margin-bottom: 40px; }
.board-tabs {
  display: flex; gap: 8px; margin-bottom: 40px;
  overflow-x: auto; scrollbar-width: none;
}
.board-tabs::-webkit-scrollbar { display: none; }
.board-empty { padding: 96px 0; text-align: center; color: var(--c-muted); font-size: 17px; border-top: 1px solid var(--c-line); }
.board-tabs a {
  flex: none; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--c-line);
  font-size: 15px; font-weight: 600; color: var(--c-muted); white-space: nowrap;
  transition: border-color .2s, color .2s, background .2s;
}
.board-tabs a:hover { border-color: var(--c-text); color: var(--c-text); }
.board-tabs a[aria-current="page"] { background: var(--c-text); border-color: var(--c-text); color: #fff; }

.post-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--c-blue-tint); }
.post-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-bg-soft); }
.post-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-media .sample { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.9); }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 26px 28px 30px; }
.post-card-title {
  font-size: 20px; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; margin-top: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* whole card is the link target */
.post-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-card-title a:focus-visible { outline: none; }
.post-card:has(.post-card-title a:focus-visible) { outline: 2px solid var(--c-blue); outline-offset: 3px; }
.post-card-excerpt {
  font-size: 15px; line-height: 1.7; color: var(--c-muted); margin-top: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card time { font-family: var(--font-num); font-size: 14px; color: var(--c-muted); margin-top: auto; padding-top: 22px; }

.pagination { margin-top: 64px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 8px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px;
  font-family: var(--font-num); font-size: 15px; font-weight: 600; color: var(--c-muted);
  transition: background .2s, color .2s;
}
.pagination a.page-numbers:hover { background: var(--c-bg-soft); color: var(--c-text); }
.pagination .page-numbers.current { background: var(--c-text); color: #fff; }
.pagination iconify-icon { width: 18px; height: 18px; font-size: 18px; }

/* ----- Post ----- */
.post { padding: clamp(32px, 4vw, 56px) 0 0; }
.post-wrap { max-width: 1096px; margin: 0 auto; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--c-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #9CA3AF; }
.breadcrumb a:hover { color: var(--c-text); }

.post-head { margin-top: 32px; max-width: 880px; }
.post-title {
  font-size: clamp(30px, 3.6vw, 48px); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em;
  margin-top: 18px;
}
.post-byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0;
  margin-top: 24px; font-size: 15px; color: var(--c-muted);
}
.post-byline > * + *::before { content: "·"; margin: 0 10px; color: #D1D5DB; }
.post-byline > .sample::before { content: none; }
.post-byline .sample { margin-left: 12px; }
.post-byline time { font-family: var(--font-num); }
.post-author-name { color: var(--c-text); font-weight: 600; }

.post-hero { position: relative; aspect-ratio: 16 / 9; margin: 40px 0 64px; border-radius: var(--radius); overflow: hidden; background: var(--c-bg-soft); }
.post-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.post-layout { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 96px; }

/* TOC — class names follow the mirabo plugin (sb-toc__*) */
.post-toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow-y: auto; }
.sb-toc__title {
  display: flex; align-items: center; justify-content: space-between; list-style: none;
  font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--c-text); margin-bottom: 14px;
}
.sb-toc__title::-webkit-details-marker { display: none; }
.sb-toc__title iconify-icon { display: none; width: 20px; height: 20px; font-size: 20px; color: var(--c-muted); transition: transform .3s var(--ease); }
.sb-toc__list { border-left: 2px solid var(--c-line); }
.sb-toc__link {
  display: block; margin-left: -2px; padding: 7px 0 7px 16px; border-left: 2px solid transparent;
  font-size: 15px; line-height: 1.5; color: var(--c-muted); transition: color .2s, border-color .2s;
}
.sb-toc__link:hover { color: var(--c-text); }
.sb-toc__link[aria-current] { color: var(--c-text); font-weight: 600; border-left-color: var(--c-green); }

/* Body */
.entry-content { font-size: 18px; line-height: 1.85; color: var(--c-text); min-width: 0; }
.entry-content > :first-child { margin-top: 0; }
.entry-content p { margin: 0 0 26px; }
.entry-content h2 {
  font-size: 30px; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em;
  margin: 76px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.entry-content h3 { font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; margin: 48px 0 12px; }
.entry-content a { color: var(--c-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
/* <strong> is a highlighter, not just bold */
.entry-content strong {
  font-weight: 600;
  background: linear-gradient(transparent 60%, var(--c-mark) 60%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.entry-content a strong, .entry-content .authority-references strong { background: none; }

.entry-content .wp-block-list { margin: 0 0 26px; }
.entry-content .wp-block-list li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.entry-content ul.wp-block-list li::before {
  content: ""; position: absolute; left: 8px; top: .78em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-green);
}
.entry-content ol.wp-block-list { counter-reset: li; }
.entry-content ol.wp-block-list li { counter-increment: li; padding-left: 32px; }
.entry-content ol.wp-block-list li::before {
  content: counter(li); position: absolute; left: 0; top: .32em;
  width: 22px; height: 22px; border-radius: 50%; background: var(--c-green-tint); color: var(--c-green-dark);
  font-family: var(--font-num); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center;
}

.entry-content .wp-block-quote {
  margin: 32px 0; padding: 22px 28px;
  border-left: 3px solid var(--c-green); background: var(--c-green-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content .wp-block-quote p:last-child { margin-bottom: 0; }

.entry-content .wp-block-table { margin: 32px 0 40px; overflow-x: auto; }
.entry-content table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 16px; line-height: 1.6; }
/* 1px fixed: the lines are what make it read as a table. th (not thead th): AutoBlog tables have no <thead> */
.page-body { margin-top: 32px; }
.page-body table { min-width: 0; }
.entry-content th, .entry-content td { border: 1px solid var(--c-line); padding: 12px 16px; text-align: left; vertical-align: top; }
.entry-content th { background: var(--c-blue-tint); color: var(--c-navy); font-weight: 700; white-space: nowrap; }

/* AutoBlog images carry no width/height — fix the box so late loads never shift the page */
.entry-content .wp-block-image { margin: 40px 0; }
.entry-content .wp-block-image img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--c-bg-soft);
}
.entry-content figcaption { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--c-muted); text-align: center; }

.entry-content .authority-references {
  font-size: 15px; line-height: 1.7; color: var(--c-muted);
  padding: 14px 18px; background: var(--c-bg-soft); border-radius: 12px;
}
.entry-content .authority-references strong { color: var(--c-text); font-weight: 700; }
.entry-content .authority-references a { color: var(--c-muted); font-weight: 500; }
.entry-content .authority-references a:hover { color: var(--c-blue); }

/* Key summary (AutoBlog Stage 4) — excluded from the TOC */
.entry-content .post-summary {
  position: relative; overflow: hidden; margin: 8px 0 48px; padding: 30px 32px 26px;
  background: var(--c-blue-tint); border-radius: var(--radius-sm);
}
.entry-content .post-summary::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.entry-content .post-summary .summary-title {
  font-size: 14px; font-weight: 700; line-height: 1.4; letter-spacing: .04em; color: var(--c-blue);
  margin: 0 0 10px; padding: 0; border: 0;
}
.entry-content .summary-tldr { font-size: 19px; font-weight: 600; line-height: 1.6; margin-bottom: 16px; }
.entry-content .summary-bullets li { position: relative; padding-left: 20px; font-size: 16px; line-height: 1.7; margin-top: 6px; }
.entry-content .summary-bullets li::before {
  content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-green);
}

/* FAQ (div.faq-section > details) — same look as the main page FAQ, native details so no JS needed */
.entry-content .faq-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.entry-content .faq-section details {
  background: var(--c-bg-soft); border: 1px solid transparent; border-radius: 16px;
  transition: background .25s, border-color .25s;
}
.entry-content .faq-section details[open] { background: #fff; border-color: var(--c-blue); }
.entry-content .faq-section summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 24px; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 600; line-height: 1.45;
}
.entry-content .faq-section summary::-webkit-details-marker { display: none; }
.entry-content .faq-section summary::after {
  content: ""; flex: none; width: 18px; height: 18px;
  background: linear-gradient(var(--c-blue), var(--c-blue)) center / 100% 2px no-repeat,
              linear-gradient(var(--c-blue), var(--c-blue)) center / 2px 100% no-repeat;
  transition: transform .3s var(--ease);
}
.entry-content .faq-section details[open] summary::after { transform: rotate(45deg); }
.entry-content .faq-section details p { margin: 0; padding: 0 24px 22px; font-size: 16px; line-height: 1.75; color: var(--c-muted); }

/* Post footer */
.post-foot { max-width: 760px; margin: 72px 0 0 336px; } /* 240 TOC + 96 gap */
.post-author {
  display: grid; grid-template-columns: 72px 1fr; gap: 24px;
  padding: 32px; background: var(--c-bg-soft); border-radius: var(--radius);
}
.post-author-logo { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 16px; background: #fff; padding: 10px; }
.post-author-logo img { width: 100%; height: 100%; object-fit: contain; }
.post-author-title { font-size: 18px; font-weight: 700; }
.post-author-badge { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--c-green-dark); }
.post-author-badge iconify-icon { width: 16px; height: 16px; font-size: 16px; }
.post-author-bio { margin-top: 12px; font-size: 15px; line-height: 1.7; color: var(--c-muted); }
.post-author .link-arrow { font-size: 15px; }
.post-author .link-arrow iconify-icon, .post-related .link-arrow iconify-icon { width: 18px; height: 18px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav a {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 24px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); transition: border-color .2s;
}
.post-nav a:hover { border-color: var(--c-blue); }
.post-nav-next { grid-column: 2; text-align: right; align-items: flex-end; } /* 다음 글만 있어도 오른쪽 */
.post-nav-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--c-muted); }
.post-nav-label iconify-icon { width: 16px; height: 16px; font-size: 16px; }
.post-nav-title { font-size: 16px; font-weight: 600; line-height: 1.5; }

.post-related { padding: var(--sec-y) 0 0; }
.post-related .desc { justify-self: end; }

/* CTA 밴드 앞 여백 — 목록·글·관련 글 중 무엇이 마지막이든 다른 페이지처럼 섹션 간격 */
.board + .cta-band, .post + .cta-band, .post-related + .cta-band { margin-top: var(--sec-y); }

@media (max-width: 1279px) {
  .post-wrap { max-width: 760px; }
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-foot { margin-left: 0; }
  .post-toc {
    position: static; max-height: none; overflow: visible;
    margin-bottom: 40px; padding: 4px 24px; background: var(--c-bg-soft); border-radius: var(--radius-sm);
  }
  .sb-toc__title { margin: 0; padding: 16px 0; cursor: pointer; }
  .sb-toc__title iconify-icon { display: inline-block; }
  .sb-toc[open] .sb-toc__title iconify-icon { transform: rotate(180deg); }
  .sb-toc__list { margin-bottom: 18px; }
}
@media (max-width: 1023px) {
  .entry-content p, .entry-content .wp-block-list { margin-bottom: 24px; }
  .entry-content h2 { font-size: 28px; margin: 56px 0 16px; }
  .entry-content h3 { font-size: 21px; margin: 40px 0 10px; }
  .entry-content .wp-block-quote { padding: 20px 24px; }
  .post-related .desc { justify-self: start; }
}
@media (max-width: 767px) {
  .board-tabs { margin: 0 calc(var(--gutter) * -1) 32px; padding: 0 var(--gutter); }
  .pagination { margin-top: 48px; }
  .post-card-body { padding: 22px 22px 26px; }
  .post-card-title { font-size: 19px; }
  .post-hero { margin: 28px 0 40px; border-radius: var(--radius-sm); }
  .post-byline { font-size: 14px; }
  .entry-content { font-size: 17px; line-height: 1.8; }
  .entry-content p, .entry-content .wp-block-list { margin-bottom: 20px; }
  .entry-content h2 { font-size: 23px; margin: 44px 0 14px; padding-bottom: 12px; }
  .entry-content h3 { font-size: 19px; margin: 32px 0 8px; }
  .entry-content .wp-block-image { margin: 32px 0; }
  .entry-content .post-summary { padding: 26px 22px 22px; }
  .entry-content .summary-tldr { font-size: 17px; }
  .entry-content .faq-section summary { padding: 18px 20px; font-size: 16px; }
  .entry-content .faq-section details p { padding: 0 20px 18px; font-size: 15px; }
  .post-toc { padding: 4px 20px; }
  .post-foot { margin-top: 56px; }
  .post-author { grid-template-columns: 1fr; padding: 28px 22px; gap: 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { grid-column: auto; text-align: left; align-items: flex-start; }
}
