/* ===========================
   Heading Styles
   =========================== */
.main_content_body h1,
.main_content_body h2 {
  font-weight: 600;
  line-height: 1.4;
}

.main_content_body h3,
.main_content_body h4,
.main_content_body h5,
.main_content_body h6 {
  margin: 1.5em 0 0;
  font-weight: 600;
  line-height: 1.4;
}

.main_content_body h1 {
  font-size: 2em;
  border-bottom: 2px solid #eaecef;
  padding-bottom: 0.3em;
}

.main_content_body h2 {
  font-size: 1.5em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

.main_content_body h3 {
  font-size: 1.25em;
  color: #24292e;
}
.main_content_body h4 {
  font-size: 1em;
  color: #24292e;
}
.main_content_body h5 {
  font-size: 0.875em;
  color: #24292e;
}
.main_content_body h6 {
  font-size: 0.85em;
  color: #6a737d;
}

/* ===========================
   Text & Inline
   =========================== */
.main_content_body p {
  margin: 0.8em 0;
  line-height: 1.6;
}
.main_content_body strong {
  font-weight: 700;
}
.main_content_body em {
  font-style: italic;
}
.main_content_body code {
  background: #f6f8fa;
  border-radius: 3px;
  padding: 0.2em 0.4em;
  font-family: "Courier New", Consolas, monospace;
  font-size: 0.9em;
}
.main_content_body a {
  /* color: #0366d6; */
  text-decoration: none;
}

/* ===========================
   Lists
   =========================== */
.main_content_body ul,
.main_content_body ol {
  padding-left: 2em;
}
.main_content_body li {
  margin: 0.25em 0;
  line-height: 1.6;
}
.main_content_body ul {
  list-style-type: disc;
}
.main_content_body ol {
  list-style-type: decimal;
}
.main_content_body ul ul {
  list-style-type: circle;
}
.main_content_body ul ul ul {
  list-style-type: square;
}

/* ===========================
   Block Elements
   =========================== */
.main_content_body blockquote {
  margin: 1em 0;
  padding: 0 1em;
  border-left: 4px solid #dfe2e5;
  color: #6a737d;
  background: #f8f9fa;
}

.main_content_body pre {
  background: #f6f8fa;
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
  margin: 1em 0;
}
.main_content_body pre code {
  background: transparent;
  padding: 0;
}

.main_content_body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}
.main_content_body th,
.main_content_body td {
  border: 1px solid #dfe2e5;
  padding: 8px 12px;
  text-align: left;
}
.main_content_body th {
  background: #f6f8fa;
  font-weight: 600;
}

.main_content_body hr {
  border: 0;
  border-top: 1px solid #eaecef;
  margin: 2em 0;
}

/* ===========================
   Images
   =========================== */
.main_content_body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25em 0;
  border-radius: 4px;
  vertical-align: top;
}

/* ===========================
   Spacing Optimizations
   (이미지, 리스트, 헤딩 간 여백 조정)
   =========================== */

.main_content_body img:has(+ :is(ul, ol)) {
  margin-bottom: 0.6em;
}

.main_content_body :is(ul, ol) + img {
  margin-top: 0.6em;
}

.main_content_body p:has(> img:only-child) {
  margin: 1.25em 0;
}

.main_content_body p:has(> img:only-child):has(+ :is(ul, ol)) {
  margin: 0.2em 0;
}

.main_content_body :is(ul, ol) + p:has(> img:only-child) {
  margin-top: 0.4em;
}

.main_content_body p:has(> img + br) > br:first-of-type {
  display: none;
}
.main_content_body p:has(> img + br) > img {
  margin-bottom: 1em;
}

.main_content_body
  :is(h1, h2, h3, h4, h5, h6):has(+ :is(p:has(> img:only-child), img)) {
  margin-bottom: 0.6em;
}

.main_content_body :is(h1, h2, h3, h4, h5, h6):has(+ :is(ul, ol)) {
  margin-bottom: 0.6em;
}

.main_content_body
  :is(img, p:has(> img:only-child))
  + :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 0.8em;
}

.main_content_body p + :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 1em;
}

.main_content_body :is(h1, h2) + p {
  margin-top: 0.8em;
}

.main_content_body :is(h3, h4, h5, h6) + p {
  margin-top: 0.6em;
}
