/* Local-only v2 refinements: aligned archive, full thumbnails, news reading UI. */

/* Empty auto-ads must not reserve a 280px blank slot. Filled ads remain intact. */
.google-auto-placed:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.home #main > .ct-container {
  align-items: start !important;
}

body.home #main > .ct-container > section,
body.home #main > .ct-container > #sidebar,
body.home #main > .ct-container > aside {
  align-self: start !important;
  margin-top: 0 !important;
}

body.home #main > .ct-container > section > .entries {
  margin-top: 0 !important;
}

/* Preserve the complete thumbnail. Letterboxing is intentional. */
.entries[data-layout="simple"] .entry-card .ct-media-container {
  background: #e7ecf0 !important;
  box-shadow: inset -1px 0 #d8e0e6 !important;
}

.entries[data-layout="simple"] .entry-card .ct-media-container img {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Naver News-inspired single article reading experience. */
body.single-post {
  --news-reading-width: 880px;
  background: #f5f6f7 !important;
}

body.single-post .ct-trending-block {
  display: none !important;
}

body.single-post #main.site-main {
  padding: 24px 20px 64px !important;
  background: #f5f6f7 !important;
}

body.single-post #main > .ct-container {
  display: block !important;
  width: min(1040px, 100%) !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  padding-top: 24px !important;
}

body.single-post #sidebar {
  display: none !important;
}

body.single-post article.post {
  width: 100% !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  border: 1px solid #e5e8eb !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 2px 12px rgba(30, 30, 35, 0.035) !important;
}

body.single-post article.post > .hero-section {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 52px 64px 30px !important;
  border-bottom: 0 !important;
  background: #fff !important;
}

body.single-post article.post .entry-header {
  width: min(var(--news-reading-width), 100%) !important;
  max-width: var(--news-reading-width) !important;
  margin: 0 auto !important;
}

body.single-post article.post .page-title {
  margin: 0 0 22px !important;
  color: #1e1e23 !important;
  font-size: clamp(32px, 3.15vw, 42px) !important;
  font-weight: 800 !important;
  line-height: 1.28 !important;
  letter-spacing: -0.045em !important;
  word-break: keep-all !important;
}

body.single-post article.post .entry-header .entry-meta {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px 14px !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
  color: #767b83 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

body.single-post article.post .entry-header .meta-author a {
  color: #303038 !important;
  font-weight: 800 !important;
}

body.single-post article.post .entry-header .meta-categories a {
  padding: 5px 9px !important;
  border-radius: 999px !important;
  background: #e9f8f0 !important;
  color: #078a4e !important;
  font-weight: 800 !important;
}

.hse-news-tools {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
}

.hse-news-tools__actions {
  display: flex !important;
  gap: 7px !important;
}

.hse-news-tools button {
  min-width: 34px !important;
  height: 32px !important;
  padding: 0 9px !important;
  border: 1px solid #dfe3e6 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #51565d !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.hse-news-tools button:hover {
  border-color: #a9dfc2 !important;
  background: #f2fbf6 !important;
  color: #078a4e !important;
}

body.hse-share-dialog-open {
  overflow: hidden !important;
}

.hse-share-dialog[hidden] {
  display: none !important;
}

.hse-share-dialog {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
}

.hse-share-dialog__backdrop {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(3px) !important;
  cursor: default !important;
}

.hse-share-dialog__panel {
  position: relative !important;
  z-index: 1 !important;
  width: min(440px, 100%) !important;
  padding: 24px !important;
  border: 1px solid #dfe3e6 !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24) !important;
}

.hse-share-dialog__header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 20px !important;
  margin-bottom: 20px !important;
}

