/* ==========================================
   Course2 — 인물/주제 안내 스킨
   - 좌측 상단: 타이틀 (t2/t3)
   - 좌측 하단: 지도 이미지 (탭별 교체)
   - 우측 상단: 노란 라인 pill 탭 (활성 시 노란 배경)
   - 우측 하단: 텍스트 + 우측 인물 이미지
   ========================================== */

/* ===== 최상위 래퍼 ===== */
.Course2 {
  width: 100%;
  float: left;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.Course2 .wg_side { width: 100%; }
.Course2 .wg_box { width: 100%; position: relative; max-width: 100%; box-sizing: border-box; }

/* === 메인 컨테이너 (좌/우 2열 × 2행 grid — 영역은 grid가 잡음) ===
   행1: 좌 titles | 우 tabs    (행1 높이 = max(titles, tabs))
   행2: 좌 map(자리만 차지)  | 우 details
   ※ course-map의 실제 이미지(wg_img_box)는 absolute로 띄워 우측 텍스트 영역까지
     자유롭게 침범 가능. 우측 텍스트는 z-index 더 높게 두어 항상 위에 보임.
*/
.Course2 .course-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  grid-template-rows: auto auto;
  column-gap: clamp(12px, calc(1.25vw + 8px), 28px);
  row-gap: clamp(20px, calc(1.56vw + 15px), 40px);
}
.Course2 .course-container * { box-sizing: border-box; }

/* 좌측 1행: 타이틀 */
.Course2 .course-titles {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  align-self: start;
  width: 100%;
  position: relative;
  z-index: 2;
  min-width: 0;
}
/* wid_title 내부 콘텐츠(.COM_tit.mb_50 등)의 자체 하단 마진 무력화 */
.Course2 .course-titles .sub_stit2 > *:last-child,
.Course2 .course-titles .sub_stit3 > *:last-child,
.Course2 .course-titles .sub_stit4 > *:last-child,
.Course2 .course-titles .sub_stit5 > *:last-child,
.Course2 .course-titles > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* 우측 1행: 탭 — 지도 absolute 위에 z-index로 항상 올라옴 */
.Course2 .course-tabs {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  align-self: end;
  position: relative;
  z-index: 3;
}

/* 좌측 2행: 지도 영역 — grid 셀에 위치(폭은 컬럼이 정함).
   안의 이미지는 absolute로 띄워 컬럼 폭과 무관하게 원본 크기 유지. */
.Course2 .course-map {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  align-self: start;
  position: relative;
  width: 100%;
  /* 이미지 자연 높이 만큼 자리 확보 (지도 원본 높이 620px) */
  height: 620px;
  z-index: 1;
  overflow: visible;
  min-width: 0;
}

/* 우측 2행: 텍스트박스 — z-index 더 높게, 좌측 지도 위에 항상 보임 */
.Course2 .course-details {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  align-self: start;
  width: 100%;
  position: relative;
  z-index: 3;
  min-width: 0;
  padding-top: clamp(20px, calc(2.34vw + 12.5px), 50px);
}
.Course2 .sub_stit2 {
  display: block;
  position: relative;
  width: 100%;
  font-size: clamp(20px, calc(0.94vw + 17px), 32px);
  color: #111827;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: clamp(6px, calc(0.31vw + 5px), 10px);
}
.Course2 .sub_stit3 {
  display: block;
  position: relative;
  width: 100%;
  font-size: clamp(22px, calc(1.25vw + 18px), 38px);
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0;
}
.Course2 .sub_stit4 {
  display: block;
  position: relative;
  width: 100%;
  font-size: clamp(13px, calc(0.23vw + 12.25px), 16px);
  color: #6b7280;
  line-height: 1.7;
  font-weight: 400;
  margin-top: clamp(14px, calc(0.78vw + 11.5px), 24px);
}

/* === 좌측 2행: 지도 이미지 ===
   PC: 모두 absolute로 좌측 0에 고정, 원본 크기 680×620 유지.
   좌측 컬럼 폭과 무관 — 컬럼이 좁아도 이미지는 우측을 그대로 침범. */
.Course2 .course-map-image {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 680px;
  height: 620px;
  max-width: none;
}
.Course2 .course-map-image.active {
  display: block;
  z-index: 1;
}
.Course2 .course-map-image .wg_img_box {
  position: relative;
  width: 680px;
  height: 620px;
  display: block;
  overflow: visible;
}
.Course2 .course-map-image .wg_img_box img {
  width: 680px;
  height: 620px;
  max-width: none;
  display: block;
}

/* === 우측 1행: 탭 (노란 라인 pill) === */
.Course2 .course-tabs {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  /* line-height 보정: t3 텍스트 baseline 부근까지 끌어올림 */
  margin-bottom: clamp(4px, calc(0.31vw + 3px), 8px);
}
.Course2 .course-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, calc(0.31vw + 7px), 12px) clamp(14px, calc(0.78vw + 11.5px), 24px);
  background: transparent;
  border: 1.5px solid #f59e0b;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  font-size: clamp(13px, calc(0.31vw + 12px), 17px);
  color: #f59e0b;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  min-height: 0;
}
.Course2 .course-tab:hover {
  background: rgba(245, 158, 11, 0.08);
}
.Course2 .course-tab.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
}
.Course2 .course-tab-label {
  display: inline-block;
  vertical-align: middle;
}

