/* ==========================================================================
   취미에서 전문가로 — 강의 슬라이드 디자인 시스템 (reveal.js theme)
   --------------------------------------------------------------------------
   모든 강(크롤링 / 매크로 / 블로그 등)이 공유하는 공통 테마.
   reveal.js 기본 테마 위에 얹어 덮어쓰는 방식으로 동작합니다.
   사용법: ppt-system/README.md 참고.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 디자인 토큰 (CSS 변수)
   -------------------------------------------------------------------------- */
:root {
  /* 배경 — 따뜻한 오프화이트 / 크림 */
  --c-bg:            #F7F5F0;
  --c-bg-alt:        #FAF9F6;
  --c-surface:       #FFFFFF; /* 카드 내부 (배경 위에서 살짝 떠 보이는 정도) */

  /* 텍스트 — 딥 네이비 / 차콜 */
  --c-text:          #2A2E35;
  --c-text-soft:     #555B66;
  --c-text-faint:    #8A909B;

  /* 메인 액센트 — 차분한 세이지 그린 */
  --c-accent:        #6E8B73;
  --c-accent-strong: #5C7860;
  --c-accent-soft:   #E4EBE3; /* 연한 세이지 (배경/줄무늬용) */
  --c-accent-tint:   #F0F3EE;

  /* 보조 액센트 — 따뜻한 머스타드 / 테라코타 (절제 사용) */
  --c-warm:          #C68B59;
  --c-warm-soft:     #F2E5D6;

  /* 경계선 */
  --c-border:        #E3DFD6;
  --c-border-soft:   #ECE9E2;

  /* 타이포 */
  --font-sans: "Pretendard", "Pretendard Variable", -apple-system,
               BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
               system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "D2Coding", Consolas,
               "Liberation Mono", Menlo, monospace;

  /* 라운드 / 그림자 (절제된 부드러움) */
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 6px 22px rgba(42, 46, 53, 0.06);
  --shadow-sm: 0 2px 8px  rgba(42, 46, 53, 0.05);
}

/* --------------------------------------------------------------------------
   2. 기본 reveal.js 덮어쓰기
   -------------------------------------------------------------------------- */
.reveal-viewport {
  background: var(--c-bg);
}

.reveal {
  font-family: var(--font-sans);
  font-size: 28px;            /* 본문 기준 크기 (축소: overflow 방지) */
  font-weight: 400;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.reveal .slides {
  text-align: left;
}

/* 상단 정렬 — reveal center:false 와 함께, 콘텐츠가 위에서부터 시작.
   로고(.deck-brand)·푸터(.deck-footer)는 하단에 떠 있으므로 본문 하단에는
   안전 여백을 둬 겹침을 막는다. 상단은 천장에 붙지 않을 만큼만 여백. */
.reveal .slides section {
  min-height: 720px;          /* 슬라이드 높이 확보 → 상단 정렬 기준 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  line-height: 1.55;
  padding: 40px 24px 84px;    /* 상단 적당 여백, 하단은 로고(bottom:52px)/푸터 자리 */
  box-sizing: border-box;
}

/* 슬라이드 내부 첫/끝 요소의 바깥 여백 제거 → 상단 정렬 정확도 향상 */
.reveal .slides section > :first-child { margin-top: 0; }
.reveal .slides section > :last-child  { margin-bottom: 0; }

/* 타이틀(.lead) / 섹션(.section)은 예외적으로 세로 중앙 정렬 유지 */
.reveal .slides section.lead,
.reveal .slides section.section {
  justify-content: center;
}

/* 키커 바로 뒤 제목은 위 여백 축소 */
.reveal .kicker + h2 { margin-top: 0.1em; }

/* 제목 위계 */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  font-family: var(--font-sans);
  color: var(--c-text);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-transform: none;
  text-shadow: none;
}

.reveal h1 { font-size: 2.3em; }
.reveal h2 { font-size: 1.65em; margin-bottom: 0.5em; }
.reveal h3 { font-size: 1.3em; color: var(--c-accent-strong); }
.reveal h4 { font-size: 1.05em; color: var(--c-text-soft); }

.reveal p {
  margin: 0 0 0.55em;
  line-height: 1.55;
}

.reveal strong { color: var(--c-accent-strong); font-weight: 800; }
.reveal em     { color: var(--c-warm); font-style: normal; font-weight: 700; }

.reveal a {
  color: var(--c-accent);
  text-decoration: none;
}

/* 리스트 — 넉넉한 줄간격 + 커스텀 불릿 */
.reveal ul,
.reveal ol {
  display: block;
  margin: 0.4em 0 0.4em 0.2em;
}

.reveal ul { list-style: none; }

.reveal ul > li {
  position: relative;
  padding-left: 1.3em;
  margin: 0.35em 0;
  line-height: 1.5;
}

