@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #005daa;
  --secondary-color: #043c89;
  --accent-color: #ffc000;
  --text-color: #333333;
  --bg-color: #ffffff;
  --bg-light: #f8f9fa;
  --border-radius: 16px;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--secondary-color);
}

/* Apple style navbar */
.navbar {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 0;
}

.navbar-brand img {
  height: 48px;
  transition: var(--transition);
}

.navbar-brand:hover img {
  opacity: 0.8;
}

.nav-link {
  color: #1d1d1f !important;
  font-size: 15px;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

.dropdown-menu {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

/* Sections */
section {
  padding: 100px 0;
}

.bg-light-gray {
  background-color: var(--bg-light);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1d1d1f;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  margin: 16px auto 0;
  border-radius: 4px;
}

/* Hero Carousel */
.hero-carousel {
  position: relative;
  z-index: 1;
  height: 80vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-carousel .carousel-indicators {
  z-index: 12;
  margin-bottom: 1rem;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  z-index: 12;
}

/* 浮動頭像區塊覆蓋輪播底部時，空白處不攔截點擊（讓指示點可操作） */
.home-floating-profiles {
  z-index: 10;
  pointer-events: none;
}

.home-floating-profiles .floating-profile {
  pointer-events: auto;
}

.hero-carousel .carousel-item {
  height: 80vh;
  min-height: 600px;
  background-size: cover;
  background-position: center;
}

.hero-carousel .hero-carousel-slide-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hero-carousel .carousel-caption {
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 0 20px;
  pointer-events: none;
  z-index: 3;
}

.hero-carousel h2 {
  color: #fff;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  letter-spacing: -1px;
}

.hero-carousel p {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 300;
  max-width: 700px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Floating Profiles */
.floating-profile {
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.floating-profile:hover {
  transform: translateY(-8px);
}

.floating-profile .profile-img-wrapper {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  padding: 6px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 2;
}

.floating-profile img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

.floating-profile .profile-info {
  background: #fff;
  padding: 24px 10px 10px;
  border-radius: 16px;
  margin-top: -20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  width: 100%;
  z-index: 1;
  border: 1px solid rgba(0,0,0,0.03);
  transition: all 0.3s ease;
}

.floating-profile:hover .profile-info {
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.floating-profile .title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 2px;
  display: block;
}

.floating-profile .year {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
  background: #fff;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 240px;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 2rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1d1d1f;
}

.card-text {
  color: #86868b;
  font-size: 0.95rem;
}

.date-badge {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.home-news-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.home-news-meta .date-badge {
  margin-bottom: 0;
}

.news-cate-badge {
  display: inline-block;
  background: #f5c400;
  color: #1d1d1f;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 30px;
  padding: 0.8rem 2rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 93, 170, 0.3);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 30px;
  padding: 0.8rem 2rem;
  font-weight: 500;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 93, 170, 0.3);
}

.more-btn-container {
  text-align: center;
  margin-top: 40px;
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: rgba(255,255,255,0.8);
  padding: 80px 0 40px;
}

footer h5 {
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 25px;
  font-size: 1.1rem;
}

footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: var(--transition);
  display: block;
  margin-bottom: 10px;
}

footer a:hover {
  color: #fff;
  transform: translateX(5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 60px;
  padding-top: 30px;
  text-align: center;
  font-size: 0.9rem;
}

.home-card-media {
  position: relative;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: var(--transition);
  pointer-events: none;
  z-index: 1;
}

.card:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  color: var(--accent-color);
}

.article-content iframe {
  max-width: 100%;
  border: 0;
}

/* 內頁白卡：不裁切寬圖／大表格 */
.page-content .card {
  overflow: visible;
  height: auto;
}

.page-content .article-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.page-content .article-content img {
  max-width: 100%;
  width: auto !important;
  height: auto !important;
  cursor: zoom-in;
}

.page-content .content-gallery-stack {
  line-height: 0;
}

.page-content .content-gallery-stack img {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: top;
  cursor: zoom-in;
}

.page-content .article-content table {
  max-width: none;
}

/* 分區頁（4-2-x）所轄扶輪社：上下表第一欄同寬對齊 */
.division-club-stack {
  --division-col-photo: 216px;
  --division-col-role: 140px;
  --division-col-name: 180px;
}
.division-club-stack .division-club-table {
  table-layout: fixed;
  width: 100%;
  margin-bottom: 0;
}
.division-club-stack .division-col-photo {
  width: var(--division-col-photo);
  max-width: var(--division-col-photo);
  min-width: var(--division-col-photo);
}
.division-club-stack .division-col-role {
  width: var(--division-col-role);
}
.division-club-stack .division-col-name {
  width: var(--division-col-name);
}
.division-club-stack .division-club-info-table .division-col-label {
  width: var(--division-col-photo);
  max-width: var(--division-col-photo);
  min-width: var(--division-col-photo);
  box-sizing: border-box;
}

/* 內頁圖片放大預覽 */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: none;
  flex-direction: column;
  z-index: 2000;
  padding: 0;
}
.image-lightbox.is-open {
  display: flex;
}
.image-lightbox__toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 56px 8px;
  color: #fff;
}
.image-lightbox__zoom-btn {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.image-lightbox__zoom-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}
.image-lightbox__zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.image-lightbox__zoom-label {
  min-width: 4.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.image-lightbox__stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px 24px;
}
.image-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(96vw, 1600px);
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
}
.image-lightbox__close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