.hse-share-dialog__header h2 {
  margin: 0 0 5px !important;
  color: #1e1e23 !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

.hse-share-dialog__header p {
  margin: 0 !important;
  color: #767b83 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.hse-share-dialog__close {
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1px solid #e2e6e9 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #51565d !important;
  font-size: 23px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.hse-share-dialog__options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.hse-share-option {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 54px !important;
  padding: 9px 12px !important;
  border: 1px solid #e2e6e9 !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: #303038 !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.hse-share-option:hover,
.hse-share-option:focus-visible {
  border-color: #a9dfc2 !important;
  background: #f5fbf8 !important;
  color: #078a4e !important;
  outline: none !important;
}

.hse-share-option__icon {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

.hse-share-option__icon--copy { background: #475569 !important; }
.hse-share-option__icon--email { background: #ea4335 !important; }
.hse-share-option__icon--naver { background: #03c75a !important; }
.hse-share-option__icon--facebook { background: #1877f2 !important; }
.hse-share-option__icon--x { background: #111827 !important; }

body.single-post article.post > .entry-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 64px 64px !important;
  background: #fff !important;
}

body.single-post article.post .entry-content > .doc-post {
  width: min(var(--news-reading-width), 100%) !important;
  max-width: var(--news-reading-width) !important;
  margin: 0 auto !important;
  padding: 40px 0 72px !important;
  background: #fff !important;
  color: #303038 !important;
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body.single-post article.post :is(.doc-post, .safety-post) p:not(.kicker):not(.meta),
body.single-post article.post :is(.doc-post, .safety-post) li {
  color: #303038 !important;
  font-size: var(--hse-news-font-size, 18px) !important;
  line-height: 1.9 !important;
  letter-spacing: -0.018em !important;
  word-break: keep-all !important;
}

body.single-post article.post .doc-post > p {
  margin: 0 0 1.45em !important;
}

body.single-post article.post .doc-post h2 {
  margin: 64px 0 22px !important;
  padding-top: 30px !important;
  border-top: 1px solid #eceff1 !important;
  color: #1e1e23 !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.04em !important;
  word-break: keep-all !important;
}

body.single-post article.post .doc-post h3 {
  margin: 42px 0 16px !important;
  color: #242428 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  letter-spacing: -0.035em !important;
}

body.single-post article.post .doc-post a {
  color: #087f49 !important;
  text-decoration-color: #9ed9ba !important;
  text-underline-offset: 3px !important;
}

body.single-post article.post .doc-post img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin-inline: auto !important;
  border-radius: 12px !important;
  object-fit: contain !important;
}

body.single-post article.post .doc-post figure,
body.single-post article.post .doc-post .wp-block-image {
  margin: 34px auto !important;
}

body.single-post article.post .doc-post figcaption {
  margin-top: 10px !important;
  color: #868b92 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  text-align: center !important;
}

body.single-post article.post #ez-toc-container {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 300px !important;
  margin: 14px 0 30px !important;
  padding: 20px 22px !important;
  overflow: auto !important;
  border: 1px solid #dfeee6 !important;
  border-radius: 14px !important;
  background: #f6fbf8 !important;
  box-shadow: none !important;
}

body.single-post article.post #ez-toc-container .ez-toc-title {
  color: #1e1e23 !important;
  font-size: 0 !important;
  font-weight: 800 !important;
}

body.single-post article.post #ez-toc-container .ez-toc-title::after {
  content: "기사 목차" !important;
  font-size: 15px !important;
}

body.single-post article.post #ez-toc-container ul.ez-toc-list {
  max-height: 190px !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
}

body.single-post article.post #ez-toc-container a {
  padding-block: 5px !important;
  color: #52575e !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  text-decoration: none !important;
}

body.single-post article.post #ez-toc-container li {
  font-size: 14px !important;
  line-height: 1.55 !important;
  letter-spacing: normal !important;
  word-break: normal !important;
}

body.single-post article.post [data-hse-outline-simplified="1"] #ez-toc-container .hse-toc-flattened-root > a {
  display: none !important;
}

body.single-post article.post [data-hse-outline-simplified="1"] #ez-toc-container .hse-toc-promoted-list {
  margin: 0 !important;
  padding-left: 0 !important;
}

body.single-post article.post [data-hse-outline-simplified="1"] #ez-toc-container .hse-toc-promoted-list > li > a::before {
  content: counter(item) ". " !important;
}

body.single-post article.post blockquote {
  margin: 34px 0 !important;
  padding: 22px 24px !important;
  border: 0 !important;
  border-left: 4px solid #08a65c !important;
  border-radius: 0 12px 12px 0 !important;
  background: #f6f8f9 !important;
}

body.single-post article.post table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden !important;
  border: 1px solid #e5e8eb !important;
  border-radius: 12px !important;
  font-size: 15px !important;
}

body.single-post article.post th {
  background: #f4f6f7 !important;
  color: #303038 !important;
  font-weight: 800 !important;
}

body.single-post article.post .post-navigation {
  width: min(var(--news-reading-width), calc(100% - 128px)) !important;
  max-width: var(--news-reading-width) !important;
  margin: 0 auto 46px !important;
  padding-top: 24px !important;
  border-top: 1px solid #eceff1 !important;
}

body.single-post .ct-related-posts-container {
  background: #fff !important;
  border-top: 1px solid #e5e8eb !important;
}