.reveal ul > li::before {
  content: "";
  position: absolute;
  left: 0.05em;
  top: 0.62em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--c-accent);
}

.reveal ol { margin-left: 1.2em; }
.reveal ol > li { margin: 0.45em 0; line-height: 1.6; }

/* 진행 바 / 컨트롤 색상 */
.reveal .progress { color: var(--c-accent); height: 4px; }
.reveal .controls { color: var(--c-accent); }
.reveal .slide-number {
  background: transparent;
  color: var(--c-text-faint);
  font-family: var(--font-sans);
}

/* --------------------------------------------------------------------------
   3. 슬라이드 레이아웃 헬퍼
   -------------------------------------------------------------------------- */

/* 슬라이드 상단 작은 라벨(키커) */
.kicker {
  display: inline-block;
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  margin-bottom: 0.5em;
}

/* 가운데 정렬 유틸 */
.center { text-align: center; }
.muted  { color: var(--c-text-soft); }
.faint  { color: var(--c-text-faint); }
.small  { font-size: 0.82em; }
.tight  { line-height: 1.4; }

/* 2단 그리드 */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   4. 타이틀(.lead) 슬라이드
   -------------------------------------------------------------------------- */
.reveal section.lead {
  text-align: center;
}
.reveal section.lead .slogan {
  font-size: 2.7em;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0.1em 0 0.35em;
}
.reveal section.lead .slogan .hl { color: var(--c-accent); }
.reveal section.lead .subtitle {
  font-size: 1.25em;
  font-weight: 600;
  color: var(--c-text-soft);
  margin-bottom: 1em;
}
.reveal section.lead .tag {
  display: inline-block;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--c-accent-strong);
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent);
  padding: 0.45em 1.2em;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   5. 섹션 구분(.section) 슬라이드
   -------------------------------------------------------------------------- */
.reveal section.section {
  text-align: center;
}
.reveal section.section .sec-no {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: 0.2em;
  margin-bottom: 0.2em;
}
.reveal section.section h2 {
  font-size: 2.3em;
}
.reveal section.section .sec-sub {
  color: var(--c-text-soft);
  font-size: 1.05em;
  margin-top: 0.3em;
}

/* --------------------------------------------------------------------------
   6. 카드
   -------------------------------------------------------------------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card > :last-child  { margin-bottom: 0; }

.card-title {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 0.4em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.card-title .ico { font-size: 1.15em; }

/* 액센트 카드 변형 */
.card.accent {
  background: var(--c-accent-tint);
  border-color: var(--c-accent);
}
.card.accent .card-title { color: var(--c-accent-strong); }

.card.warm {
  background: var(--c-warm-soft);
  border-color: var(--c-warm);
}
.card.warm .card-title { color: var(--c-warm); }

/* 좌측 컬러 바가 있는 카드 */
.card.bar-accent { border-left: 5px solid var(--c-accent); }
.card.bar-warm   { border-left: 5px solid var(--c-warm); }

/* 장점/단점 리스트 마커 */
.list-pro > li::before { background: var(--c-accent); }
.list-con > li::before { background: var(--c-warm); }
.list-check { list-style: none; padding-left: 0; }
.list-check > li {
  padding-left: 1.6em;
  position: relative;
  margin: 0.35em 0;
}
.list-check > li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--c-accent);
  font-weight: 800;
}
.list-x { list-style: none; padding-left: 0; }
.list-x > li {
  padding-left: 1.6em;
  position: relative;
  margin: 0.35em 0;
}
.list-x > li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--c-warm);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   7. 강조 배지 / 인용 박스
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 700;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
  letter-spacing: 0.02em;
}
.badge.warm { background: var(--c-warm-soft); color: var(--c-warm); }

/* 비유 / 인용 박스 */
.quote {
  background: var(--c-accent-tint);
  border-left: 5px solid var(--c-accent);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  font-size: 1.05em;
  color: var(--c-text);
}
.quote .q-label {
  display: block;
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 0.4em;
}
.quote.warm {
  background: var(--c-warm-soft);
  border-left-color: var(--c-warm);
}
.quote.warm .q-label { color: var(--c-warm); }

/* 핵심 강조(💡 tip) */
.tip {
  background: var(--c-warm-soft);
  border: 1px solid var(--c-warm);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.85em;
  color: var(--c-text);
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
}
.tip .tip-ico { font-size: 1.2em; line-height: 1.4; }

/* --------------------------------------------------------------------------
   8. 비교표 / 일반 표
   -------------------------------------------------------------------------- */
.reveal table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.2em 0;
  font-size: 0.74em;
  background: var(--c-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
}

.reveal table thead th {
  background: var(--c-accent);
  color: #FFFFFF;
  font-weight: 800;
  text-align: left;
  padding: 0.55em 0.9em;
  border: none;
  letter-spacing: -0.01em;
}
.reveal table thead th:first-child { background: var(--c-accent-strong); }

