/* ============================================
   Base Styles
   ============================================
   기본 HTML 태그 스타일 정의
   모든 스타일은 design-system.css의 CSS 변수를 참조합니다.
   ============================================ */

/* ========== HTML & Body ========== */
/* 2025-10-06: CSS 변수 기반 타이포그래피 전체 적용 */
html {
  font-size: 16px;
  font-family: var(--font-family) !important;  /* Tailwind reset 덮어쓰기 */
  color: var(--text-primary);
  -webkit-text-size-adjust: none;
  word-spacing: -0.025em;
  word-break: keep-all;
}

body {
  font-size: var(--font-body);
  font-weight: var(--weight-body);
  line-height: var(--line-body);
  letter-spacing: var(--spacing-body);
}

/* ========== 제목 태그 (Headings) ========== */
/* 2025-10-05: CSS 변수를 사용한 반응형 타이포그래피 적용 */
/* 2025-10-06: font-weight, line-height, letter-spacing에도 !important 추가 - 다른 CSS 덮어쓰기 방지 */
h1 {
  font-size: var(--font-h1) !important;
  font-weight: var(--weight-h1) !important;
  line-height: var(--line-h1) !important;
  letter-spacing: var(--spacing-h1) !important;
}

h2 {
  font-size: var(--font-h2) !important;
  font-weight: var(--weight-h2) !important;
  line-height: var(--line-h2) !important;
  letter-spacing: var(--spacing-h2) !important;
}

h3 {
  font-size: var(--font-h3) !important;
  font-weight: var(--weight-h3) !important;
  line-height: var(--line-h3) !important;
  letter-spacing: var(--spacing-h3) !important;
}

h4 {
  font-size: var(--font-h4) !important;
  font-weight: var(--weight-h4) !important;
  line-height: var(--line-h4) !important;
  letter-spacing: var(--spacing-h4) !important;
}

/* ========== 본문 텍스트 ========== */
/* 2025-10-06: CSS 변수 기반 타이포그래피 전체 적용 */
p {
  font-size: var(--font-body);
  font-weight: var(--weight-body);
  line-height: var(--line-body);
  letter-spacing: var(--spacing-body);
}

/* ========== 링크 스타일 ========== */
/* 2025-10-07: 링크 밑줄 간격 설정 */
a {
  text-underline-offset: var(--link-underline-offset);
}

/* ========== 리스트 스타일 ========== */
.__dotlist > li {
  position: relative;
  padding-left: 1em;
}

.__dotlist > li:before {
  content: '●';
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  text-indent: 0;
}

.__dotlist > li ~ li {
  margin-top: 0.1em;
}

.__dotlist.dash > li:before {
  content: '-';
}

.__dotlist.star > li:before {
  content: '*';
}

.__dotlist.dang > li {
  padding-left: 1.2em;
}

.__dotlist.dang > li:before {
  content: '▶';
}

.__dotlist2 > li {
  position: relative;
  padding-left: 0em;
}

.__dotlist2 > li:before {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  text-indent: 0;
}

.__dotlist2 > li ~ li {
  margin-top: 0.1em;
}

/* ========== 테이블 디스플레이 유틸리티 ========== */
.__dtbl {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.__dtbl.auto {
  table-layout: auto;
}

.__dtbl .tr {
  display: table-row;
}

.__dtbl .td {
  display: table-cell;
}

/* ========== 반응형 iframe ========== */
.__iframe {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 비율, 4:3 = 75% */
  height: 0;
  overflow: hidden;
}

.__iframe iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========== 버튼 토글 ========== */
.btn-toggle {
  position: relative;
}

.btn-toggle::after {
  content: "";
  background: url(../images/icons_diff.png) no-repeat center;
  width: 12px;
  height: 7px;
  margin-left: 5px;
  display: inline-block;
}

/* ========== 폰트 크기 유틸리티 클래스 ========== */
/* 2025-10-05: Tailwind text-* 대체용 (CSS 변수 사용으로 반응형 자동 지원) */
.text-display {
  font-size: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--line-display);
  letter-spacing: var(--spacing-display);
}
.text-h1 {
  font-size: var(--font-h1);
  font-weight: var(--weight-h1);
  line-height: var(--line-h1);
  letter-spacing: var(--spacing-h1);
}
.text-h2 {
  font-size: var(--font-h2);
  font-weight: var(--weight-h2);
  line-height: var(--line-h2);
  letter-spacing: var(--spacing-h2);
}
.text-h3 {
  font-size: var(--font-h3);
  font-weight: var(--weight-h3);
  line-height: var(--line-h3);
  letter-spacing: var(--spacing-h3);
}
.text-h4 {
  font-size: var(--font-h4);
  font-weight: var(--weight-h4);
  line-height: var(--line-h4);
  letter-spacing: var(--spacing-h4);
}
.text-body {
  font-size: var(--font-body);
  font-weight: var(--weight-body);
  line-height: var(--line-body);
  letter-spacing: var(--spacing-body);
}
.text-small {
  font-size: var(--font-small);
  font-weight: var(--weight-small);
  line-height: var(--line-small);
  letter-spacing: var(--spacing-small);
}

/* ========== 텍스트 색상 유틸리티 클래스 ========== */
.text-primary { color: var(--text-primary); }
.text-dark { color: var(--text-dark); }
.text-accent-primary { color: var(--accent-primary); }
.text-accent-secondary { color: var(--accent-secondary); }
.text-accent-tertiary { color: var(--accent-tertiary); }
.text-accent-navy { color: var(--accent-navy); }