/* 主講人才庫 7-9（speaker_pool.php） */
.speaker-pool-search-form .form-control,
.speaker-pool-search-form .form-select {
  border-color: rgba(0, 51, 141, 0.25);
}
.speaker-pool-download-link {
  font-weight: 600;
  color: var(--primary-color, #005daa);
}
.speaker-pool-download-link:hover {
  color: var(--accent-color, #f5a623);
}
.speaker-pool-section .speaker-pool-card {
  border: 2px solid var(--primary-color, #005daa);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.speaker-pool-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #dee2e6;
}
.speaker-pool-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.speaker-pool-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color, #005daa);
}
.speaker-pool-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color, #005daa);
  white-space: nowrap;
}
.speaker-pool-more:hover {
  color: var(--accent-color, #f5a623);
}
.speaker-pool-club {
  text-align: right;
  font-size: 0.875rem;
  color: #6c757d;
  flex: 1 1 auto;
  min-width: 8rem;
}
.speaker-pool-table th {
  width: 7.5rem;
  vertical-align: middle;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  background: #f8f9fa;
}
.speaker-pool-table td {
  vertical-align: middle;
  font-size: 0.9rem;
}
.speaker-pool-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #dee2e6;
  background: #fff;
}

/* RI社長列表（1-2）：整卡可點，無摘要與「查看年度主題」文字 */
.annual-theme-card--link-only {
  cursor: pointer;
  transition: var(--transition);
}
.annual-theme-card--link-only:hover {
  box-shadow: 0 8px 24px rgba(0, 93, 170, 0.15) !important;
}

/* 總監月報（2-4-x / news15）卡片 */
.governor-monthly-card {
  border: 1px solid rgba(0, 93, 170, 0.15) !important;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 45%) !important;
  box-shadow: 0 6px 16px rgba(0, 93, 170, 0.08) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.governor-monthly-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 93, 170, 0.28) !important;
  box-shadow: 0 12px 24px rgba(0, 93, 170, 0.15) !important;
}
.governor-monthly-title-link {
  color: var(--primary-color);
}
.governor-monthly-title-link:hover {
  color: #004b86;
}
.governor-monthly-actions .governor-monthly-btn {
  border-radius: 999px;
  padding: 0.36rem 0.9rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.governor-monthly-btn-online {
  background: linear-gradient(135deg, #ffd46b 0%, #f5a623 100%);
  color: #5f3a00;
  border: 1px solid rgba(245, 166, 35, 0.55);
  box-shadow: 0 4px 10px rgba(245, 166, 35, 0.28);
}
.governor-monthly-btn-online:hover {
  background: linear-gradient(135deg, #ffca4d 0%, #f29b08 100%);
  color: #fff;
  border-color: #f29b08;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 16px rgba(245, 166, 35, 0.38);
  filter: saturate(1.05);
}
.governor-monthly-btn-pdf {
  background: linear-gradient(135deg, #65b3ff 0%, #005daa 100%);
  color: #fff;
  border: 1px solid rgba(0, 93, 170, 0.65);
  box-shadow: 0 4px 10px rgba(0, 93, 170, 0.26);
}
.governor-monthly-btn-pdf:hover {
  background: linear-gradient(135deg, #4fa8ff 0%, #004f8f 100%);
  color: #fff;
  border-color: #004f8f;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 93, 170, 0.35);
  filter: saturate(1.05);
}