.reveal table td,
.reveal table th {
  padding: 0.5em 0.9em;
  border: none;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
}

/* 줄무늬 */
.reveal table tbody tr:nth-child(even) td { background: var(--c-accent-tint); }
.reveal table tbody tr:last-child td      { border-bottom: none; }

/* 첫 열 강조 */
.reveal table tbody td:first-child {
  font-weight: 700;
  color: var(--c-text);
}

/* 가운데 정렬 표 변형 */
.reveal table.center-cells td:not(:first-child),
.reveal table.center-cells th:not(:first-child) { text-align: center; }

/* --------------------------------------------------------------------------
   9. 코드블록 / 다이어그램 박스
   -------------------------------------------------------------------------- */
.reveal pre {
  width: 100%;
  margin: 0.4em 0;
  box-shadow: none;
  font-size: 0.7em;
}

.reveal pre code,
.codecard {
  font-family: var(--font-mono);
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
  white-space: pre;
  overflow: auto;
  display: block;
}

/* ASCII 다이어그램을 담는 카드 (monospace 보존) */
.diagram {
  font-family: var(--font-mono);
  background: var(--c-bg-alt);
  border: 1px dashed var(--c-accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
  color: var(--c-text);
  font-size: 0.66em;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   10. HTML 플로우 다이어그램 (박스 + 화살표)
   -------------------------------------------------------------------------- */
.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.flow-box {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8em;
  box-shadow: var(--shadow-sm);
  min-width: 110px;
}
.flow-box.accent {
  background: var(--c-accent-soft);
  border-color: var(--c-accent);
  color: var(--c-accent-strong);
}
.flow-box.warm {
  background: var(--c-warm-soft);
  border-color: var(--c-warm);
  color: var(--c-warm);
}
.flow-box .step-no {
  display: block;
  font-size: 0.7em;
  color: var(--c-text-faint);
  margin-bottom: 0.2em;
  letter-spacing: 0.05em;
}
.flow-arrow {
  font-size: 1.6em;
  color: var(--c-accent);
  font-weight: 800;
}

/* 세로 흐름 */
.flow-v { flex-direction: column; }
.flow-v .flow-arrow { transform: rotate(90deg); }

/* 단계 박스 (번호 원 + 설명) */
.steps { display: flex; flex-direction: column; gap: 11px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  box-shadow: var(--shadow-sm);
}
.step .num {
  flex: 0 0 auto;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
}
.step .step-body { line-height: 1.5; }
.step .step-body strong { color: var(--c-text); }

/* --------------------------------------------------------------------------
   11. 의사결정 트리
   -------------------------------------------------------------------------- */
.tree { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tree-node {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.8em;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.tree-node.q { background: var(--c-accent-tint); border-color: var(--c-accent); }
.tree-node.result-a {
  background: var(--c-accent-soft);
  border-color: var(--c-accent);
  color: var(--c-accent-strong);
}
.tree-node.result-b {
  background: var(--c-warm-soft);
  border-color: var(--c-warm);
  color: var(--c-warm);
}
.tree-branch {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}
.tree-col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.tree-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--c-text-faint);
}
.tree-line { color: var(--c-accent); font-size: 1.3em; }

/* --------------------------------------------------------------------------
   11.5 고정 브랜드 워드마크 (모든 슬라이드 하단 중앙 오버레이)
   --------------------------------------------------------------------------
   .reveal(컨테이너) 기준 absolute 로 떠 있어, 덱당 1번만 마크업해도
   모든 슬라이드 위에 동일하게 보인다. (.slides 바깥에 작성)
   -------------------------------------------------------------------------- */
.reveal .deck-brand {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
/* 미니멀 세이지 dot 장식 */
.reveal .deck-brand::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--c-accent);
  flex: 0 0 auto;
}
/* "투더제이" 강조 + "코딩 클래스" 차분 — 마크업: <b>투더제이</b> 코딩 클래스 */
.reveal .deck-brand b {
  color: var(--c-accent-strong);
  font-weight: 800;
}
.reveal .deck-brand {
  color: var(--c-text-soft);
}

/* --------------------------------------------------------------------------
   12. 푸터 (페이지 표시)
   --------------------------------------------------------------------------
   하단 중앙은 로고(.deck-brand) 자리이므로, 푸터는 우측 하단 모서리에만
   페이지 표시를 둬 충돌을 피한다. 시리즈명(.series)은 로고와 중복이라 숨김. */
.reveal .deck-footer {
  position: fixed;
  bottom: 52px;
  right: 28px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--c-text-faint);
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 30;
}
.reveal .deck-footer .series { display: none; }

/* --------------------------------------------------------------------------
   13. 반응형 미세 조정
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cols, .cols-3 { grid-template-columns: 1fr; }
}
