/* 공통 차트 및 캡션 스타일 */

/* 메인 타이틀 스타일 */
.fig-title {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  background-color: #F7F3F1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-family: 'Pretendard GOV Variable', 'Pretendard GOV', sans-serif;
}

/* Quarto가 자동으로 p 태그를 추가하므로 스타일 상속 */
.fig-title p {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #555 !important;
  text-align: center !important;
  font-family: 'Pretendard GOV Variable', 'Pretendard GOV', sans-serif !important;
}

/* 반쪽 타이틀 스타일 (fig-title과 동일) */
.caption-half-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #555;
  background-color: #F7F3F1;
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-family: 'Pretendard GOV Variable', 'Pretendard GOV', sans-serif;
}

/* 출처 표시 스타일 */
.caption-source {
  font-size: 12px !important;
  color: #777 !important;
  font-style: italic !important;
  margin: 0 !important;
  text-align: right !important;
  display: block !important;
}

/* Figure 컨테이너 스타일 */
.fig-label {
  margin: 30px 0;
}

/* Figure 캡션 기본 스타일 */
.fig-caption {
  width: 100% !important;
  text-align: right !important;
  margin: 15px 0 !important;
  font-size: 13px !important;
  color: #666 !important;
  font-family: 'Pretendard GOV Variable', 'Pretendard GOV', sans-serif !important;
}

.fig-caption p {
  width: 100% !important;
  text-align: right !important;
  margin: 0 !important;
}

/* 캡션 내부 요소들을 오른쪽 정렬 (2줄 표시) */
.caption-note {
  display: block !important;
  text-align: right !important;
  margin-bottom: 2px !important;
  line-height: 1.3 !important;
}

.caption-source {
  display: block !important;
  text-align: right !important;
  line-height: 1.3 !important;
}

/* Quarto 생성 div도 오른쪽 정렬 */
div.fig-caption,
div.fig-caption > p,
div.fig-caption > div {
  text-align: right !important;
  width: 100% !important;
}

/* 캡션 전체를 오른쪽 정렬 */
.quarto-figure .fig-caption {
  text-align: right !important;
  display: block !important;
  width: 100% !important;
}

/* Quarto layout에서 생성된 flex-basis 오버라이드 */
.quarto-layout-cell.fig-caption {
  flex-basis: 100% !important;
  max-width: 100% !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  text-align: right !important;
}

.quarto-layout-row .fig-caption {
  flex-basis: 100% !important;
  width: 100% !important;
}

/* iframe 차트 컨테이너 */
iframe {
  border: none;
  border-radius: 4px;
  margin: 10px auto;
  display: block;
}

/* 레이아웃 그리드 조정 */
.quarto-layout-panel {
  margin: 20px 0;
}

.quarto-layout-row {
  margin-bottom: 20px;
}

/* ========================================
   Callout 스타일 (SMR2024 기준)
   ======================================== */

#quarto-document-content .callout {
  border: solid 1px #dee2e6;
}

#quarto-document-content .callout-header {
  padding: 1rem 1.5rem;
  font-size: unset;
  background-color: #E8F6F5;
}

#quarto-document-content .callout-body {
  padding: 1rem 1.5rem;
  border-top: solid 1px #dee2e6;
  font-size: 1rem;
}

#quarto-document-content .callout-body section:last-child {
  margin-bottom: unset;
}

#quarto-document-content .callout-collapse section:last-child {
  margin-bottom: unset;
}

#quarto-document-content .callout-btn-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: unset !important;
  aspect-ratio: 1/1;
  background: #0ba29a;
  width: 2rem;
  border-radius: 2rem;
  box-shadow: 0 4px 12px rgba(100, 102, 241, .4);
}

#quarto-document-content .callout-btn-toggle .callout-toggle {
  display: flex;
}

#quarto-document-content .callout-btn-toggle .callout-toggle:before {
  margin: unset;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646L8 10.293l6.354-5.647' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center center;
  background-repeat: no-repeat;
}

/* callout-note (i) 아이콘 회색 */
#quarto-document-content div.callout-note.callout-titled .callout-icon::before,
#quarto-document-content div.callout-note:not(.callout-titled) .callout-icon::before {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="fill: %236c757d" class="bi bi-info-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></svg>');
}

/* 반응형 조정 */
@media (max-width: 768px) {
  .caption-title {
    font-size: 14px;
  }
  
  .caption-half-title {
    font-size: 12px;
  }
  
  iframe {
    width: 100% !important;
    max-width: 100%;
  }
}