/*
 Theme Name:   Inflearn Clone LMS Theme
 Description:  GeneratePress 기반 인프런 스타일 메인/상세 커스텀 테마
 Author:       Admin
 Template:     generatepress
 Version:      1.1.0
*/

/* 1. 웹 폰트 (Pretendard) 및 리셋 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css");

:root {
  --primary-color: #00c471; /* 인프런 시그니처 그린 */
  --primary-hover: #00b065;
  --bg-color: #f7f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-sub: #595959;
  --border-color: #e5e5e5;
  --border-radius-lg: 16px;
  --border-radius-md: 8px;
  --border-radius-pill: 999px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #1b1c1d;
  letter-spacing: -0.3px;
}

/* GeneratePress 전체 사이트 레이아웃 폭을 1440px 와이드 모드로 강제 확장 */
.grid-container {
  max-width: 1440px !important; 
}

/* ==================================
   2. 메인 페이지: 히어로 배너
===================================== */
.home-hero-banner {
  max-width: 1440px;
  margin: 30px auto;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #fff;
  border-radius: var(--border-radius-lg);
  padding: 80px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.home-hero-banner::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(0,196,113,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.home-hero-banner h2 {
  color: #fff;
  font-size: 32px;
  margin-bottom: 15px;
  font-weight: 800;
}

.home-hero-banner p {
  font-size: 18px;
  color: #9ca3af;
  margin: 0;
}

/* ==================================
   3. 메인 페이지: 대시보드 (이어서 학습하기)
===================================== */
.home-user-dashboard {
  width: 100%;
  max-width: 1440px;
  margin: 20px auto 50px;
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 40px;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(0,0,0,0.02);
  min-width: 0;
}

.home-user-dashboard h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.home-user-dashboard h3::before {
  content: "▶";
  font-size: 12px;
  color: var(--primary-color);
}

/* ==================================
   4. 메인 페이지: 카테고리 태그 (Pills)
===================================== */
.home-category-tags {
  max-width: 1440px;
  margin: 0 auto 30px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 0;
}

.home-category-tags a {
  background: var(--card-bg);
  color: var(--text-sub);
  padding: 8px 16px;
  border-radius: var(--border-radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  white-space: nowrap;
}

.home-category-tags a:hover {
  background: #f1f3f5;
}

.home-category-tags a.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ==================================
   5. 메인 페이지: 강좌 목록 그리드
===================================== */
.home-course-grid-container {
  max-width: 1440px;
  margin: 0 auto 80px;
}

.home-course-grid-container h3 {
  font-size: 22px;
}

.home-course-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

@media (max-width: 1200px) { .home-course-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .home-course-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .home-course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .home-course-grid { grid-template-columns: 1fr; } }

.course-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.02);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.course-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e5e7eb;
  overflow: hidden;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.course-card:hover .course-card-thumb img {
  transform: scale(1.05); /* 마우스 올리면 이미지 살짝 확대 */
}

.course-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-card-content h4 {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.4;
  height: 44px; /* 두 줄 제한을 위한 강제 높이 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-author {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: auto; /* 별점/가격을 하단으로 밀어냄 */
  padding-bottom: 20px;
}

.course-price-box {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-price-box .price {
  font-weight: 700;
  color: #1756db; /* 약간의 파란빛 도는 강조색 */
  font-size: 16px;
}

.course-price-box .rating {
  font-size: 12px;
  color: #f59e0b;
  font-weight: 600;
}

/* ==================================
   6. 강좌 상세 페이지 (single-sfwd-courses.php)
===================================== */
/* 워드프레스/GeneratePress 기본 사이드바 레이아웃 강제 무력화 (전체 너비 사용) */
body.single-sfwd-courses #primary {
  width: 100% !important;
}
body.single-sfwd-courses #right-sidebar,
body.single-sfwd-courses #left-sidebar {
  display: none !important;
}

.course-hero-full {
  position: relative;
  background-color: #1f2937;
  color: #fff;
  padding: 60px 0 100px; /* 플로팅 오버랩을 위해 하단 여백을 많이 줌 */
  /* GeneratePress 부모 컨테이너에 상관없이 배경만 100% 꽉 채우는 마법의 CSS */
  box-shadow: 0 0 0 100vmax #1f2937;
  clip-path: inset(0 -100vmax);
}

.course-hero-inner {
  max-width: 1200px; /* 본문 기준선 맞춤. 인프런은 상세에선 1200px 많이 씀 */
  margin: 0 auto;
  padding: 0 40px;
}

.course-hero-title {
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  margin: 15px 0;
}

.course-hero-tags {
  display: flex;
  gap: 10px;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.course-hero-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 15px;
}

.meta-rating { color: #f59e0b; font-weight: 700; }
.meta-students { color: #fff; }

.course-hero-author {
  font-size: 15px;
  color: #cbd5e1;
}
.course-hero-author strong { color: #fff; }

/* 네비게이션 탭 */
.course-nav-tabs-wrapper {
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  margin-top: -30px; /* 배너 하단 패딩부근에 안착 */
  position: relative;
  z-index: 10;
}

.course-nav-tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
  padding: 0 40px;
}

.course-nav-tabs-inner a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-sub);
  padding: 15px 0;
  position: relative;
}

.course-nav-tabs-inner a.active,
.course-nav-tabs-inner a:hover {
  color: #1b1c1d;
}

.course-nav-tabs-inner a.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

/* 2단 레이아웃 */
.course-single-wrapper {
  max-width: 1200px;
  margin: 40px auto 80px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
  padding: 0 40px;
}

.course-main-content {
  flex: 1; 
  /* 인프런은 좌측 본문이 투명 배경(배경색과 동일)에 텍스트만 나열된 경우가 많지만 카드로 유지 */
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.course-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

/* 스티키 사이드바 오버랩(플로팅) */
.course-sidebar-sticky {
  width: 320px;
  min-width: 320px;
  position: sticky;
  top: 40px;
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  margin-top: -180px; /* 🚀 배너 영역(.course-hero-full) 위방향으로 강제로 끌어올림 */
  z-index: 20;
}

.sidebar-thumb {
  margin-bottom: 20px;
}

.sidebar-price {
  font-size: 28px;
  font-weight: 800;
  color: #1b1c1d;
  margin: 0 0 15px;
}

.sidebar-guarantees ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-sub);
}

