@charset "UTF-8";

/* 列表頁主標題 */
.page-title h2 {
  text-align: center;
  padding: 35px;
  font-size: 35px;
  margin: 70px 0 0 0;
}

/* Grid */
.article-grid {
  padding: 0 30px 50px 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}


/* 單張卡片 */
.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transition: transform .3s ease, box-shadow .3s ease;
  max-height: 500px; 
  margin:0 1px 0 1px;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

/* 圖片固定比例（替代 height: 370px） */
.article-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 沒封面時的 placeholder */
.article-image--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
  letter-spacing: 1px;
}

/* 卡片文字區 */
.article-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* 卡片標題 */
.article-body h3 {
  text-align: center;
  font-size: 22px;
  padding: 10px 0 6px 0;
  margin: 0;
  color: #3C3C3C;
  line-height: 1.4;
}

/* 卡片摘要 */
.article-body p {
  flex: 1;
  margin: 0 0 14px 0;
  line-height: 1.6;
  font-size: 18px;
  color: #444;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.article-btn {
  align-self: center;
  margin-top: auto;
  padding: 10px 18px;
  background: #007f7f;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 18px;
  transition: background .25s ease, transform .2s ease;
}

.article-btn:hover {
  background: #006666;
  transform: translateY(-2px);
}

.article-btn:focus-visible {
  outline: 3px solid rgba(0,127,127,0.35);
  outline-offset: 3px;
}

/* 首頁文章下一頁 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #f1f1f1;
  color: #333;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: #ddd;
}

.page-btn.active {
  background: #6b4eff;
  color: #fff;
  cursor: default;
}


/* 大型平板 / 筆電 (≤ 1024px) */
@media (max-width: 64em) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* 小型平板與手機 (≤ 768px) */
@media (max-width: 48em) {
  .article-container {
    width: 95%;     
    margin: 20px auto;
    padding: 15px;
    box-shadow: none; 
  }

  .article-content {
    font-size: 17px;
    line-height: 1.7;
    word-wrap: break-word;     
    overflow-wrap: break-word;
  }

  .article-content img, 
  .article-content iframe, 
  .article-content video,
  .article-content table {
    max-width: 100% !important; 
    height: auto !important;  
    display: block;
    margin: 10px auto;
  }

  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .article-grid {
    grid-template-columns: 1fr;
    padding: 0 10px 40px 10px;
    gap: 20px;
  }
}


/* 超小型手機 (≤ 375px) */
@media (max-width: 23.5em) {
  .page-title h2 {
    font-size: 24px;
  }
}


/* 文章詳情頁主容器 */
.article-detail {
  padding: 160px 300px 20px 300px; 
  background: #f9f9f9;
  min-height: 100vh;
}

.article-container {
  max-width: 860px;
  margin: 0 auto 90px auto; 
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* 平板模式 (≤ 1024px) */
@media (max-width: 64em) {
  .article-container {
    margin: 60px auto;
    padding: 25px;
  }
}

/* 1200px 以下 */
@media (max-width: 75em) { 
  .article-detail {
    padding-left: 100px;
    padding-right: 100px;
  }
}

/* 手機模式 (≤ 768px) */
@media (max-width: 48em) {
  .article-detail {
    padding: 100px 15px 20px 15px !important; 
  }

  .article-container {
    width: 100%;    
    padding: 20px;  
    margin-bottom: 40px;
  }

  .article-cover {
    margin-top: 0;
  }

  .article-title {
     font-size: 1.6rem;
  }

  .article-content {
    font-size: 17px;
    line-height: 1.8;
  }

  .article-content img,
  .article-content table {
    max-width: 100% !important;
    height: auto !important;
  }
  
  .article-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}


/* 封面圖 */
.article-cover {
  margin-bottom: 24px;
}

.article-cover img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* 標題 */
.article-title {
  font-size: 2rem;
  margin-bottom: 12px;
  line-height: 1.3;
  color: #222;
}

/* 發佈資訊 */
.article-meta {
  color: #777;
  font-size: 14px;
  margin-bottom: 24px;
}

/* 文章內容 */
.article-content {
  font-size: 16px;
  line-height: 1.9;
  color: #333;
}

.article-content p {
  margin-bottom: 1.2em;
}


.article-content h2 {
  font-size: 1.6rem;
  margin: 1.4em 0 0.6em 0;
  line-height: 1.4;
}

.article-content h3 {
  font-size: 1.3rem;
  margin: 1.2em 0 0.6em 0;
  line-height: 1.4;
}

.article-content ul,
.article-content ol {
  margin: 1em 0 1.2em 1.4em;
}

.article-content blockquote {
  margin: 1.4em 0;
  padding: 12px 16px;
  background: #f6f6f6;
  border-left: 4px solid #007f7f;
  color: #444;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto;
  border-radius: 10px;
}

/* 圖片集 */
.article-gallery {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.article-gallery h3 {
  text-align: center;
  font-size: 26px;
  margin-bottom: 22px;
}

.article-gallery figure {
  margin-bottom: 24px;
}

.article-gallery img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.article-gallery figcaption {
  font-size: 14px;
  color: #666;
  margin-top: 6px;
  text-align: center;
}

/* 返回連結 */
.article-back {
  margin-top: 50px;
  text-align: center;
}

.article-back a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, color .25s ease;
}

.article-back a:hover {
  color: #007f7f;
  border-color: #007f7f;
}


.container-article h2{
  text-align: center;
  padding: 35px;
  font-size: 35px;
  margin: 0;
  color: #333;
}

.article-grid {
  padding: 0 30px 50px 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transition: transform .3s ease, box-shadow .3s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

.article-image {
  width: 100%;
  height: 370px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.article-body h3 {
  text-align: center;
  font-size: 25px;
  padding: 10px;
}

.article-body p {
  flex: 1;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.5;
  font-size: 18px;
}

.article-btn {
  align-self: center;
  padding: 8px 14px;
  margin-bottom: 10px;
  background: #007f7f;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 18px;
}

/* 首頁商品卡片整張可點 */
.article-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}



/* 大型平板 (≤ 1024px) */
@media (max-width: 64em) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 20px 40px 20px;
  }

  .article-image {
    height: 280px; 
  }
}

/* 手機版 (≤ 768px) */
@media (max-width: 48em) {
  .article-title {
    font-size: 1.6rem; 
    margin-bottom: 10px;
  }

  .article-meta {
    margin-bottom: 16px;
  }

 
  .article-content {
    font-size: 17px; 
    line-height: 1.8; 
  }

  .article-content h2 { font-size: 1.4rem; }
  .article-content h3 { font-size: 1.2rem; }

 
  .container-article h2, 
  .article-gallery h3 {
    font-size: 26px; 
    padding: 20px;
  }

  /* 推薦文章卡片 (Grid) */
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 15px 40px 15px;
  }

  .article-image {
    height: 200px; 
    aspect-ratio: 16 / 9;
  }

  .article-body{
    padding: 6px;
  }

  .article-body h3 {
    font-size: 17px; 
  }

  .article-body p {
    display: none;
  }

  .article-btn {
    width: 80%;
    text-align: center;
    padding: 6px;
  }

  .article-back {
    margin-top: 30px;
    padding-bottom: 20px;
    margin-bottom: 8px;
  }
}

/* 極小螢幕 (≤ 375px) */
@media (max-width: 23.5em) {
  .article-title {
    font-size: 1.4rem;
  }
  .article-content {
    font-size: 16px;
  }
}

