
/* 1. 讓外層容器置中 + 限制最大寬度 */
.news-detail {
  max-width: 1200px;       /* 整個區塊不超過 800px */
  margin: 0 auto 40px;    /* 上外距 0，下外距 40px，左右置中 */
  padding: 0 16px;        /* 左右內距留白 */
  box-sizing: border-box;
}

/* 2. 標題置中 */
.news-title {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
}

/* 3. 文章內容常見元素響應式 */
/* 段落 */
.news-detail .content p {
  margin-bottom: 1em;
  line-height: 1.75;
  text-align: justify;
}

/* 圖片：不超出容器，並置中 */
.news-detail .content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

/* 表格：自動水平滾動 */
.news-detail .content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  overflow-x: auto;
  display: block;
}

/* 表格內文字留白 */
.news-detail .content th,
.news-detail .content td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

/* 列表 */
.news-detail .content ul,
.news-detail .content ol {
  margin: 0 0 1em 1.5em;
}

/* 連結 */
.news-detail .content a {
  color: #0062cc;
  text-decoration: none;
}
.news-detail .content a:hover {
  text-decoration: underline;
}

/* 手機版再收窄一點 */
@media (max-width: 576px) {
  .news-detail {
    max-width: 100%;
    padding: 0 12px;
  }
}



/* 让 video-block 撑满全屏并水平居中 */
.video-block {
  width: 100vw;                               /* 撑满视口宽度 */
  margin-left: calc(50% - 50vw);              /* 水平居中 */
  margin-right: calc(50% - 50vw);
  padding: 40px 0;                            /* 上下留白 */
  background: #000;                           /* 或你喜欢的背景色 */
}

/* 限制 iframe 最大宽度，并居中显示 */
.video-block .video-wrapper {
  max-width: 800px;                           /* 你想要的最大宽度 */
  margin: 0 auto;                             /* 水平居中 */
}

/* iframe 保持 16:9 比例 */
.video-block .video-wrapper iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9;
  display: block;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-item {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
}
.file-link {
  text-decoration: none;
  color: #333;
}
.file-name {
  font-weight: bold;
  margin-right: 10px;
}
.file-size {
  color: #777;
}
.download-icon {
  margin-right: 5px;
}
/* 圖片展示區塊外層 */
.image-gallery {
  margin: 40px auto;
  padding: 0 16px;
}

/* 可選：若想加標題（在 HTML 裡 <h4> … </h4>） */
/*
.image-gallery h4 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #333;
  text-align: center;
}
*/

/* Grid 佈局 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* 單一格圖片容器 */
.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 圖片 */
.gallery-item img {
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 66.66%; /* 3:2 長寬比，如需其他比例可調 */
  object-fit: cover;
}

/* 手機響應：一欄 */
@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
/* Modal 背景覆蓋 */
.modal {
  display: none;              /* 預設隱藏 */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

/* Modal 內的圖片 */
.modal-content {
  display: block;
  max-width: 90%;
  max-height: 80%;
  margin: 5% auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* 關閉按鈕 */
.modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #ccc;
}
