/* ===================================================================
   月月有公益．日日助學子 charitable_event（type A）
   scope：.nstyle_theme.page_charitable
   ‧ banner 用共用 .npage_banner（charitable_event_banner.png）
   ‧ 兩段式背景帶：影片區（藍天雲朵 blue_bg1）／足跡區（米黃雲朵 yellow_bg2）
   ‧ 置中區塊標題：英文 eyebrow ＋ 愛心 ＋ 漸層字 ＋ 副標
   ‧ 影片精選：3 支縮圖＋播放鍵浮層 → BS5 影片 Modal（取代 fancybox-media）
   ‧ 公益足跡：資料讀 data/charitable.json，卡片四欄置中，「看更多」逐次載入
   ‧ 點卡片 → BS5 明細 Modal（純文字：標題＋副標＋內文，取代 33 支 charitable_pop 彈窗）
   ‧ 手寫／插圖裝飾：text_1（影片區）、text_2/3＋bg_img_left/right（足跡區）
   ‧ 已拋棄 BS3 / jQuery / fancybox / islogin / IE 遺留腳本
   =================================================================== */

/* Banner（圖已內建標題；沿用共用 .npage_banner，僅指定圖與高度） */
.nstyle_theme.page_charitable .npage_banner--charitable {
  position: relative;
  z-index: 2;
  background-image: url("../../img/charitable_event/charitable_event_banner.png");
  height: 300px;
  background-size: cover;
  background-position: center;
}

.nstyle_theme.page_charitable { position: relative; overflow: hidden; }

/* ── 區塊背景帶（雲朵圖拉伸鋪滿；clouds 貼齊上下邊緣，如參考圖） ──
   注意：需覆寫 nstyle_base.css 的 .nstyle_theme section{z-index:-1}，
   否則整段會被父層背景蓋在後方而不可見。 */
.nstyle_theme.page_charitable .nchar_sect {
  position: relative;
  z-index: 0;              /* 取消 base .nstyle_theme section 的 z-index:-1 */
  padding: 0;              /* 取消 base section 的預設垂直內距，改由 --blue/--yellow 指定 */
  overflow: hidden;
}
.nstyle_theme.page_charitable .nchar_sect--blue {
  padding: 64px 0 76px;
}
.nstyle_theme.page_charitable .nchar_sect--yellow {
  background: #fdf3d0 url("../../img/charitable_event/charitable_event_yellow_bg2.png") center / 100% 100% no-repeat;
  padding: 66px 0 84px;
}

