* {
  box-sizing: border-box;
}

/* 無障礙樣式處理 */
*:focus {
  outline: #FFA500 dashed 3px !important;
  outline-offset: 3px !important;
  transition: outline 0.2s ease-in-out;
}

@media (max-width: 768px) {
  .model-2 .table-container {
    padding: 0;
  }
}


@media (max-width: 768px) {
  /* 最新消息 */
  /* .latest-news {
    padding: 0 !important;
  } */

  .gjs-cell {
    max-width: 768px;
    width: 100%;
  }

  .tab-container {
    display: flex;
    border-radius: 41px;
    background-color: #f8f8f8;
    overflow-x: auto;  /* 添加水平滾動 */
    overflow-y: hidden;  /* 防止垂直滾動 */
    white-space: nowrap;  /* 防止內容換行 */
    -webkit-overflow-scrolling: touch;  /* iOS 滾動順暢 */
    scrollbar-width: none;  /* Firefox 隱藏滾動條 */
    -ms-overflow-style: none;  /* IE/Edge 隱藏滾動條 */
    justify-content: flex-start;  /* 改為靠左對齊 */
    flex-wrap: nowrap;  /* 防止換行 */
    gap: 5px;  /* 項目間距 */
    padding: 12px 0 12px 0;
    margin: 0 10px 0 10px;
  }

  .tab-container::-webkit-scrollbar {
    display: none;  /* Chrome/Safari 隱藏滾動條 */
  }

  .tab {
    flex: 0 0 auto;  /* 防止項目被壓縮 */
    margin: 0 10px 0 10px;
  }
}


/* 滾動 row */
@media screen and (max-width: 768px) {
  .scroll-row {
    display: flex !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 0;
    margin: 0 !important;
  }

  .scroll-row::-webkit-scrollbar {
    display: none;
  }

  .scroll-row .gjs-cell {
    display: inline-flex !important;
    float: none !important;
    width: auto !important;
    min-width: auto !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    padding: 0 5px !important;
  }

  .scroll-row .gjs-cell .custom-tab {
    display: inline-block !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

/* 生命故事卡片 */
@media (max-width: 768px) {
  .model-3 .custom-card,
  .model-8 .custom-card {
      flex-direction: column !important;
  }

  .custom-card .d-flex.align-items-center.p-2 {
      width: 100%;
      justify-content: center;
      margin-bottom: 1rem;
  }

  .featured-image {
      width: 120px;
      height: 120px;
      margin: 0 auto;
  }

  .featured-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
  }

  .custom-card .d-flex.flex-column.justify-content-center {
      /* width: 100%; */
      text-align: center;
  }

  .d-flex.align-items-center.color-8a5691 {
      justify-content: center;
  }
}

.enlarge-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  cursor: pointer; /* 滑鼠變成手指形狀 */
}

@media (max-width: 480px) {
  .enlarge-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* 遮罩層樣式 */
.image-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  cursor: pointer;
}

/* 放大後的圖片樣式 */
.image-overlay img {
  max-height: 90vh;
  max-width: 90vw;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

@media (max-width: 768px) {
  .model-1 .dataTables_length, .model-1 .dataTables_paginate {
    display: flex !important;
  }
}