.sidebar-guarantees li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* LearnDash 결제 버튼 디자인 강제 덮어쓰기 */
.course-payment-box input[type="submit"] {
  width: 100%;
  background-color: var(--primary-color) !important;
  color: #fff !important;
  padding: 16px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer;
  transition: background 0.2s !important;
}

.course-payment-box input[type="submit"]:hover {
  background-color: var(--primary-hover) !important;
}

/* Phase 3: LearnDash 커리큘럼(Accordion) 스타일 오버라이드 (인프런 스타일) */
.ld-item-list {
  background: var(--bg-color) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  margin-top: 20px !important;
}

.ld-item-list-item {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
  transition: background 0.2s;
}

.ld-item-list-item:last-child {
  border-bottom: none !important;
}

.ld-item-list-item:hover {
  background: #fdfdfd !important;
}

.ld-item-title {
  font-weight: 600 !important;
  color: var(--text-main) !important;
}

/* ==================================
   7. 인프런 커스텀 이어서 학습하기 대시보드
===================================== */
.resume-widget-wrapper {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 15px;
  width: 100%; /* 내부 컨텐츠가 팽창하지 않도록 강제 */
  min-width: 0;
}

.resume-left-panel {
  background: #d4e9c8; /* 그린 그라데이션 대신 단색 */
  background: linear-gradient(135deg, #e4f0d0 0%, #c1dfa0 100%);
  width: 220px;
  min-width: 220px;
  height: 120px;
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0,255,0,0.1);
}

.resume-level {
  font-weight: 800;
  font-size: 16px;
  color: #333;
}

.resume-progress-bar-bg {
  width: 100px;
  margin-top: auto;
  margin-bottom: 5px;
  height: 6px;
  background-color: rgba(255,255,255,0.7);
  border-radius: 999px;
  overflow: hidden;
}

.resume-progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 999px;
}

.resume-level-percent {
  font-size: 12px;
  font-weight: bold;
  color: #555;
}

.resume-link {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 11px;
  color: #555;
  text-decoration: none;
}

.resume-right-scroller {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-top: 4px; /* 호버 애니메이션(translateY) 시 상단 짤림 방지 */
  padding-bottom: 12px; /* 스크롤바와 카드의 하단 테두리가 겹치지 않게 여백 확대 */
  flex-grow: 1;
  min-width: 0; /* ✨ 플렉스박스 자식 요소가 부모 너비를 강제로 뚫고 우측으로 늘어나는 버그 방지 */
}

.resume-right-scroller::-webkit-scrollbar {
  height: 6px;
}
.resume-right-scroller::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.resume-course-mini-card {
  display: flex;
  gap: 12px;
  min-width: 300px;
  max-width: 300px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  transition: transform 0.2s, border-color 0.2s;
}

.resume-course-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.mini-card-thumb {
  width: 90px;
  min-width: 90px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
}

.mini-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mini-card-info h4 {
  font-size: 14px;
  margin: 0 0 5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mini-card-info h4 a {
  color: var(--text-main);
  text-decoration: none;
}

.mini-card-meta {
  font-size: 11px;
  color: var(--text-sub);
}

.meta-fraction {
  font-weight: 700;
  color: var(--text-main);
}

