@charset "utf-8";

/* ******************** 과정 상세 (degree + non-degree detail) ******************** */
/* degree: hero, .thumb.default-text, CTA만 사용 / non-degree: + .detail-block, 수강신청 팝업 */

.edu-submain.degree-detail-page {
  .edu-header {
    background: transparent;
  }

  .detail-hero {
    position: relative;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: #fff;
    padding: 0 0 36px;
    .hero-inner {
      display: flex; align-items: center; justify-content: space-between; gap: 32px;
    }
    .hero-text {
      flex: 1; min-width: 0;
    }
    .breadcrumb {
      font-size: 1.3rem; color: rgba(255, 255, 255, 0.5); margin-bottom: 25px;
      a {
        color: rgba(255, 255, 255, 0.6);
        &:hover {
          text-decoration: underline; color: rgba(255, 255, 255, 0.9);
        }
      }
      .sep {
        margin: 0 6px; opacity: 0.6;
      }
    }
    .tit {
      font-size: 2.5rem; font-weight: 700; color: #fff; margin: 0 0 15px 0; line-height: 1.3;
      display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    }
    .badge {
      display: inline-block; font-size: 1.3rem; font-weight: 600; padding: 4px 10px;
      background: rgba(59, 130, 246, 0.9); color: #fff; border-radius: 6px;
    }
    .meta {
      font-size: 1.4rem; color: rgba(255, 255, 255, 0.85); margin: 0 0 25px 0;
    }
    .desc {
      font-size: 1.5rem; line-height: 1.7; color: rgba(255, 255, 255, 0.9); padding: 10px 20px; background: rgba(255, 255, 255, 0.08); border-radius: 10px;
      .desc-item {
        display: inline-block;
        &:after {
          content: "·"; padding: 0 5px;
        }
        &:last-child:after {
          display: none;
        }
      }
    }
    /* 썸네일: 목록과 동일 규칙 – 배지는 항상 표시, default 이미지일 때만 중앙 텍스트 오버레이 */
    .thumb {
      position: relative; width: 280px; padding-bottom: 18%; overflow: hidden; border-radius: 10px;
      img {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
      }
      .badge-wrap {
        position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap;
        .badge {
          background: rgba(255, 255, 255, 0.9); color: #1f2937; padding: 6px 12px; border-radius: 6px;
          font-size: 1.3rem; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
      }
      &.default-text {
        /* 배지가 .badge-wrap 없이 직접 올 때(학위 상세 등) */
        > .badge {
          position: absolute; top: 12px; right: 12px; z-index: 3;
          background: rgba(255, 255, 255, 0.9); color: #1f2937; padding: 6px 12px; border-radius: 6px;
          font-size: 1.3rem; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        &::after {
          content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none;
          background: rgba(0, 0, 0, 0.4); z-index: 1;
        }
        .thumb-text {
          position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
          width: calc(100% - 28px); font-size: 1.8rem; font-weight: 600; color: #fff; line-height: 1.4; text-align: center;
          display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
        }
      }
    }
  }

  .detail-body {
    display: flex; gap: 32px; align-items: flex-start; padding: 40px 0 60px;
  }

  .board-wrap {
    flex: 1; min-width: 0;
    .d-content {
      padding: 0 10px 20px 10px;
      border-bottom: 1px solid var(--line-color);
    }
  }

  .d-content-footer {
    margin-top: 13px; text-align: right;
    .btn-list {
      display: inline-block; padding: 8px 16px; font-size: 1.4rem; font-weight: 600; color: #374151;
      background: #fff; border: 1px solid #d1d5db; border-radius: 4px; text-decoration: none;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
      &:hover {
        background: #f3f4f6; border-color: #9ca3af; color: #1f2937;
      }
    }
  }

  .detail-block {
    margin-bottom: 35px; 
    &:last-child { margin-bottom: 0; }
    &.type-border {
      background: #fff; border: 1px solid #d4d9e0; border-radius: 10px; overflow: hidden;
    }
    .block-tit {
      font-size: 1.6rem; font-weight: 700; color: #333;
      padding: 14px 20px; background: #e7edf1; border-bottom: 1px solid #d4d9e0;
    }
    .block-body {
      padding: 20px; font-size: 1.4rem; line-height: 1.7; color: #374151;
      p {
        margin: 0 0 12px 0;
      }
      p:last-child {
        margin-bottom: 0;
      }
      ul {
        padding: 0; margin: 0;
      }
      ul.block-list {
        list-style: none;
        li {
          position: relative; padding: 8px 0 8px 1em; border-bottom: 1px solid #f3f4f6;
          font-size: 1.4rem;
          &:last-child { border-bottom: none; }
          &::before {
            content: ""; position: absolute; left: 0; top: 1em;
            width: 4px; height: 4px; border-radius: 50%; background: #94a3b8;
          }
        }
      }
    }
    .block-list-grid {
      display: grid; grid-template-columns: 140px 1fr; gap: 0; margin: 0; padding: 0; list-style: none;
      dt {
        font-weight: 600; color: #374151; font-size: 1.4rem; padding: 10px 0; border-bottom: 1px solid #d4d9e0;
      }
      dd {
        margin: 0; padding: 10px 0 10px 16px; border-bottom: 1px solid #d4d9e0; font-size: 1.4rem; color: #1f2937;
      }
      dt:first-of-type, dd:first-of-type { padding-top: 0; }
      dt:last-of-type, dd:last-of-type {
        border-bottom: none; padding-bottom: 0;
      }
    }
    .block-list-rows {
      display: grid; grid-template-columns: 88px 1fr; gap: 0; margin: 0; padding: 0; list-style: none;
      dt {
        font-weight: 600; color: #374151; font-size: 1.3rem; padding: 14px 10px 14px 0; border-bottom: 1px solid #e5e7eb;
      }
      dd {
        margin: 0; padding: 14px 0; border-bottom: 1px solid #e5e7eb; font-size: 1.4rem; color: #1f2937; line-height: 1.5;
      }
      dt:first-of-type, dd:first-of-type { padding-top: 0; }
      dt:last-of-type, dd:last-of-type {
        border-bottom: none; padding-bottom: 0;
      }
    }
    .block-sub-tit {
      font-size: 1.4rem; font-weight: 600; color: #1f2937; margin: 20px 0 10px 0; padding-bottom: 6px; border-bottom: 1px solid #e5e7eb;
      &:first-child { margin-top: 0; }
    }
    &.detail-inquiry .block-body {
      p:first-child {
        font-weight: 600; color: #374151; margin: 0 0 6px 0; font-size: 1.4rem;
      }
      p:last-child {
        margin: 0; font-size: 1.4rem; color: #2563eb; font-weight: 500;
      }
    }
  }

  .detail-aside {
    flex-shrink: 0; width: 280px; position: sticky; top: 24px;
  }

  .detail-cta {
    background: #fff; border: 1px solid #bdc4cf; border-radius: 10px; padding: 25px; box-shadow: 3px 5px 9px rgba(0, 0, 0, 0.1);
    .cta-btn-wrap {
      display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
    }
    .cta-btn {
      display: block; width: 100%; text-align: center; font-size: 1.4rem; font-weight: 600;
      padding: 14px 20px; border-radius: 8px; text-decoration: none; transition: background 0.2s, color 0.2s;
      &.primary {
        background: #2563eb; color: #fff; border: none;
        &:hover {
          background: #1d4ed8;
        }
      }
      &.secondary {
        background: #fff; color: #374151; border: 1px solid #bdc4cf;
        &:hover {
          background: #f3f4f6;
        }
      }
      // 모집예정·모집마감 시 수강신청 비활성화용 회색 버튼
      &.disabled {
        background: #e5e7eb; color: #9ca3af; border: none;
        cursor: not-allowed; pointer-events: none;
        &:hover { background: #e5e7eb; }
      }
    }
    .cta-txt {
      font-size: 1.35rem; color: #6b7280; margin: 0 0 10px 0; line-height: 1.5;
    }
    .cta-countdown {
      font-size: 1.15rem; color: #94a3b8; margin: 0; font-weight: 500;
    }
  }
}

/* ----- 상세 페이지 미디어쿼리 ----- */

/* 1024px 이하: aside를 화면 하단 고정 CTA로 전환, 본문 하단에 CTA 높이만큼 여유 */
@media (max-width: 1024px) {
  .edu-submain.degree-detail-page {
    .detail-body {
      flex-direction: column;
    }
    .board-wrap {
      padding-bottom: 120px; border-top: none;
    }
    .detail {
      padding: 0 15px;
    }
    .detail-cta {
      border-radius: 0; position: fixed; bottom: 0; display: flex; flex-direction: column; padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); width: 100%;
      .cta-btn-wrap {
        display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; order: 1;
      }
      .cta-txt {
        order: 2; text-align: center; margin: 0 0 6px 0; font-size: 1.2rem; line-height: 1.5;
      }
      .cta-countdown {
        order: 3; text-align: center; font-size: 1.1rem;
      }
      .cta-btn {
        margin-bottom: 0; min-width: 0;
      }
    }
  }
}

@media (max-width: 768px) {
  .edu-submain.degree-detail-page {
    .header-inner {
      &.sec-width {
        padding: 0;
      }
    }
    .detail-hero {
      padding: 0;
      .tit {
        font-size: 1.9rem;
      }
      .meta {
        font-size: 1.3rem;
      }
      .desc {
        font-size: 1.4rem;
      }
      .thumb {
        max-width: 100%; padding-bottom: 50%;
      }
    }
    .detail-body {
      padding: 28px 0 48px; gap: 24px;
    }
    .detail-cta {
      .cta-txt {
        font-size: 1.3rem;
      }
    }
    .detail-block {
      margin-bottom: 30px;
      .block-tit {
        font-size: 1.4rem; padding: 12px 16px;
      }
      .block-body {
        font-size: 1.3rem; padding: 16px;
      }
      .block-list-grid {
        grid-template-columns: 120px 1fr;
        dt, dd { padding: 8px 0; padding-left: 0; }
        dd { padding-left: 12px; }
      }
    }
  }
}

@media (max-width: 650px) {
  .edu-submain.degree-detail-page { 
    .detail-hero .hero-inner {
      flex-direction: column-reverse;
      /* 썸네일(thumb)이 hero-text 위로 오도록 */
      .hero-text {
        width: 100%;
      }
    }
    .detail-hero .thumb {
      width: 100%; padding-bottom: 55%;
    }
    .detail-hero {
      .desc {
        margin-bottom: 25px;
        .desc-item {
          font-size: 1.2rem; display: block; padding-left: 7px; position: relative;
          &:after {
            position: absolute; top: 4px; left: -3px; font-size: 16px; padding: 0; line-height: 1;
          }
          &:last-child:after {
            display: block;
          }
        }
      }
    }
  }
}

@media (max-width: 600px) {
  .edu-submain.degree-detail-page {
    .detail-hero {
      .tit {
        font-size: 1.8rem;
      }
      .desc {
        font-size: 1.3rem; padding: 10px 15px; border-radius: 6px;
      }
      .thumb {
        padding-bottom: 50%;
        .badge-wrap {
          .badge {
            font-size: 1.2rem; padding: 3px 8px;
          }
        }
      }
    }
    .detail-cta {
      .cta-btn {
        font-size: 1.3rem; padding: 12px 16px;
        &.primary {
          margin-bottom: 0;
        }
      }
    } 
  }
}

@media (max-width: 475px) {
  .edu-submain.degree-detail-page {
    .detail-hero {
      .tit {
        font-size: 1.7rem;
      }
      .thumb {
        padding-bottom: 50%;
      }
    }
    .detail-block {
      .block-tit {
        font-size: 1.3rem; padding: 10px 14px;
      }
      .block-body {
        font-size: 1.3rem; padding: 14px;
      }
      .block-list-grid {
        grid-template-columns: 70px 1fr;
        dt { padding: 6px 0; font-size: 1.2rem; }
        dd { padding: 6px 0; font-size: 1.2rem; padding-left: 10px; }
      }
      .block-list-rows {
        grid-template-columns: 72px 1fr;
        dt { font-size: 1.25rem; }
      }
    }
  }
}

/* ----- 수강 신청 팝업 (페이지 테마 적용) ----- */
.popup-wrap.course-apply-pop {
  z-index: 500;
  .popup.course-apply-pop-inner {
    width: 440px; max-width: calc(100vw - 40px); height: auto; min-height: 320px; max-height: 90vh;
    display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
    box-shadow: 0 10px 40px rgba(31, 41, 55, 0.15);
  }
  .modal-title-area {
    flex: 0 0 auto;
    padding: 20px 50px 20px 24px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
    .modal-tit {
      margin: 0; font-size: 1.5rem; font-weight: 700; color: #1f2937;
    }
    .close-btn {
      position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
      padding: 8px; border: none; background: none; cursor: pointer; border-radius: 4px;
      &:hover {
        background: #e2e8f0;
      }
      img {
        display: block; width: 20px; height: 20px; opacity: 0.6;
      }
    }
  }
  .modal-text-area {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 24px;
    .apply-pop-desc {
      margin: 0 0 20px 0; font-size: 1.4rem; color: #64748b; line-height: 1.5;
    }
    .apply-form {
      .form-row {
        margin-bottom: 16px;
        &:last-of-type {
          margin-bottom: 0;
        }
        label {
          display: block; font-size: 1.3rem; font-weight: 600; color: #374151; margin-bottom: 8px;
        }
        .text-input {
          width: 100%; height: 44px; padding: 0 14px; font-size: 1.4rem;
          border: 1px solid #e2e8f0; border-radius: 8px; color: #1f2937;
          transition: border-color 0.2s, box-shadow 0.2s;
          &:focus {
            outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
          }
          &[readonly] {
            background: #f1f5f9; color: #475569; cursor: default;
          }
        }
        select.text-input {
          cursor: pointer; appearance: none;
          padding-right: 36px;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
          background-repeat: no-repeat;
          background-position: right 12px center;
          background-size: 12px 12px;
          &:disabled {
            background-color: #f1f5f9; color: #475569; cursor: default;
          }
        }
      }
    }
  }
  .modal-foot-area {
    flex: 0 0 auto;
    padding: 20px 24px; border-top: 1px solid #e2e8f0; background: #fff;
    .btn-wrap {
      display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
    }
    button.apply-pop-submit,
    button.apply-pop-edit {
      display: inline-flex; align-items: center; justify-content: center;
      box-sizing: border-box; height: 44px; padding: 0 24px; margin: 0;
      font-size: 1.4rem; font-weight: 600; line-height: 1; border-radius: 8px; cursor: pointer;
      float: none; width: auto; min-width: 0;
    }
    button.apply-pop-submit {
      background: #2563eb; color: #fff; border: none;
      &:hover {
        background: #1d4ed8;
      }
    }
    button.apply-pop-edit {
      background: #fff; color: #374151; border: 1px solid #d1d5db;
      &:hover {
        background: #f3f4f6;
      }
    }
  }
}
