/* HMY Astra Theme 1.0 — 인쇄/PDF 최적화 */

@page {
  margin: 18mm 16mm;
}

html,
body {
  background: #fff !important;
  color: #111 !important;
}

/* 화면 전용 UI 제거 */
.editorial-header,
.editorial-post-tools,
.astra-comments,
.astra-bg,
.astra-sidebar,
.astra-mobile-header,
.astra-scrim,
.astra-search,
.astra-progress,
.astra-toc,
.astra-post__toc-mobile,
.astra-skip,
.astra-share,
.astra-code__header,
.astra-anchor,
.astra-anchor-feedback,
.astra-lightbox,
.astra-footer__links,
.astra-toc-mobile__toggle {
  display: none !important;
}

.astra-shell {
  margin: 0 !important;
}

.astra-main {
  max-width: none !important;
  padding: 0 !important;
}

.astra-content,
.astra-post__footer,
.astra-post__header {
  max-width: none !important;
  color: #111 !important;
  font-size: 11.5pt;
  line-height: 1.55;
}

.astra-content a,
.astra-content a:visited {
  color: #111 !important;
  text-decoration: underline;
}

.astra-content a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 9pt;
  color: #555;
  word-break: break-all;
}

.astra-post__kicker,
.astra-post__meta,
.astra-item__meta,
.astra-page-header__meta,
.astra-featured__meta {
  color: #444 !important;
}

.astra-item__excerpt,
.astra-featured__excerpt,
.astra-post__excerpt,
.astra-content blockquote {
  color: #333 !important;
}

/* 코드: 인쇄 고대비 */
.astra-content .kg-code-card,
.astra-content > pre,
.astra-content :not(pre) > code {
  background: #f6f7f9 !important;
  border: 1px solid #c9ced6 !important;
  color: #111 !important;
}

.astra-content .kg-code-card pre,
.astra-content > pre code {
  color: #111 !important;
  font-size: 9.5pt;
  white-space: pre-wrap !important;
  word-break: break-word;
}

.astra-content .kg-code-card figcaption {
  color: #444 !important;
  border-top-color: #d5d9e0 !important;
}

.astra-code__line::before {
  color: #777 !important;
}

/* 표: 페이지 폭 최대 활용 */
.astra-table-wrap,
.astra-table-scroll {
  overflow: visible !important;
}

.astra-table-wrap::after {
  display: none !important;
}

.astra-content table {
  width: 100% !important;
  font-size: 9.5pt;
  page-break-inside: auto;
}

.astra-content thead {
  display: table-header-group;
}

.astra-content tr {
  page-break-inside: avoid;
}

.astra-content th,
.astra-content td {
  border: 1px solid #c9ced6 !important;
  color: #111 !important;
  background: transparent !important;
  position: static !important;
}

/* 이미지와 카드가 페이지 중간에서 잘리지 않도록 */
.astra-content img,
.astra-content figure,
.astra-content .kg-image-card,
.astra-content .kg-gallery-card,
.astra-content .kg-embed-card,
.astra-content .kg-bookmark-card,
.astra-content .kg-callout-card,
.astra-content .kg-toggle-card,
.astra-diagram {
  page-break-inside: avoid;
  break-inside: avoid;
}

.astra-content img,
.astra-content .kg-image-card img {
  border: 1px solid #c9ced6 !important;
  max-width: 100% !important;
}

.astra-content h1,
.astra-content h2,
.astra-content h3,
.astra-post__title,
.astra-page-header__title {
  color: #000 !important;
  page-break-after: avoid;
  break-after: avoid;
  page-break-inside: avoid;
}

.astra-content p,
.astra-content ul,
.astra-content ol {
  orphans: 3;
  widows: 3;
}

/* Callout: 색 없이도 의미가 남도록 */
.astra-content .kg-callout-card {
  background: #f6f7f9 !important;
  border: 1px solid #c9ced6 !important;
  border-left-width: 3px !important;
  border-left-color: #555 !important;
}

.astra-callout__label {
  color: #333 !important;
}

/* Mermaid: 밝은 배경 대응 */
.astra-diagram {
  background: #fff !important;
  border-color: #c9ced6 !important;
}

.astra-diagram svg {
  filter: none;
}

.astra-diagram svg text,
.astra-diagram svg .nodeLabel,
.astra-diagram svg .edgeLabel {
  fill: #111 !important;
  color: #111 !important;
}

/* Toggle: 인쇄에서는 내용을 모두 펼친다 */
.astra-content .kg-toggle-content {
  display: block !important;
  color: #333 !important;
}

.astra-content .kg-toggle-card {
  border-color: #c9ced6 !important;
  background: transparent !important;
}

.astra-footer {
  border-top: 1px solid #c9ced6 !important;
  color: #333 !important;
}

.astra-footer__copy,
.astra-footer__name {
  color: #333 !important;
}

.astra-archive__year,
.astra-archive__month,
.astra-group__title,
.astra-tagindex__name {
  color: #111 !important;
}

.astra-tagindex__count,
.astra-group__tag-count,
.astra-group__description,
.astra-group__total a {
  color: #444 !important;
}

/* Editorial grid and scroll regions flatten into printable content. */
.astra-main {
  width: 100% !important;
}
.astra-post {
  display: block !important;
  padding-top: 0 !important;
}
.astra-post__aside,
.astra-footer,
.editorial-file-cta,
.editorial-diagram-source,
.astra-tabs__list {
  display: none !important;
}
.astra-content pre,
.astra-content pre code {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  min-width: 0 !important;
  overflow: visible !important;
  color: #111 !important;
}
.astra-content pre span {
  color: #111 !important;
}
.astra-content th,
.astra-content td {
  min-width: 0 !important;
  padding: 6pt !important;
  overflow-wrap: anywhere !important;
}
.astra-diagram {
  overflow: visible !important;
}
.astra-diagram svg {
  min-width: 0 !important;
  max-width: 100% !important;
}
.astra-diagram svg .node rect,
.astra-diagram svg .node polygon {
  fill: #fff !important;
  stroke: #333 !important;
}
.astra-tabs__panel[hidden] {
  display: block !important;
}
.astra-content .kg-toggle-content[hidden] {
  display: block !important;
}
.astra-content .kg-toggle-card .kg-toggle-content {
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
  top: 0 !important;
}
.astra-tabs__panel::before {
  content: attr(aria-label);
  display: block;
  color: #111;
  font-weight: 650;
  font-size: 11pt;
}
.astra-content .kg-video-container,
.astra-content .editorial-video-frame,
.astra-content .kg-audio-player,
.astra-content .kg-audio-thumbnail,
.astra-content .kg-toggle-card-icon,
.editorial-media-error,
.astra-postnav {
  display: none !important;
}
.editorial-print-media {
  display: block !important;
  margin: 10pt 0;
}
.astra-content .kg-audio-card {
  break-inside: avoid;
  min-height: 0;
}
