/* 朴子市召會首頁樣式（從 public/index.html 抽出，降低首頁 HTML 體積） */
* { font-family: 'Noto Sans TC', sans-serif; }
.font-serif { font-family: 'Noto Sans TC', sans-serif; }
.font-display { font-family: 'Noto Sans TC', sans-serif; }
:root { --font-scale: 1; }
html { scroll-behavior: smooth; font-size: calc(17px * var(--font-scale)); }
html[data-font-size="small"] { font-size: calc(15px * var(--font-scale)); }
html[data-font-size="large"] { font-size: calc(19px * var(--font-scale)); }
body { background: #FEFEFE; }

/* 深色模式：已抽出到 /assets/dark-mode.css（首頁額外載入該檔即可） */
::selection { background: #C9A962; color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #FAFAF8; }
::-webkit-scrollbar-thumb { background: #C9A962; border-radius: 3px; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeIn { animation: fadeIn 0.3s ease-out forwards; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, #E8D5A3, transparent); }
.card-elegant { background: white; border: 1px solid #F0EBE0; transition: all 0.3s ease; }
.card-elegant:hover { box-shadow: 0 8px 30px rgba(201, 169, 98, 0.1); border-color: #E8D5A3; }
.btn-gold { background: linear-gradient(135deg, #C9A962, #B8960B); color: white; transition: all 0.3s; }
.btn-gold:hover { background: linear-gradient(135deg, #B8960B, #9A7B0A); }
.btn-outline { border: 1.5px solid #C9A962; color: #9A7B0A; transition: all 0.3s; }
.btn-outline:hover { background: #C9A962; color: white; }
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }
.desktop-nav-scroll {
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.desktop-nav-scroll::-webkit-scrollbar {
  display: none;
}
.desktop-nav-scroll > * {
  flex: 0 0 auto;
}
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.home-hero-copy {
  text-align: center;
}
.home-info-carousel {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #E8D5A3;
  box-shadow: 0 24px 60px rgba(201, 169, 98, 0.18), 0 8px 24px rgba(31, 41, 55, 0.06);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  overflow: hidden;
}
.home-info-carousel:focus-within {
  box-shadow: 0 24px 60px rgba(201, 169, 98, 0.22), 0 0 0 4px rgba(201, 169, 98, 0.15);
}
.home-info-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}
.home-info-carousel-label {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: #B8960B;
  font-weight: 600;
}
.home-info-carousel-count {
  color: #9A7B0A;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.home-info-carousel-stage {
  position: relative;
  min-height: 300px;
}
.home-info-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px 20px;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.home-info-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.home-info-slide-kicker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid #E8D5A3;
  background: #FDFBF7;
  color: #9A7B0A;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.home-info-slide h2 {
  margin: 0;
  color: #1F2937;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
  font-weight: 700;
}
.home-info-slide p {
  margin: 0;
  color: #4B5563;
  font-size: 15px;
  line-height: 1.75;
}
.home-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.home-info-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: #7D6408;
  background: #F9F3E3;
  border: 1px solid #E8D5A3;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
}
.home-info-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}
.home-info-cta {
  min-height: 44px;
  padding: 11px 16px;
  border: 0;
  background: linear-gradient(135deg, #C9A962, #B8960B);
  color: white;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-info-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 169, 98, 0.28);
}
.home-info-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-info-nav {
  width: 40px;
  height: 40px;
  border: 1px solid #E8D5A3;
  background: white;
  color: #9A7B0A;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.home-info-nav:hover {
  background: #FDFBF7;
  border-color: #C9A962;
}
.home-info-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 20px 18px;
}
.home-info-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #E8D5A3;
  cursor: pointer;
  transition: all 0.2s ease;
}
.home-info-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: #9A7B0A;
}
.text-gold { color: #9A7B0A; }
.bg-gold { background-color: #9A7B0A; }
.group-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
/* 隱藏滾動條 */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
/* AI 訊息樣式 */
.ai-message h2, .ai-message h3, .ai-message h4 { margin-top: 0.75rem; margin-bottom: 0.25rem; }
.ai-message h2:first-child, .ai-message h3:first-child, .ai-message h4:first-child { margin-top: 0; }
.ai-message ul, .ai-message ol { margin: 0.5rem 0; padding-left: 0; }
.ai-message li { margin: 0.25rem 0; }
.ai-message pre { margin: 0.5rem 0; }
.ai-message code { font-family: ui-monospace, monospace; }
.ai-message a {
  word-break: break-all;
  transition: all 0.15s ease;
}
.ai-message a:hover {
  opacity: 0.85;
}
.ai-message strong { font-weight: 600; }
/* 詩歌連結樣式 */
.ai-message .hymn-ref {
  margin: 0.125rem 0;
  line-height: 1.8;
}
.ai-message .hymn-ref a {
  text-decoration: none;
  font-weight: 500;
}
/* 連結按鈕樣式 */
.ai-message a.rounded-full {
  text-decoration: none;
  font-weight: 500;
}

/* ===== 移動端全面優化 ===== */

/* 安全區域適配 */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-safe { padding-bottom: env(safe-area-inset-bottom); }
  .fixed-bottom { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* 觸摸設備優化 */
@media (hover: none) and (pointer: coarse) {
  button, a, [onclick] { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; }
  .btn-gold, .btn-outline { min-height: 48px; padding: 12px 24px; }
}

/* 小螢幕適配 */
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.25rem !important; }
  .container { padding-left: 16px; padding-right: 16px; }
  .home-info-carousel { border-radius: 12px; }
  .home-info-carousel-stage { min-height: 330px; }
  .home-info-slide { padding: 20px 18px 18px; }
  .home-info-slide h2 { font-size: 1.5rem !important; line-height: 1.28; }
  .home-info-cta-row { align-items: stretch; flex-direction: column; }
  .home-info-controls { justify-content: flex-end; }
}

/* 超小螢幕 */
@media (max-width: 375px) {
  body { font-size: 14px; }
  .container { padding-left: 12px; padding-right: 12px; }
  .btn-gold, .btn-outline { padding: 10px 16px; font-size: 14px; }
}

/* 導航文字不換行（防止單字成行） */
nav a, nav button {
  white-space: nowrap;
}

/* 導航容器允許換行但不斷詞 */
.nav-container {
  word-break: keep-all;
}

/* 移動端導航優化 */
@media (max-width: 1024px) {
  .mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 100;
    transition: right 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-nav.open { right: 0; }
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  .nav-overlay.show { opacity: 1; visibility: visible; }
}

/* 滾動優化 */
.scroll-smooth {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 卡片響應式 */
@media (max-width: 640px) {
  .card-elegant { border-radius: 12px; }
}

/* 圖片響應式 */
img { max-width: 100%; height: auto; }

/* 文字截斷 */
.truncate-mobile {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .truncate-mobile { white-space: normal; }
}

/* AI 對話框移動端 */
@media (max-width: 640px) {
  .ai-chat-container {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 80vh !important;
    border-radius: 16px 16px 0 0 !important;
  }
}

/* 視頻響應式 */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 下拉選單移動端 */
@media (max-width: 640px) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-size: 16px;
    background-repeat: no-repeat;
    padding-right: 36px;
  }
}

/* ==================== 桌面版深度優化 ==================== */

/* 中型桌面螢幕 (1024px - 1279px) */
@media (min-width: 1024px) {
  .home-hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.78fr);
    gap: 56px;
  }
  .home-hero-copy {
    text-align: left;
  }
  .home-hero-copy .divider {
    margin-left: 0;
    margin-right: auto;
  }
  .home-info-carousel {
    margin-right: 0;
  }
  body { font-size: 17px; }
  .container { max-width: 1100px; padding-left: 32px; padding-right: 32px; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .card-elegant { padding: 24px; border-radius: 16px; }
  .btn-gold, .btn-outline { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
}

/* 大型桌面螢幕 (1280px - 1439px) */
@media (min-width: 1280px) {
  body { font-size: 18px; }
  .container { max-width: 1200px; padding-left: 40px; padding-right: 40px; }
  h1 { font-size: 2.5rem; letter-spacing: 0.02em; }
  h2 { font-size: 2rem; }
  .card-elegant { padding: 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
  .card-elegant:hover { box-shadow: 0 12px 40px rgba(201, 169, 98, 0.15); transform: translateY(-4px); }

  /* 網格佈局 */
  .grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; gap: 24px; }
  .grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; gap: 24px; }
}

/* 超大桌面螢幕 (1440px - 1599px) */
@media (min-width: 1440px) {
  body { font-size: 18px; }
  .container { max-width: 1320px; padding-left: 48px; padding-right: 48px; }
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.125rem; }
  .card-elegant { padding: 32px; border-radius: 20px; }
  .btn-gold, .btn-outline { padding: 16px 32px; font-size: 17px; border-radius: 12px; }

  /* 導航優化 */
  nav a { padding: 12px 16px; font-size: 16px; }

  /* 新聞/活動卡片 */
  .news-card, .event-card { padding: 28px; }
  .news-card h3, .event-card h3 { font-size: 1.25rem; }

  /* AI 對話框 */
  .ai-chat-container { max-width: 450px; }
}

/* 4K 顯示器 (1600px - 1919px) */
@media (min-width: 1600px) {
  body { font-size: 19px; }
  .container { max-width: 1440px; padding-left: 60px; padding-right: 60px; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.5rem; }
  .card-elegant { padding: 36px; }
  .btn-gold, .btn-outline { padding: 18px 36px; font-size: 18px; }

  /* 網格佈局 */
  .grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 { grid-template-columns: repeat(4, 1fr) !important; gap: 28px; }

  /* 側邊區塊 */
  .sidebar-section { padding: 28px; }
}

/* 超寬螢幕 (1920px+) */
@media (min-width: 1920px) {
  body { font-size: 20px; }
  .container { max-width: 1600px; padding-left: 80px; padding-right: 80px; }
  h1 { font-size: 3.5rem; line-height: 1.2; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }
  .card-elegant { padding: 40px; border-radius: 24px; box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
  .btn-gold, .btn-outline { padding: 20px 40px; font-size: 19px; border-radius: 14px; }

  /* 導航 */
  nav { padding: 20px 0; }
  nav a { padding: 14px 20px; font-size: 17px; }

  /* 頁面區塊間距 */
  section { padding: 80px 0; }
  .section-gap { margin-bottom: 60px; }

  /* 網格 */
  .grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-4 { grid-template-columns: repeat(5, 1fr) !important; gap: 32px; }
}

/* 4K 超寬螢幕 (2560px+) */
@media (min-width: 2560px) {
  body { font-size: 22px; }
  .container { max-width: 1920px; }
  h1 { font-size: 4rem; }
  h2 { font-size: 3rem; }
  .card-elegant { padding: 48px; }
  .btn-gold, .btn-outline { padding: 24px 48px; font-size: 20px; }
  section { padding: 100px 0; }
}

/* ==================== 桌面版交互增強 ==================== */

@media (min-width: 1024px) {
  /* 卡片懸停效果 */
  .card-elegant {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .card-elegant:hover {
    transform: translateY(-6px);
  }

  /* 按鈕懸停效果 */
  .btn-gold {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 169, 98, 0.4);
  }

  .btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 98, 0.3);
  }

  /* 圖片懸停效果 */
  .img-hover-zoom {
    overflow: hidden;
  }
  .img-hover-zoom img {
    transition: transform 0.5s ease;
  }
  .img-hover-zoom:hover img {
    transform: scale(1.05);
  }

  /* 導航連結懸停 */
  nav a {
    position: relative;
    transition: all 0.3s ease;
  }
  nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #C9A962;
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }
  nav a:hover::after {
    width: 80%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-info-slide,
  .home-info-cta,
  .home-info-nav,
  .home-info-dot {
    transition: none !important;
  }
}

/* ==================== 桌面版排版優化 ==================== */

@media (min-width: 1024px) {
  /* 兩欄佈局 */
  .two-column-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
  }

  /* 三欄佈局 */
  .three-column-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  /* 內容與側邊欄 */
  .content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
  }

  /* 標題區塊 */
  .page-header {
    text-align: center;
    margin-bottom: 48px;
  }
  .page-header h1 {
    margin-bottom: 16px;
  }
  .page-header .subtitle {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1440px) {
  .content-with-sidebar {
    grid-template-columns: 1fr 380px;
    gap: 60px;
  }
}

/* 網路狀態提示（手機優先） */
.network-toast {
  display: none;
  position: fixed;
  top: env(safe-area-inset-top, 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  max-width: calc(100% - 2rem);
  text-align: center;
  transition: opacity 0.3s ease;
}
.network-toast.offline {
  display: block;
  background: #ef4444;
  color: white;
}
.network-toast.online {
  display: block;
  background: #22c55e;
  color: white;
  animation: toastFade 2s ease 1.5s forwards;
}
@keyframes toastFade {
  to { opacity: 0; display: none; }
}