/* 內容容器 */
.nstyle_theme.page_charitable .nchar_inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── 置中區塊標題（eyebrow ＋ 愛心 ＋ 漸層主標 ＋ 副標） ── */
.nstyle_theme.page_charitable .nchar_shead {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px;
}
.nstyle_theme.page_charitable .nchar_eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #7bb0e6;
}
.nstyle_theme.page_charitable .nchar_eyebrow--green { color: #78c39a; }
.nstyle_theme.page_charitable .nchar_stitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.3;
}
.nstyle_theme.page_charitable .nchar_stitle .material-icons-round { color: #ef5b6e; font-size: 30px; }
.nstyle_theme.page_charitable .nchar_stitle_txt {
  background: linear-gradient(90deg, #2f74d6, #4aa3ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nstyle_theme.page_charitable .nchar_stitle--green .nchar_stitle_txt {
  background: linear-gradient(90deg, #2e9e6b, #5bc389);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nstyle_theme.page_charitable .nchar_ssub {
  margin: 0;
  color: #5a6579;
  font-size: 16px;
  line-height: 1.7;
}
.nstyle_theme.page_charitable .nchar_sect--yellow .nchar_ssub { color: #8a6d2f; }

/* ── 手寫／插圖裝飾（絕對定位、純視覺、手機隱藏） ── */
.nstyle_theme.page_charitable .nchar_art { position: absolute; z-index: 1; height: auto; pointer-events: none; }
/* 影片區：小小的幫助… */
.nstyle_theme.page_charitable .nchar_art--t1 { left: 50px; top: 118px; width: 210px; opacity: 0.2; }
/* 足跡區：教育有愛（左上）／因為有你（右中） */
.nstyle_theme.page_charitable .nchar_art--t2 { left: 90px; top: 66px; width: 250px; opacity: 0.35; transform: rotate(-5deg); }
.nstyle_theme.page_charitable .nchar_art--t3 { right: 14px; top: 300px; width: 190px; opacity: 0.25; transform: rotate(45deg); }
/* 足跡區插圖：手捧愛心（左下）／葉子（右下） */
.nstyle_theme.page_charitable .nchar_art--left { left: -14px; bottom: -5px; width: 240px; }
.nstyle_theme.page_charitable .nchar_art--right { right: -18px; bottom: 0; width: 230px; }

/* ── 影片精選（3 欄縮圖＋播放鍵） ── */
.nstyle_theme.page_charitable .nchar_videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.nstyle_theme.page_charitable .nchar_vcard {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eef3fb;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(31, 95, 191, 0.10), 0 2px 6px rgba(31, 95, 191, 0.06);
  transition: transform 0.18s, box-shadow 0.18s;
}
.nstyle_theme.page_charitable .nchar_vcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(31, 95, 191, 0.18);
}
.nstyle_theme.page_charitable .nchar_thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #dfe8f5;
  cursor: pointer;
  overflow: hidden;
}
.nstyle_theme.page_charitable .nchar_thumb_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.nstyle_theme.page_charitable .nchar_thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 30, 60, 0) 55%, rgba(10, 30, 60, 0.18) 100%);
  transition: background 0.2s;
}
.nstyle_theme.page_charitable .nchar_play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #2f74d6;
  box-shadow: 0 4px 12px rgba(15, 45, 90, 0.18);
  transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nstyle_theme.page_charitable .nchar_play .material-icons-round { font-size: 21px; margin-left: 1px; }
.nstyle_theme.page_charitable .nchar_vcard:hover .nchar_thumb_img { transform: scale(1.05); }
.nstyle_theme.page_charitable .nchar_vcard:hover .nchar_play {
  transform: scale(1.08);
  background: #2f74d6;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 116, 214, 0.32);
}
.nstyle_theme.page_charitable .nchar_thumb:focus-visible { outline: 3px solid #5aa6ef; outline-offset: 2px; }
.nstyle_theme.page_charitable .nchar_vtitle {
  padding: 14px 18px 18px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 800;
  color: #1f3a5f;
  line-height: 1.55;
}

/* ── 公益足跡列表（四欄卡片、文字置中） ── */
.nstyle_theme.page_charitable .nchar_grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.nstyle_theme.page_charitable .nchar_card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0;
  border: 1px solid #f2ead0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(150, 120, 40, 0.12), 0 2px 6px rgba(150, 120, 40, 0.06);
  transition: transform 0.18s, box-shadow 0.18s;
}
.nstyle_theme.page_charitable .nchar_card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(150, 120, 40, 0.20);
}
.nstyle_theme.page_charitable .nchar_card:focus-visible { outline: 3px solid #f0c04a; outline-offset: 2px; }
.nstyle_theme.page_charitable .nchar_pic {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
}
.nstyle_theme.page_charitable .nchar_pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* 完整顯示、不裁切 */
  object-position: center;  /* 置中，留白區融入卡片 */
  display: block;
  transition: transform 0.35s ease;
}
.nstyle_theme.page_charitable .nchar_card:hover .nchar_pic img { transform: scale(1.05); }
/* hover 時浮出「看詳情」 */
.nstyle_theme.page_charitable .nchar_more {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(47, 116, 214, 0.92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}
.nstyle_theme.page_charitable .nchar_more .material-icons-round { font-size: 15px; }
.nstyle_theme.page_charitable .nchar_card:hover .nchar_more { opacity: 1; transform: translateY(0); }
.nstyle_theme.page_charitable .nchar_cbody {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 16px 18px 20px;
  flex: 1;
}
.nstyle_theme.page_charitable .nchar_ctitle {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #1f3a5f;
  line-height: 1.5;
}
.nstyle_theme.page_charitable .nchar_csub {
  font-size: 13.5px;
  line-height: 1.6;
  color: #6b7385;
  font-weight: 600;
}

/* ── 看更多按鈕（取代 npager） ── */
.nstyle_theme.page_charitable .nchar_loadmore_wrap { text-align: center; margin-top: 44px; }
.nstyle_theme.page_charitable .nchar_loadmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #4aa3ef, #2f74d6);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(47, 116, 214, 0.32);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}
.nstyle_theme.page_charitable .nchar_loadmore:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(47, 116, 214, 0.40);
  filter: brightness(1.03);
}
.nstyle_theme.page_charitable .nchar_loadmore .material-icons-round { font-size: 20px; }
.nstyle_theme.page_charitable .nchar_loadmore[hidden] { display: none; }