/* === 우측 2행: 상세 === */
.Course2 .course-detail {
  display: none;
}
.Course2 .course-detail.active {
  display: block;
  animation: course2-fadein 0.25s ease;
}
@keyframes course2-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 상세 내부: 좌 텍스트 + 우 인물 이미지
   인물 이미지 폭은 화면 폭에 비례해 부드럽게 축소 (작은 화면에서 더 작게) */
.Course2 .course-detail-inner {
  display: grid;
  grid-template-columns: 1fr clamp(140px, calc(28.6vw - 110px), 360px);
  gap: clamp(14px, calc(2.0vw + 6px), 40px);
  align-items: start;
  width: 100%;
}

/* 텍스트 영역 */
.Course2 .course-detail-text {
  min-width: 0;
}

/* 텍스트 2/3/4 묶음 (앞에 검은 세로라인) */
.Course2 .course-head {
  position: relative;
  padding-left: clamp(14px, calc(0.78vw + 11.5px), 24px);
  margin-bottom: clamp(16px, calc(1.25vw + 12px), 32px);
}
.Course2 .course-head::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: #111827;
  border-radius: 0;
}
.Course2 .course-sub {
  font-size: clamp(13px, calc(0.23vw + 12.25px), 16px);
  color: #4b5563;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: clamp(6px, calc(0.31vw + 5px), 10px);
  line-height: 1.4;
}
.Course2 .course-main {
  font-size: clamp(24px, calc(1.56vw + 19px), 44px);
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: clamp(4px, calc(0.16vw + 3.5px), 6px);
}
.Course2 .course-year {
  font-size: clamp(13px, calc(0.23vw + 12.25px), 16px);
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* 본문 (txt5) */
.Course2 .course-body {
  font-size: clamp(14px, calc(0.23vw + 13.25px), 17px);
  color: #374151;
  line-height: 1.75;
  letter-spacing: -0.01em;
}
.Course2 .course-body p { margin: 0 0 0.6em; }
.Course2 .course-body p:last-child { margin-bottom: 0; }

/* 우측 인물 이미지 */
.Course2 .course-detail-img {
  width: 100%;
  max-width: clamp(140px, calc(28.6vw - 110px), 360px);
  justify-self: end;
}
.Course2 .course-detail-img .wg_img_box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: clamp(10px, calc(0.47vw + 8.5px), 16px);
  background: #f3f4f6;
}
.Course2 .course-detail-img .wg_img_box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* === 태블릿 (1024px 이하): 1열 세로 배치 — titles → tabs → map → details === */
@media screen and (max-width: 1024px) {
  .Course2 .course-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    row-gap: clamp(20px, 3vw, 30px);
  }
  /* 모바일 순서: 타이틀 → 탭 → 상세(텍스트+img2) → 지도(img1) 맨 아래 */
  .Course2 .course-titles { grid-column: 1 / 2; grid-row: 1 / 2; align-self: start; }
  .Course2 .course-tabs   { grid-column: 1 / 2; grid-row: 2 / 3; align-self: start; }
  .Course2 .course-details{
    grid-column: 1 / 2; grid-row: 3 / 4; align-self: start;
    padding-top: 0;
    background: transparent;
  }
  .Course2 .course-map    {
    grid-column: 1 / 2; grid-row: 4 / 5; align-self: start;
    aspect-ratio: auto;
    height: auto; /* 1열에서는 자연 높이로 — PC 620px 고정 해제 */
  }
  /* 1열 배치에서는 침범 해제 — 폭에 맞춰 100%로 축소, 높이는 자연값 */
  .Course2 .course-map-image {
    position: relative;
    width: 100%;
    height: auto;
  }
  .Course2 .course-map-image:not(.active) {
    position: absolute;
  }
  .Course2 .course-map-image .wg_img_box {
    width: 100%;
    height: auto;
    display: block;
  }
  .Course2 .course-map-image .wg_img_box img {
    width: 100%;
    height: auto;
    max-width: 100%;
  }
  .Course2 .course-detail-inner {
    grid-template-columns: 1fr clamp(140px, 22vw, 220px);
  }
}

/* === 모바일 (640px 이하) === */
@media screen and (max-width: 640px) {
  /* 탭: 6개씩 가로 꽉 차게 grid 배열 */
  .Course2 .course-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
  }
  .Course2 .course-tab {
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    font-size: clamp(11px, 2.8vw, 13px);
  }
  .Course2 .course-tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  /* 인물 이미지: 가로 100%, 3:2 비율로 크롭 */
  .Course2 .course-detail-img {
    max-width: 100%;
    width: 100%;
    justify-self: stretch;
  }
  .Course2 .course-detail-img .wg_img_box {
    aspect-ratio: 3 / 2;
    border-radius: clamp(10px, 2.5vw, 14px);
  }
  .Course2 .course-detail-img .wg_img_box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .Course2 .course-detail-inner {
    grid-template-columns: 1fr;
    gap: clamp(14px, 4vw, 22px);
  }
  .Course2 .course-main {
    font-size: clamp(22px, 6.5vw, 30px);
  }
}
