/* 기본 폰트 설정 (HTML에서 최적화 로드됨 - 렌더링 차단 방지) */

body {
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

/* =============================================
   PROSE (Markdown Rendered Content) Styles
   !important 사용: Tailwind CDN Reset CSS 
   (h1-h6{font-size:inherit;font-weight:inherit})
   를 확실하게 덮어쓰기 위함
   ============================================= */

/* --- 기본 prose 컨테이너 --- */
#rendered-html {
  color: #475569 !important;
  line-height: 1.8 !important;
  word-break: keep-all !important;
}

/* --- H2: 대제목 (섹션 구분) --- */
#rendered-html h2 {
  font-size: 1.875rem !important;
  font-weight: 900 !important;
  color: #312e81 !important;
  margin-top: 3.5rem !important;
  margin-bottom: 1.25rem !important;
  padding-bottom: 0.75rem !important;
  border-bottom: 2px solid #e2e8f0 !important;
  line-height: 1.35 !important;
}

@media (min-width: 768px) {
  #rendered-html h2 {
    font-size: 2.25rem !important;
  }
}

/* --- H3: 소제목 --- */
#rendered-html h3 {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  color: #3730a3 !important;
  margin-top: 2.5rem !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.4 !important;
}

@media (min-width: 768px) {
  #rendered-html h3 {
    font-size: 1.75rem !important;
  }
}

/* --- H4 --- */
#rendered-html h4 {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #1e40af !important;
  margin-top: 2rem !important;
  margin-bottom: 0.5rem !important;
}

/* --- 단락 --- */
#rendered-html p {
  font-size: 1.1rem !important;
  line-height: 1.9 !important;
  margin-bottom: 1.5rem !important;
  color: #475569 !important;
  word-break: keep-all !important;
}

@media (min-width: 768px) {
  #rendered-html p {
    font-size: 1.2rem !important;
  }
}

/* --- 강조 (볼드) --- */
#rendered-html strong {
  font-weight: 800 !important;
  color: #0f172a !important;
  background-color: #fef9c3 !important;
  padding: 0 4px !important;
  border-radius: 3px !important;
}

/* --- 이탤릭 --- */
#rendered-html em {
  font-style: italic !important;
  color: #64748b !important;
}

/* --- 링크 --- */
#rendered-html a {
  color: #f43f5e !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
#rendered-html a:hover {
  color: #e11d48 !important;
  text-decoration: underline !important;
}

/* --- 인용구 --- */
#rendered-html blockquote {
  border-left: 4px solid #f43f5e !important;
  background-color: #fff1f2 !important;
  padding: 1rem 1.5rem !important;
  border-radius: 0 1rem 1rem 0 !important;
  margin: 1.5rem 0 !important;
  font-style: normal !important;
  color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}
#rendered-html blockquote p {
  margin-bottom: 0 !important;
}

/* --- 순서 없는 목록 --- */
#rendered-html ul {
  list-style-type: disc !important;
  padding-left: 1.75rem !important;
  margin-bottom: 1.5rem !important;
}

/* --- 순서 있는 목록 --- */
#rendered-html ol {
  list-style-type: decimal !important;
  padding-left: 1.75rem !important;
  margin-bottom: 1.5rem !important;
}

/* --- 목록 항목 --- */
#rendered-html li {
  margin-bottom: 0.5rem !important;
  color: #475569 !important;
  font-size: 1.05rem !important;
  line-height: 1.75 !important;
}

/* --- 코드 (인라인) --- */
#rendered-html code {
  background-color: #f1f5f9 !important;
  color: #be123c !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-family: 'Courier New', monospace !important;
}

/* --- 코드 블록 --- */
#rendered-html pre {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  padding: 1.5rem !important;
  border-radius: 1rem !important;
  overflow-x: auto !important;
  margin: 1.5rem 0 !important;
}
#rendered-html pre code {
  background: none !important;
  color: inherit !important;
  padding: 0 !important;
  font-size: 0.9rem !important;
}

/* --- 구분선 (hr) --- */
#rendered-html hr {
  border: none !important;
  border-top: 2px solid #e2e8f0 !important;
  margin: 3rem 0 !important;
}

/* --- 이미지 --- */
#rendered-html img {
  border-radius: 1.5rem !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 1.5rem auto !important;
  display: block !important;
}

/* --- 테이블 --- */
#rendered-html table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.5rem 0 !important;
  font-size: 0.95rem !important;
  display: block !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
@media (max-width: 640px) {
  #rendered-html table {
    font-size: 0.82rem !important;
  }
  #rendered-html th, #rendered-html td {
    padding: 0.5rem 0.6rem !important;
    white-space: nowrap !important;
  }
}
#rendered-html th {
  background-color: #f1f5f9 !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  padding: 0.75rem 1rem !important;
  text-align: left !important;
  border: 1px solid #e2e8f0 !important;
}
#rendered-html td {
  padding: 0.65rem 1rem !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}
#rendered-html tr:nth-child(even) td {
  background-color: #f8fafc !important;
}

/* --- 링크 변환 버튼 --- */
#rendered-html a.converted-btn {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  padding: 1.25rem 2rem !important;
  margin: 1rem 0 2rem !important;
  background-color: #f43f5e !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  border-radius: 1rem !important;
  font-size: 1.1rem !important;
  text-decoration: none !important;
  box-shadow: 0 10px 30px rgba(244,63,94,.25) !important;
}

@media (min-width: 768px) {
  #rendered-html a.converted-btn {
    width: auto !important;
  }
}
