@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* =========================================
   기본 레이아웃 및 폰트 세팅
========================================= */
html {
  overflow-y: scroll !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #FFFFFF;
  color: #000000;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   상단 고정 헤더 영역
========================================= */
.fixed-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #EAEAEA;
}

.fixed-header-inner {
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 40px 4% 0 4%;
}

.container {
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 50px 4% 120px 4%;
}

.info-top-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 15px;
}

.info-prefix {
  font-size: 16px;
  font-weight: 900;
  color: #111111;
  letter-spacing: 2px;
  padding-right: 20px;
  border-right: 1px solid #DDDDDD;
  cursor: pointer;
}

.info-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #111111;
  cursor: pointer;
}

/* =========================================
   상단 가로 메뉴 바 스크롤 시스템
========================================= */
.menu-scroll-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}

.top-menu-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  width: 100%;
  padding: 10px 0 4px 0;
  gap: 36px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.top-menu-bar.grabbing {
  cursor: grabbing;
  user-select: none;
}

.top-menu-bar::-webkit-scrollbar {
  display: none;
}

.menu-button {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 20px;
  font-weight: 500;
  color: #CCCCCC;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.menu-button:hover {
  color: #666666;
}

.menu-button.current {
  color: #000000;
  font-weight: 700;
  border-bottom: 3px solid #000000;
}

.menu-progress-container {
  width: 100%;
  height: 2px;
  background-color: #EEEEEE;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.menu-progress-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: #000000;
  border-radius: 2px;
}

.content {
  width: 100%;
  background-color: #FFFFFF;
}

/* =========================================
   소개 배너 영역 (program_list 스타일 100% 동일 적용)
========================================= */
.program-intro {
  display: flex;
  gap: 40px;
  padding: 30px;
  background-color: #FAF9F8;
  border-radius: 12px;
  margin-bottom: 60px;
  height: 360px !important;
  min-height: 240px !important;
  overflow: hidden;
}

.pi-img-wrapper {
  flex: 0 0 290px;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.pi-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pi-ex-box {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pi-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  height: 24px;
  line-height: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background-color: #111111;
  color: #FFFFFF;
  padding: 0 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.pi-ex-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
}

.pi-ex-scroll::-webkit-scrollbar {
  width: 4px;
}

.pi-ex-scroll::-webkit-scrollbar-thumb {
  background-color: #DDDDDD;
  border-radius: 2px;
}

.pi-ex-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pi-ex {
  font-size: 15px;
  line-height: 1.7;
  color: #555555;
  word-break: keep-all;
  margin: 0;
}

.pi-ex p, .pi-ex h1, .pi-ex h2, .pi-ex h3, .pi-ex ul, .pi-ex li {
  margin-top: 0;
}

.section-divider {
  border: 0;
  border-top: 1px solid #EAEAEA;
  margin: 40px 0;
}

.empty-msg {
  text-align: center;
  padding: 60px 0;
  color: #A0AEC0;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-msg i {
  font-size: 32px;
}

/* =========================================
   포스트 리스트 영역 (program_list의 테두리 없는 그리드 적용)
========================================= */
.post-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
  width: 100%;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #000000;
}

.post-card:hover .card-image-wrapper img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.card-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 16px;
  background-color: #F8F8F8;
  position: relative;
  border-radius: 6px;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%);
  transition: filter 0.6s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 게시글 제목 스타일 (program_title 높이 고정 및 말줄임 완벽 복사) */
.post-title {
  font-size: 16px;
  font-weight: 600;
  color: #111111;
  letter-spacing: -0.5px;
  line-height: 24px;
  height: 48px !important;
  margin: 0;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* =========================================
   페이지네이션 스타일
========================================= */
.pagination-wrapper {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

.pagination {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  background: #FFFFFF;
  color: #4A5568;
  text-decoration: none;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.pagination li a:hover {
  background: #EDF2F7;
  color: #1A202C;
  border-color: #CBD5E0;
}

.pagination li.active a {
  background: #1A202C;
  color: #FFFFFF;
  border-color: #1A202C;
  font-weight: 700;
}

.pagination li.disabled a {
  color: #CBD5E0;
  background: #F7FAFC;
  border-color: #E2E8F0;
  pointer-events: none;
}

/* =========================================
   반응형 모바일 미디어 쿼리 (program_list 기준 일치)
========================================= */
@media screen and (max-width: 1024px) {
  .post-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px 20px;
  }
}

@media screen and (max-width: 768px) {
  .fixed-header-inner {
    padding-top: 20px;
  }

  .info-top-bar {
    gap: 12px;
  }

  .info-title {
    font-size: 20px;
  }

  .top-menu-bar {
    gap: 20px;
  }

  /* ── 📦 모바일 배너: 높이 고정을 풀고, 아래로 늘어나도록 변경 ── */
  .program-intro {
    flex-direction: column;
    padding: 20px;
    height: auto !important;         /* 고정 높이 완전히 해제 */
    min-height: unset !important;    /* 고정 높이 완전히 해제 */
    max-height: unset !important;    /* 고정 높이 완전히 해제 */
    gap: 20px;
    margin-bottom: 40px;
  }

  /* ── 🖼️ 이미지: 원본 비율 유지 설정 ── */
  .pi-img-wrapper {
    flex: 0 0 auto;                  /* 높이 고정 해제 */
    width: 100%;
    height: auto;
  }

  .pi-img {
    width: 100%;
    height: auto;                    /* 가로 너비에 맞춰 원본 비율대로 세로가 자동 조절됨 */
    object-fit: contain;             /* 이미지 찌그러짐 방지 및 원본 비율 보존 */
    display: block;
  }

  /* ── 📝 소개 글 영역: 스크롤 없이 정상 출력 ── */
  .pi-ex-box {
    flex: unset;
    width: 100%;
    height: auto !important;         /* 고정 계산식 해제 */
    display: block;
  }

  .pi-badge {
    margin-bottom: 10px;
  }

  /* 감싸고 있던 내부 세로 스크롤 틀 해제 */
  .pi-ex-scroll {
    overflow-y: visible !important;   /* 스크롤바를 없애고 전체 노출 */
    height: auto;
    padding-right: 0;
  }

  .pi-ex {
    font-size: 14.5px;
    line-height: 1.65;
    color: #555555;
    padding-bottom: 0;
  }

  /* ── 리스트 영역 ── */
  .container {
    padding-top: 30px;
  }

  .post-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 16px;
  }

  .post-title {
    font-size: 14.5px;
    height: 44px !important;
    line-height: 22px;
  }
}