/*
 * Haswell 響應式修補 — 行動裝置與平板適配
 * 載入順序：在 haswell-fixes.css 之後
 */

/* ===== 全域：v-html 富文本溢出保護 ===== */
.post-prev-text img,
.course-description-content img,
.page-content-area img,
.article-content img {
  max-width: 100% !important;
  height: auto !important;
}

.post-prev-text table,
.course-description-content table,
.page-content-area table,
.article-content table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

.post-prev-text iframe,
.course-description-content iframe,
.page-content-area iframe,
.article-content iframe,
.post-prev-text video,
.course-description-content video,
.page-content-area video,
.article-content video {
  max-width: 100%;
  height: auto;
}

/* ===== 平板（≤ 991px） ===== */
@media (max-width: 991px) {
  /* Footer padding 縮減 */
  #footer6.pt-95 {
    padding-top: 50px !important;
  }
  #footer6.pb-50 {
    padding-bottom: 30px !important;
  }
}

/* ===== 手機（≤ 767px） ===== */
@media (max-width: 767px) {
  /* Footer padding 再縮減 */
  #footer6.pt-95 {
    padding-top: 35px !important;
  }
  #footer6.pb-50 {
    padding-bottom: 20px !important;
  }

  /* Footer 各欄間距 */
  #footer6 .widget {
    margin-bottom: 25px;
  }

  /* 卡片 padding 縮減 */
  .member-card,
  .page-form-panel,
  .checkout-summary-card {
    padding: 20px 15px !important;
  }

  /* Flex 容器強制換行 */
  .lesson-item {
    flex-wrap: wrap !important;
  }
  .lesson-item .lesson-actions {
    width: 100%;
    margin-top: 8px;
  }

  .attachment-item {
    flex-wrap: wrap !important;
  }
  .attachment-download {
    width: 100%;
    text-align: center;
    margin-top: 8px;
  }

  /* 課程卡片 */
  .course-card-main {
    flex-direction: column !important;
  }
  .course-card-actions {
    flex-wrap: wrap !important;
  }

  /* Bootstrap offset 重置 */
  .col-md-offset-1,
  .col-md-offset-2,
  .col-md-offset-3 {
    margin-left: 0 !important;
  }

  /* 側邊面板手機版 */
  .floating-panel-wrapper {
    transform: translateX(calc(100vw - 68px)) !important;
  }
  .floating-panel-wrapper.panel-open {
    transform: translateX(0) !important;
  }
  .floating-panel-body {
    width: calc(100vw - 68px) !important;
  }

  /* 考試 Widget padding 縮減 */
  .exam-card {
    padding: 20px 15px !important;
  }
}

/* ===== 極小螢幕（≤ 480px） ===== */
@media (max-width: 480px) {
  /* 側邊面板：標籤列縮小 */
  .floating-tab {
    width: 52px !important;
    padding: 10px 0 !important;
  }
  .floating-tab-icon {
    width: 32px !important;
    height: 32px !important;
  }
  .floating-tab-label {
    font-size: 9px !important;
    letter-spacing: 1px !important;
  }
  .floating-panel-body {
    width: calc(100vw - 52px) !important;
  }
  .floating-panel-wrapper {
    transform: translateX(calc(100vw - 52px)) !important;
  }

  /* Hero 標題響應 */
  .hs-line-1 {
    font-size: 28px !important;
    letter-spacing: 0 !important;
  }
  .hs-line-2 {
    font-size: 14px !important;
    letter-spacing: 1px !important;
  }
}