@media (max-width: 768px) {
  .entries[data-layout="simple"] .entry-card .ct-media-container {
    box-shadow: inset 0 -1px #d8e0e6 !important;
  }

  body.single-post #main.site-main {
    padding: 8px 0 36px !important;
  }

  body.single-post #main > .ct-container {
    width: 100% !important;
    padding-top: 8px !important;
  }

  body.single-post article.post {
    border-inline: 0 !important;
    border-radius: 0 !important;
  }

  body.single-post article.post > .hero-section {
    padding: 30px 20px 22px !important;
  }

  body.single-post article.post .page-title {
    margin-bottom: 18px !important;
    font-size: 28px !important;
    line-height: 1.32 !important;
  }

  body.single-post article.post .entry-header .entry-meta {
    flex-wrap: wrap !important;
  }

  .hse-news-tools {
    flex: 0 0 100% !important;
    width: 100% !important;
    margin: 4px 0 0 !important;
  }

  .hse-news-tools__actions {
    width: 100% !important;
    justify-content: flex-end !important;
  }

  body.single-post article.post > .entry-content {
    padding: 0 20px 40px !important;
  }

  body.single-post article.post .entry-content > .doc-post {
    padding: 30px 0 52px !important;
  }

  body.single-post article.post :is(.doc-post, .safety-post) p:not(.kicker):not(.meta),
  body.single-post article.post :is(.doc-post, .safety-post) li {
    font-size: var(--hse-news-font-size-mobile, 17px) !important;
    line-height: 1.85 !important;
    word-break: normal !important;
  }

  body.single-post article.post .doc-post h2 {
    margin-top: 50px !important;
    padding-top: 24px !important;
    font-size: 24px !important;
  }

  body.single-post article.post .doc-post h3 {
    margin-top: 34px !important;
    font-size: 20px !important;
  }

  body.single-post article.post #ez-toc-container {
    max-height: 320px !important;
    padding: 18px !important;
  }

  body.single-post article.post #ez-toc-container ul.ez-toc-list {
    max-height: 235px !important;
  }

  body.single-post article.post .post-navigation {
    width: calc(100% - 40px) !important;
    margin-bottom: 34px !important;
  }
}

@media print {
  body.single-post #header,
  body.single-post .ct-trending-block,
  body.single-post .hse-news-tools,
  body.single-post #footer,
  body.single-post .ct-related-posts-container,
  body.single-post .post-navigation,
  body.single-post .google-auto-placed {
    display: none !important;
  }

  body.single-post,
  body.single-post #main.site-main,
  body.single-post article.post,
  body.single-post article.post > .hero-section,
  body.single-post article.post > .entry-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-inline: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.single-post article.post #ez-toc-container {
    max-height: none !important;
    overflow: visible !important;
  }

  body.single-post article.post #ez-toc-container ul.ez-toc-list {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* HSE article spacing: one horizontal gutter, predictable vertical rhythm. */
@media screen {
  body.single-post article.post:has(> .entry-content > .safety-post) {
    padding: 0 !important;
  }

  body.single-post article.post > .entry-content:has(> .safety-post) {
    padding: 0 !important;
  }

  body.single-post article.post .entry-content > .safety-post {
    box-sizing: border-box;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 24px 56px;
  }

  body.single-post article.post .safety-post section {
    margin: 28px 0;
  }

  body.single-post article.post .safety-post h2 {
    margin: 0 0 14px !important;
  }

  body.single-post article.post .safety-post h3 {
    margin: 22px 0 10px !important;
  }

  body.single-post article.post .safety-post p {
    margin: 0 0 12px !important;
  }

  body.single-post article.post .safety-post :is(.summary-box, .callout, blockquote) {
    margin: 18px 0 24px;
    padding: 16px 18px;
  }

  body.single-post article.post .safety-post :is(.summary-box, .callout, blockquote) > :last-child {
    margin-bottom: 0 !important;
  }

  body.single-post article.post .safety-post :is(th, td) {
    padding: 10px 12px !important;
  }
}

@media screen and (max-width: 768px) {
  body.single-post article.post .entry-content > .safety-post {
    padding: 20px 14px 40px;
  }

  body.single-post article.post .safety-post section {
    margin: 24px 0;
  }

  body.single-post article.post .safety-post :is(.summary-box, .callout, blockquote) {
    margin: 16px 0 22px;
    padding: 14px;
  }

  body.single-post article.post .safety-post :is(th, td) {
    padding: 8px 10px !important;
  }
}
