* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body,
html {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 전체 컨테이너 */
.container {
  display: flex;
  position: fixed;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 1px;
  max-height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* 좌: 사이드바 (기본 1) */
.sidebar {
  width: 580px;
  background-color: #fff;
  color: #24364a;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: 500ms ease;
  align-items: stretch;
  padding: 30px 30px 0 30px;
  z-index: 3;
}

/* 접힘 상태: 사이드바 너비 고정 (예: 60px) */
.sidebar.collapsed {
  width: 0px;
  padding: 0px;
}

/* 사이드바 내부 스타일 */
.sidebar .head {
  font-size: 24px;
  font-weight: bold;
  color: #004D97;
  transition: opacity 150ms ease;
}

.sidebar .category {
  font-size: 18px;
  font-weight: bold;
  padding: 8px 0px;
  transition: opacity 150ms ease;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar .card-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding : 0 0 20px 0px;
  transition: opacity 150ms ease;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar .card-container::-webkit-scrollbar,
.sidebar .category::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.sidebar.collapsed .head,
.sidebar.collapsed .category,
.sidebar.collapsed .card-container {
  opacity: 0;
}

.category form {
  display: inline-flex;
  gap: 10px;
}

.category label {
  border: 1px solid #004D97;
  border-radius: 25px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 16px;
  color: #004D97;
}

.category input[type='radio'] {
  display: none;
}

.category input[type='radio']:checked + label,
.category label:has(input[type='radio']:checked) {
  background-color: #004D97;
  color: #fff;
}

.card {
  border-radius: 12px;
  border: 1px solid #004D97;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: all 0.4s ease;
  position: relative;
}

.card.active {
  background-color: #004D97;
  color: #fff;
}

.card-main {
  display: flex;
  gap: 16px;
}

.card-image {
  width: 240px;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
}

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

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-actions button {
  margin-top: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #004D97;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease-in;
}

.card.active .card-actions button {
  background-color: #fff;
  color: #004D97;
}

.card-hover-programs {
  display: flex;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  overflow: hidden;
  background-color: #fff;
  border-radius: 16px;
  color: #24364a;
}

.card:hover .card-hover-programs {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
  padding: 16px;
  margin-top: 16px;
}

.program-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.program-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.program-description {
  font-size: 16px;
  flex: 1;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.program-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.program-actions button {
  margin-top: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #004D97;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.program-image {
  width: 220px;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
}

.program-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* div 비율에 맞게 잘라서 채우기 */
  display: block;
}

/* 모바일 토글 버튼 숨기기 */
.toggle-btn-mobile {
  display: none;
}

.toggle-btn {
  display: inline-block;
  position: absolute;
  width: 48px;
  height: 128px;
  top: 90px;
  right: -48px;
  border: none;
  background: #004D97;
  cursor: pointer;
  font-size: 14px;
}

.arrow-toggle {
  width: 30px;
  height: 30px;
  margin: auto;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.toggle-btn .bar {
  width: 15px;
  height: 2px;
  background-color: #fff;
  position: absolute;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 기본 상태: '>' 모양 */
.toggle-btn .bar:first-child {
  transform: rotate(-45deg) translateY(-4.5px) translateX(3px);
}

.toggle-btn .bar:last-child {
  transform: rotate(45deg) translateY(4.5px) translateX(3px);
}

/* 토글된 상태: '<' 모양 */
.toggle-btn .arrow-toggle.active .bar:first-child {
  transform: rotate(45deg) translateY(-4.5px) translateX(-3px);
}

.toggle-btn .arrow-toggle.active .bar:last-child {
  transform: rotate(-45deg) translateY(4.5px) translateX(-3px);
}

.card-desktop-description {
  font-size: 16px;
  flex: 1;
}

.card-mobile-description {
  display: none;
}

/* 우: 컨텐츠 (기본 2) */
.content {
  flex: 1;
  /* 남은 공간을 차지 (2비율) */
  background: #000000;
  overflow: auto;
}

/* iframe */
.viewer {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media screen and (max-width: 750px) {
  /* 좌: 사이드바 (기본 1) */
  .sidebar {
    width: 100%;
    height: 100%;
    padding: 20px 20px 0 20px;
  }

  .category label {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* 기존 데스크톱 뷰 토글 버튼 숨기기 */
  .toggle-btn {
    display: none;
  }

  /* 모바일 토글 버튼 */
  .toggle-btn-mobile {
    background-color: #fff;
    border-radius: 25px;
    display: inline-block;
    position: absolute;
    width: 48px;
    height: 48px;
    top: 12px;
    right:0;
    border: none;
    cursor: pointer;
    font-size: 14px;
    z-index: 4;
  }

  .arrow-toggle {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .toggle-btn-mobile .bar {
    width: 25px;
    height: 2px;
    background-color: #004D97;
  }

  .toggle-btn-mobile .bar:first-child {
    transform: rotate(-45deg) translateY(1.3px);
  }

  .toggle-btn-mobile .bar:last-child {
    transform: rotate(45deg) translateY(-1.3px);
  }

  .toggle-btn-mobile.active {
    right: -65px;
  }

  .toggle-btn-mobile.active .bar:first-child {
    transform: rotate(-90deg);
  }

  .toggle-btn-mobile.active .bar:last-child {
    transform: translateY(-1px);
  }

  .card-image {
    width: 150px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
  }

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

  .card-title {
    font-size: 18px;
  }

  .card-desktop-description {
    display: none;
  }

  .card-actions {
    display: flex;
    gap: 4px;
  }

  /* 공통 버튼 스타일 */
  .card-actions a,
  .card-actions .vr-btn {
    width: 100%;
    margin: 0;
    flex: 1 1 100%;
  }

  .card-actions .vr-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* 자식이 2개 이상일 때 반반 (최신 브라우저용) */
  .card-actions:has(> :nth-child(2)) > a,
  .card-actions:has(> :nth-child(2)) > .vr-btn {
    flex: 1 1 50%;
  }

  .card-mobile-description {
    display: block;
    font-size: 14px;
    margin-top: 16px;
  }

  .program-title {
    font-size: 14px;
  }

  .program-image {
    width: 140px;
    height: 140px;
  }

  .program-description {
    font-size: 13px;
  }

  .program-actions a,
  .program-actions button {
    width: 100%;
  }

  .program-actions button {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* @media (max-width: 559px) {
  .container {
    padding-top: 127px;
  }
  .sidebar {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: #fff;
    z-index: 3;
  }

  .toggle-btn {
    display: none;
  }

  .toggle-btn-mobile {
    display: inline-block;
    position: absolute;
    width: 48px;
    height: 48px;
    top: 12px;
    right:12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    z-index: 4;
  }
} */


@media (min-width: 560px) and (max-width: 750px) {
  
  .sidebar {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: #fff;
    z-index: 3;
    max-height: calc(100% - 127px);
  }

  .toggle-btn {
    display: none;
  }

   .toggle-btn-mobile {
    display: inline-block;
    position: absolute;
    width: 48px;
    height: 48px;
    top: 12px;
    right:12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    z-index: 4;
  }
}

@media (min-width: 643px) and (max-width: 750px) {
   .container {
    padding-top: 242px;
  }

}


@media (min-width: 641px) and (max-width: 751px) {
  .container {
    padding-top: 242px;
  }
  .sidebar {
    max-height: calc(100% - 242px);
  }
}

@media (min-width: 751px) {
  .container {
    padding-top: 172px;
  }
}

@media (max-width: 640px) {
  .container {
    padding-top: 127px;
  }
  .sidebar {
    max-height: 100%;
  }
}
