/* 교육 프로그램 목록 페이지(programs) 스타일.
   web-renewal의 src/app/programs/page.tsx 인라인 스타일을 클래스로 추출했다.
   필터 사이드바/카드 그리드는 programs.js가 렌더하며, 여기 클래스를 적용한다. */

/* base.html의 <main class="max-w-6xl ... py-8">가 콘텐츠 폭을 제한하므로
   풀블리드(가장자리까지) 섹션을 위해 뷰포트 전체 폭으로 탈출시킨다. */
.programs-page {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  /* <main>의 상하 py-8(2rem) 패딩을 상쇄 */
  margin-top: -2rem;
  margin-bottom: -2rem;
  font-family: "Noto Sans KR", "Pretendard", sans-serif;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.pp-hero {
  background: linear-gradient(180deg, #d33500 0%, #962500 100%);
  position: relative;
  overflow: hidden;
  min-height: 579px;
}
.pp-hero-shape {
  position: absolute;
  right: -60px;
  top: 65px;
  width: 802px;
  height: 638px;
  pointer-events: none;
}
.pp-hero-blend {
  position: absolute;
  right: 100px;
  bottom: -43px;
  width: 686px;
  height: 746px;
  mix-blend-mode: plus-lighter;
  pointer-events: none;
}
.pp-hero-illust {
  position: absolute;
  right: 60px;
  top: 60px;
  width: 650px;
  height: 500px;
  pointer-events: none;
}
.pp-hero-laptop {
  position: absolute;
  left: 124px;
  top: 96px;
  width: 340px;
  height: 211px;
  border-radius: 20px;
  border: 1.575px solid white;
  background: linear-gradient(180deg, #fff 0%, #ffcc9e 100%);
}
.pp-hero-screen { position: absolute; left: 105px; top: 75px; width: 376px; height: 254px; }
.pp-hero-bar1 { position: absolute; left: 58px; top: 329px; width: 471px; height: 50px; }
.pp-hero-bar2 { position: absolute; left: 58px; top: 379px; width: 471px; height: 28px; }
.pp-hero-play { position: absolute; left: 249px; top: 156px; width: 93px; height: 93px; }
.pp-hero-gpt { position: absolute; left: 0; top: 155px; width: 143px; height: 143px; }
.pp-hero-gear {
  position: absolute;
  right: -20px;
  top: 220px;
  width: 167px;
  height: 234px;
  transform: rotate(14.23deg);
}
.pp-hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 200px 24px 80px;
  position: relative;
  z-index: 1;
}
.pp-hero-text {
  display: flex;
  flex-direction: column;
  gap: 21px;
}
.pp-hero-title {
  font-size: 80px;
  font-weight: 800;
  color: white;
  letter-spacing: -1.5px;
  line-height: 92px;
  margin: 0;
}
.pp-hero-desc {
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 33px;
  margin: 0;
}

/* ── Filter + Grid ────────────────────────────────────────────── */
.pp-body { background-color: white; }
.pp-body-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 130px 24px 140px;
  display: flex;
  gap: 100px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.pp-sidebar {
  width: 297px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 35px;
}
.pp-filterbox {
  background-color: #f6f7f7;
  border: 1px solid #c7cbce;
  border-radius: 5px;
  overflow: hidden;
}
/* 활성 필터가 있을 때만 하단 패딩 (JS가 토글) */
.pp-filterbox.has-pills { padding-bottom: 20px; }
.pp-filterbox-head {
  background-color: white;
  border-bottom: 1px solid #c7cbce;
  padding: 10px 10px 10px 29px;
}
.pp-filterbox-title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.8px;
  line-height: 52px;
}
.pp-pills {
  display: none;
  padding: 20px 29px 0;
  flex-wrap: wrap;
  gap: 13px;
}
.pp-filterbox.has-pills .pp-pills { display: flex; }
.pp-pill {
  background-color: #0d1b3e;
  border-radius: 36px;
  padding: 9px 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  cursor: pointer;
}
.pp-pill-label {
  font-size: 18px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

/* 필터 카테고리 */
.pp-cats {
  border: 1px solid #c7cbce;
  border-radius: 5px;
  padding: 0 29px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pp-cat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pp-cat-head {
  border-bottom: 1px solid #c7cbce;
  padding: 10px 10px 10px 0;
}
.pp-cat-title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.8px;
  line-height: 52px;
}
.pp-cat-list {
  display: flex;
  flex-direction: column;
}
.pp-opt-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  position: relative;
}
.pp-opt {
  display: flex;
  gap: 15px;
  height: 35px;
  align-items: center;
  cursor: pointer;
  flex: 1;
}
.pp-opt-box {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.pp-opt-label {
  font-size: 18px;
  font-weight: 500;
  color: #686868;
  letter-spacing: -0.8px;
  white-space: nowrap;
}
.pp-opt.is-checked .pp-opt-label { color: #0d1b3e; }
.pp-opt[data-tooltip]::before,
.pp-opt[data-tooltip]::after {
  position: absolute;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.pp-opt[data-tooltip]::before {
  content: "";
  left: 46px;
  bottom: calc(100% + 2px);
  border: 6px solid transparent;
  border-top-color: #0d1b3e;
}
.pp-opt[data-tooltip]::after {
  content: attr(data-tooltip);
  left: 29px;
  bottom: calc(100% + 14px);
  width: 210px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 6px;
  background: #0d1b3e;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(13, 27, 62, 0.2);
}
.pp-opt[data-tooltip]:hover::before,
.pp-opt[data-tooltip]:hover::after,
.pp-opt[data-tooltip]:focus-visible::before,
.pp-opt[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* ── Grid area ── */
.pp-main {
  flex: 1;
  min-width: 0;
}
.pp-main-head {
  padding-top: 10px;
  padding-bottom: 45px;
}
.pp-main-title {
  line-height: 52px;
  margin: 0;
}
.pp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 17px;
}

/* 빈 상태 */
.pp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
  gap: 16px;
  text-align: center;
}
.pp-empty-title {
  font-size: 20px;
  font-weight: 700;
  color: #0d1b3e;
  margin: 0;
}
.pp-empty-sub {
  font-size: 16px;
  color: #686868;
  margin: 0;
}
.pp-empty-reset {
  font-size: 16px;
  font-weight: 700;
  color: #ff7900;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Card ── */
/* 높이는 고정하지 않는다 — meta 행 개수가 카드마다 다르므로(빈 값은 행 자체를 생략)
   grid의 기본 stretch 정렬이 같은 행(row) 안에서는 높이를 맞춰준다. */
.pp-card {
  border: 1px solid #e3e3e3;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 15px rgba(86, 94, 116, 0.05);
  display: flex;
  flex-direction: column;
  /* 카드 루트가 <a>(상세 페이지 링크)라서 기본 링크 스타일을 지운다 */
  text-decoration: none;
  color: inherit;
}
.pp-card-img {
  height: 198px;
  flex-shrink: 0;
  background: #e8efff;
  position: relative;
  overflow: hidden;
}
.pp-card-bg {
  position: absolute;
  right: -60px;
  top: -30px;
  width: 516px;
  height: 291px;
  opacity: 0.3;
  mix-blend-mode: color-burn;
  object-fit: cover;
  pointer-events: none;
}
.pp-card-main {
  position: absolute;
  left: 80px;
  top: 26px;
  width: 165px;
  height: 141px;
  filter: drop-shadow(4.5px 12px 22.5px rgba(55, 69, 221, 0.5));
  pointer-events: none;
}
.pp-card-deco1 {
  position: absolute;
  left: 229px;
  top: 1px;
  width: 50px;
  height: 49px;
  pointer-events: none;
}
.pp-card-deco2 {
  position: absolute;
  left: 40px;
  top: -8px;
  width: 92px;
  height: 76px;
  pointer-events: none;
}
/* 뱃지(인기/신규): 카드 이미지 좌상단 태그. .pp-card-img가 overflow:hidden이라 모서리 안쪽에 둔다 */
.pp-card-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}
.pp-card-badge--hot { background-color: #ff7900; }
.pp-card-badge--new { background-color: #0d1b3e; }
.pp-card-badge--default { background-color: #686868; }
.pp-card-content {
  padding: 12px 20px;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  overflow: hidden;
}
.pp-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #2a2a2a;
  line-height: 30px;
  margin: 0;
  max-height: 60px;
  overflow: hidden;
  word-break: keep-all;
}
.pp-card-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #2a2a2a;
  opacity: 0.6;
  margin: 4px 0 0;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-card-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pp-card-meta-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 27px;
  min-width: 0;
}
.pp-card-meta-icon { flex-shrink: 0; }
/* 난이도/교육형태처럼 전용 아이콘이 없는 행은 점(dot)으로 정렬을 맞춘다 */
.pp-card-meta-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff7900;
  margin: 0 4.5px;
}
.pp-card-meta-text {
  font-size: 14px;
  font-weight: 500;
  color: #2a2a2a;
  min-width: 0;
}
/* 난이도처럼 길이가 프로그램마다 다른 행은 1줄로 말줄임해 카드 높이 편차를 줄인다 */
.pp-card-meta-row.pp-truncate { overflow: hidden; }
.pp-card-meta-row.pp-truncate .pp-card-meta-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 하단 해시태그 푸터: 주제(topics). 값이 없으면 JS가 아예 생성하지 않는다 */
.pp-card-tags {
  background-color: #f6f7f7;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.pp-card-tags-text {
  font-size: 18px;
  font-weight: 700;
  color: #ff7900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── CTA ──────────────────────────────────────────────────────── */
.pp-cta {
  background: linear-gradient(180deg, #d33500 0%, #962500 100%);
  padding: 100px 24px;
}
.pp-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 27px;
}
.pp-cta-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}
.pp-cta-title {
  font-size: 48px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.8px;
  margin: 0;
  text-align: center;
}
.pp-cta-sub {
  font-size: 17.6px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  text-align: center;
}
.pp-cta-btn {
  background-color: white;
  color: #ff7900;
  font-size: 17.6px;
  font-weight: 700;
  padding: 22px 52px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 12px 16px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: inline-block;
}

/* ── 모바일 반응형 (renewal.css의 r-* 유틸과 동일 브레이크포인트) ── */
@media (max-width: 768px) {
  .pp-hero-inner { padding: 120px 24px 60px; }
  .pp-body-inner { flex-direction: column; gap: 40px; padding: 60px 24px 80px; }
  .pp-sidebar { width: 100%; }
  .pp-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-height: 900px) {
  .pp-hero { min-height: 520px; }
  .pp-hero-inner { min-height: 520px; }
  .pp-hero-illust { top: 36px; transform: scale(0.9); transform-origin: center right; }
}
