/* ===== 1. 色彩與基礎 ===== */
:root {
  --bg: #f8f4ee;
  --white: #ffffff;
  --black: #111111;
  --accent: #c0392b;
  --accent-soft: #f4d5d0;
  --gray: #666666;
  --line: #e5e7eb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei",
    sans-serif;
  background: var(--bg);
  color: var(--black);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== 2. HEADER / PAGE FRAME ===== */

/* ========== HEADER ========== */
.site-header {
  background: #0ABAB5;   /* Tiffany Blue */
  padding: 8px 16px;
}

/* 讓 header 跟內容一樣寬，並且整體置中 */
.header-inner {
  max-width: 1000px;      /* ← 改成跟 page-main 一樣 */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center; /* ← 只有 LOGO，就直接整排置中 */
}

/* 左右的按鈕 */
.icon-button {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  padding: 6px;
  cursor: pointer;
}

/* LOGO 區塊本身就好，不用再 flex:1 撐開 */
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  /* flex: 1; 刪掉這行 */
  justify-content: center;
}

/* LOGO 圖片 */
.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

/* 十字架 */
.logo-cross {
  color: white;
  font-size: 22px;
  margin-right: 4px;
}

/* LOGO 文字 */
.logo-text .logo-title {
  color: white;
  font-size: 18px;
  font-weight: 700;
}

.logo-text .logo-sub {
  color: #ccc;
  font-size: 12px;
  margin-top: -2px;
}

/* RWD：手機時 LOGO 變小一些 */
@media (max-width: 480px) {
  .logo-img {
    width: 32px;
    height: 32px;
  }

  .logo-text .logo-title {
    font-size: 16px;
  }

  .logo-text .logo-sub {
    font-size: 11px;
  }
}

/* 主要內容容器 */
.page-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ===== 3. 首頁：九宮格 ===== */

.home-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* 基本：手機 / 平板 預設 3 欄 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* 9 宮格卡片 */
.feature-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.feature-card .icon {
  font-size: 24px;
}

.feature-card .label {
  white-space: nowrap;
}

/* hover 效果 */
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* 大螢幕（桌機 / 平板橫式寬過 1024px）：排成一列 9 欄 */
@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===== 4. WELCOME 區塊（保留以後用） ===== */

.welcome-section {
  margin-top: 8px;
}

.welcome-tag {
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 4px 0;
}

.welcome-title {
  margin: 0 0 16px 0;
  font-size: 20px;
}

.welcome-card {
  background: var(--accent);
  color: var(--white);
  border-radius: 24px;
  padding: 24px 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.welcome-main h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.welcome-main p {
  margin: 0 0 16px 0;
  font-size: 14px;
}

.welcome-illustration {
  font-size: 26px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  background: var(--white);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(0.97);
}

/* ===== 5. 最新教會消息 卡片 ===== */

.home-news-preview {
  margin-top: 8px;
}

.home-news-preview h2 {
  font-size: 18px;
  margin: 0 0 12px 0;
}

.news-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.news-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.news-card-image {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
}

.news-card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-card-date {
  font-size: 12px;
  color: var(--gray);
}

.news-card-title {
  font-size: 15px;
  font-weight: 600;
}

.news-card-summary {
  font-size: 14px;
  color: var(--gray);
  margin: 0 0 4px 0;
}

.news-card-link {
  font-size: 13px;
  margin-top: 4px;
  color: var(--accent);
}

.home-news-more {
  margin-top: 12px;
  text-align: center;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
}

/* ===== 6. 通用列表頁 / 內頁 ===== */

.page-section {
  margin-top: 16px;
}

.page-title {
  margin: 0 0 16px 0;
  font-size: 22px;
}

.pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}

.page-link {
  color: var(--accent);
}

.news-detail-meta {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
}

.news-detail-content {
  font-size: 15px;
  line-height: 1.6;
}

/* ===== 7. 活動照片輪播 ===== */

.banner-slider {
  position: relative;
  margin: 32px auto 40px;
  width: min(960px, 100% - 32px);   /* PC：留一點左右空隙 */
  height: 260px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
  background: #f3f4f6;
}

.banner-slider .slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-slider .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;      /* PC：以中心對齊 */
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.banner-slider .slide.active {
  opacity: 1;
  transform: scale(1);
}

.banner-slider .prev-btn,
.banner-slider .next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-slider .prev-btn { left: 14px; }
.banner-slider .next-btn { right: 14px; }

.banner-slider .prev-btn:hover,
.banner-slider .next-btn:hover {
  background: rgba(15, 23, 42, 0.7);
}

/* 手機直式：吃滿整個寬度，照片往上對齊 */
@media (max-width: 768px) {
  .banner-slider {
    margin: 16px 0 24px;
    width: 100%;
    height: 220px;
    border-radius: 0;
  }

  .banner-slider .slide {
    background-position: center top;  /* 優先保留照片上半部 */
  }
}

/* ===== 8. FOOTER ===== */

.site-footer {
  background: #0ABAB5;   /* Tiffany Blue */
  color: white;
  padding: 24px 12px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

.footer-info {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.85;
  color: #fefefe;        /* 白色稍亮，看起來乾淨 */
}

.footer-copy {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.7;
  color: #fefefe;        /* 白色稍亮，看起來乾淨 */
  text-align: center;   /* ← 加這行就會置中了 */
}
