/* ===================================================
檔案路徑：public/css/AofA.css
說明：社團法人中華永續淨零推動協會 協會章程圖片檢視器專屬樣式 (依據 model.css 規範優化)
=================================================== */

/* 1. 頁面主體區塊 */
.section {
  padding: 60px 0 80px;
  background-color: var(--bg-light);
}

.text-center {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* 2. 章程主卡片容器 */
.constitution-card {
  width: 800px;
  max-width: 100%; /* 確保在小於 800px 的手機螢幕上不會超出畫面 */
  margin: 0 auto;  /* 左右自動推開，達成水平置中 */
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  border: 1px solid var(--border-color);
}

.constitution-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.constitution-header .section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.constitution-meta {
  color: var(--body-text);
  font-size: 0.95rem;
  font-weight: 500;
}

/* 3. 圖片檢視器主要佈局 (Viewer Layout) */
.constitution-viewer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 主圖預覽螢幕區 */
.viewer-main-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 64px;
  min-height: 520px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

/* 圖片舞台 */
.image-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.constitution-img {
  display: none;
  width: 100%;
  max-height: 650px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-white);
}

.constitution-img.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* 左右切換按鈕 */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  z-index: 2;
}

.nav-arrow:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

.prev-btn {
  left: 16px;
}

.next-btn {
  right: 16px;
}

/* 4. 頁碼指示器 */
.viewer-counter {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--body-text);
  letter-spacing: 1px;
}

/* 5. 底部縮圖導覽列 (Thumbnails) */
.viewer-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #e2e8f0;
}

.viewer-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.viewer-thumbnails::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 4px;
}

.viewer-thumbnails::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.thumb-btn {
  flex: 0 0 90px;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.thumb-btn img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
}

.thumb-btn span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--body-text);
}

.thumb-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.thumb-btn.active {
  border-color: var(--primary);
  background-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(27, 67, 50, 0.15);
}

.thumb-btn.active span {
  color: var(--primary);
}

/* 6. 響應式優化 (Responsive) */
@media (max-width: 768px) {
  .constitution-card {
    padding: 24px 16px;
  }

  .viewer-main-screen {
    padding: 16px 40px;
    min-height: 380px;
  }

  .nav-arrow {
    width: 36px;
    height: 36px;
  }

  .prev-btn {
    left: 8px;
  }

  .next-btn {
    right: 8px;
  }

  .constitution-header .section-title {
    font-size: 1.75rem;
  }

  .thumb-btn {
    flex: 0 0 75px;
  }

  .thumb-btn img {
    height: 50px;
  }
}