/**
 * 延伸閱讀組件樣式（含輪播）
 * @package mytheme
 */

/* 延伸閱讀區塊 */
.section-extended-reading {
  padding: 80px 0 105px;
  position: relative;
}

.extended-reading-header {
  position: relative;
  text-align: center;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    from 90deg at 50% 50%,
    #ffac27 0deg,
    rgba(255, 242, 103, 0.72) 360deg
  );
  border: 2px solid #000;
  max-width: 250px;
  width: 100%;
  height: 70px;
}

.extended-reading-header-container {
  display: flex;
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 80px;
  gap: 20px;
}

.extended-reading-header-container::before {
  content: "";
  position: relative;
  height: 1px;
  width: 100%;
  border-bottom: 1.8px dashed #000;
}

.extended-reading-header-container::after {
  content: "";
  position: relative;
  height: 1px;
  width: 100%;
  border-bottom: 1.8px dashed #000;
}

.extended-header-image {
  position: absolute;
  top: -30px;
}

.extended-reading-title {
  font-size: 1.5rem;
  font-weight: 500;
  white-space: nowrap;
  margin: 0;
  position: relative;
  z-index: 1;
  align-content: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: row;
}

.linear-gradient-title {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ff942b 0%, #ffdc37 100%);
  border-radius: 50%;
  width: 83px;
  height: 83px;
}

/* 輪播 wrapper */
.extended-reading-slider-wrapper {
  width: 100%;
  max-width: 1182px;
  margin-left: -6px;
  margin-right: -6px;
  padding-left: 13px;
  padding-right: 13px;
  padding-top: 13px;
  overflow: hidden;
}

/* 輪播容器 */
.extended-reading-slider {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  margin: 30px 0 40px;
  max-width: 1440px;
  width: 100%;
}

/* 卡片 */
.extended-reading-card {
  flex-shrink: 0;
  width: calc((100% - 4rem) / 3);
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.3s ease;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.15);
}

.extended-reading-image-link {
  display: block;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.extended-reading-image-link:hover {
  filter: brightness(1.2);
}

.extended-reading-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.extended-reading-empty {
  width: 100%;
  text-align: center;
  color: #000;
  font-size: 1.5rem;
  padding: 0;
}

.extended-reading-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.extended-reading-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.extended-reading-post-title {
  font-weight: 600;
  color: #000;
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

.extended-reading-date {
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
}

.extended-reading-excerpt {
  font-weight: 400;
  color: #000;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.extended-reading-link {
  display: flex;
  color: #000;
  text-decoration: none;
  font-size: 1.25rem;
  transition: color 0.3s ease;
  margin-top: auto;
  padding: 15px 45px;
  height: 45px;
  text-align: center;
  align-items: center;
  border-radius: 3rem;
  background: radial-gradient(circle, #fff267 27%, #ffac27 100%);
}

.extended-reading-link:hover {
  color: #fff;
  text-decoration: none;
}

/* 更多文章按鈕 */
.extended-reading-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.btn-primary {
  font-weight: 600;
  color: var(--color-white);
  width: 178px;
  height: 48px;
  border-radius: 10px;
  font-size: 20px;
  letter-spacing: 2.4px;
  padding: 0;
  align-content: center;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background-color: #fff267;
}

/* ========================================
   響應式 - 1440px
   ======================================== */
@media (max-width: 1440px) {
  .extended-reading-card {
    width: calc((100% - 2rem) / 2);
  }
}

/* ========================================
   響應式 - 1024px
   ======================================== */
@media (max-width: 1024px) {
  .extended-reading-slider {
    width: 100%;
    margin: 1rem 0 0;
  }

  .extended-reading-card {
    width: calc((100% - 2rem) / 2);
  }
}

/* ========================================
   響應式 - 480px
   ======================================== */
@media (max-width: 480px) {
  .section-extended-reading {
    padding: 0 0 82px;
  }

  .extended-reading-header {
    margin-bottom: 0;
    gap: 0;
    height: 45px;
    padding: 0 15px;
  }

  .extended-reading-header::after,
  .extended-reading-header::before {
    height: 1px;
    background-image: repeating-linear-gradient(
      to right,
      #000 0,
      #000 5px,
      transparent 0px,
      transparent 7px
    );
  }

  .extended-reading-header-container {
    max-width: 300px;
    margin-bottom: 8.55px;
    gap: 12px;
  }

  .extended-reading-title {
    font-size: 12px;
    padding: 0;
    height: auto;
    width: auto;
    gap: 5px;
  }

  .linear-gradient-title {
    width: 22.904px;
    height: 22.904px;
    font-size: 13px;
  }

  .extended-header-image {
    height: auto;
    width: 115px;
    top: -13px;
  }

  .extended-reading-slider-wrapper {
    padding: 6px;
    margin: -6px;
    overflow: hidden;
  }

  .extended-reading-slider {
    width: 100%;
    margin: 0;
  }

  .extended-reading-card {
    width: 100%;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);
  }

  .extended-reading-image {
    height: auto;
  }

  .extended-reading-post-title {
    font-size: 12px;
  }

  .extended-reading-date {
    font-size: 6px;
  }

  .extended-reading-excerpt {
    font-size: 8px;
  }

  .extended-reading-link {
    font-size: 15px;
    padding: 5px 18px;
    height: auto;
    align-self: center;
  }

  .extended-reading-more {
    margin-top: 1rem;
  }

  .btn-primary {
    width: 96px;
    height: 36px;
    font-weight: 400;
    font-size: 12px !important;
    letter-spacing: normal;
    padding: 0 !important;
    border: none;
    border-radius: 2px;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
  }

  .extended-reading-more-icon {
    width: 12px;
    height: auto;
  }
}