/* 無資料/載入中提示 */
.nstyle_theme.page_charitable .nchar_empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #8a94a6;
  font-size: 15px;
  padding: 48px 0;
}

/* ── BS5 影片 Modal（燈箱，取代 fancybox-media） ── */
.nchar_vmodal .modal-content { border: 0; border-radius: 18px; overflow: hidden; background: #0d1626; }
.nchar_vmodal .modal-header {
  background: linear-gradient(135deg, #5aa6ef, #2f74d6);
  color: #fff;
  border-bottom: 0;
  padding: 14px 20px;
  align-items: center;
  gap: 10px;
}
.nchar_vmodal .modal-title { font-weight: 800; font-size: 16px; }
.nchar_vmodal .modal-header .btn-close { margin-left: auto; }
.nchar_vmodal .modal-body { padding: 0; }
.nchar_vmodal .ratio { background: #000; }

/* ── BS5 明細 Modal（純文字：標題＋副標＋內文，取代 charitable_pop） ── */
.nchar_dmodal .modal-content { border: 0; border-radius: 18px; overflow: hidden; }
.nchar_dmodal .modal-header {
  background: linear-gradient(135deg, #5aa6ef, #2f74d6);
  color: #fff;
  border-bottom: 0;
  padding: 16px 22px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
}
.nchar_dmodal .modal-title { font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.nchar_dmodal .nchar_dsub { font-size: 14px; font-weight: 600; color: #eaf2ff; margin: 0; }
.nchar_dmodal .modal-header .btn-close {
  position: absolute;
  top: 16px;
  right: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.nchar_dmodal .modal-body { padding: 0; }
.nchar_dmodal .nchar_dtext {
  padding: 22px 26px 26px;
  font-size: 15px;
  line-height: 1.9;
  color: #55617a;
}
.nchar_dmodal .nchar_dtext p { margin: 0 0 12px; }
.nchar_dmodal .nchar_dtext p:last-child { margin-bottom: 0; }

/* ── RWD ── */
@media (max-width: 991.98px) {
  .nstyle_theme.page_charitable .nchar_videos { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .nstyle_theme.page_charitable .nchar_grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .nstyle_theme.page_charitable .nchar_art { display: none; } /* 手寫/插圖裝飾在窄版隱藏，避免壓字 */
}
@media (max-width: 767.98px) {
  .nstyle_theme.page_charitable .npage_banner--charitable { height: 150px; }
  .nstyle_theme.page_charitable .nchar_sect--blue { padding: 44px 0 52px; }
  .nstyle_theme.page_charitable .nchar_sect--yellow { padding: 46px 0 58px; }
  .nstyle_theme.page_charitable .nchar_stitle { font-size: 25px; }
  .nstyle_theme.page_charitable .nchar_more { opacity: 1; transform: none; } /* 手機無 hover，常駐顯示 */
}
@media (max-width: 479.98px) {
  .nstyle_theme.page_charitable .nchar_videos,
  .nstyle_theme.page_charitable .nchar_grid { grid-template-columns: 1fr; }
}
