/* ══════════════════════════════════════════════════════
   base.css
   共用樣式：Reset、Utilities、Navbar、Footer
══════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth;}
body { font-family: var(--font-body); color: var(--text-dark); background: #fff;}
a    { text-decoration: none; color: inherit; }
img  { 
  display: block; 
  width: 100%; 
  object-fit: cover; 
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;          /* ✅ 保留：防止圖片被「選取」反白 */
  -webkit-user-drag: none;    /* ✅ 保留：Safari/舊版 Chrome 拖曳防護，JS 的備援 */
  -khtml-user-drag: none;
}


/* ── Shared Utilities ── */
.container { max-width: 1200px; margin: 0 auto; }
.label-tag {
  font-size: 12px; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: 10px; display: block;
}
.section-heading {
  font-family: var(--font-head); 
  font-weight: 600; 
  margin-bottom: 30px;
  text-align: center;
}
.btn-primary {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 14px 32px; font-family: var(--font-body); font-size: 20px;
  font-weight: 500; letter-spacing: 1px; border-radius: 30px; cursor: pointer;
  transition: opacity .2s; border: none;
}
.btn-primary:hover { opacity: .85; }
.btn-outline {
  display: inline-block; border: 1.5px solid var(--primary);
  border-radius: 30px; color: var(--primary); padding: 7px 12px;
  font-size: 18px; font-weight: 500; letter-spacing: 1px; transition: all .2s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }


/* ════════════════════════════════
   NAVBAR
════════════════════════════════ */
.navbar {
  background: var(--navbar-bg, transparent);
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: background .4s, border-color .4s, backdrop-filter .4s;
}
.navbar.scrolled {
  background: var(--navbar-scrolled-bg, rgba(20, 20, 30, 0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.navbar:has(#mobile-menu.open) {
  background: var(--navbar-scrolled-bg, rgba(20, 20, 30, 0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 40px;
  max-width: 1400px; margin: 0 auto;
}
.navbar__right {
  display: flex; align-items: center; gap: 36px;
}
.navbar__brand {
  display: flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .5px;
  text-decoration: none;
}

.navbar__brand span { color: var(--primary); }
.navbar__links {
  display: flex; align-items: center; gap: 36px; list-style: none;
}
.navbar__links a {
  font-size: 20px; font-weight: 400; letter-spacing: 1px;
  color: rgba(255,255,255,.75); text-transform: uppercase;
  transition: color .2s; position: relative;
}
.navbar__links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1.5px; background: var(--primary); transition: width .25s;
}
.navbar__links a:hover,
.navbar__links a.active { color: #fff; }
.navbar__links a:hover::after,
.navbar__links a.active::after { width: 100%; }
.navbar__social { display: flex; align-items: center; gap: 20px; }
.navbar__social a {
  color: rgba(255,255,255,.65); transition: color .2s;
  display: flex; align-items: center;
}
.navbar__social a:hover { color: var(--primary); }
.navbar__social svg { width: 30px; height: 30px; }
.navbar__burger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
}
.navbar__burger span {
  display: block; width: 24px; height: 2px;
  background: #fff; transition: all .3s;
}
.navbar__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__burger.open span:nth-child(2) { opacity: 0; }
.navbar__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.navbar__mobile {
  display: none; 
  flex-direction: column;
  background: var(--navbar-scrolled-bg);;
  padding: 20px 40px 28px;
  border-top: 1px solid rgba(255,255,255,.08);
  top: 72px;                  /* 標註：改成 72px 就不會蓋住導覽列與叉叉 */
  height: calc(100vh - 72px);             /* 從頂部開始，如果有固定導覽列，可設為導覽列的高度 */
  left: 0;            /* 從最左邊開始 */
  width: 100vw;       /* 寬度佔滿視窗 */
  /* height: 100vh;   */
  z-index: 999;       /* 確保在最上層 */
  overflow-y: auto; 
}
.navbar__mobile.open { display: flex; }
.navbar__mobile a {
  color: rgba(255,255,255,.75); 
  font-size: 18px;
  letter-spacing: 1px; 
  text-transform: uppercase;
  padding: 12px 5px; 
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .2s;
  /* display: block; */
  display: flex;   /* 標註：確保標題佔滿橫向空間，方便排列 */
  width: 100%;
}
.navbar__mobile a:hover { color: var(--primary); }

/* 當父層被點擊展開時，箭頭旋轉向上 */
.navbar__mobile-group.is-open .arrow-icon::after {
  transform: rotate(-135deg);
}

/* 預設隱藏子選單 (如果你希望點擊才展開) */
.navbar__mobile-children {
  display: none;
  padding-left: 16px;
}

.navbar__mobile-group.is-open .navbar__mobile-children {
   display: flex;           /* 標註：由 block 改為 flex */
  flex-direction: column;
}

/* ── 手機下拉 ── */
/* 父層容器設定相對定位，方便箭頭定位 */
.navbar__mobile-parent {
  display: flex;
  justify-content: space-between; /* 讓文字與箭頭分兩邊 */
  align-items: center;
  padding: 12px 0;
  color: rgba(255,255,255,.75);
  font-size: 15px;
  position: relative;
}

/* ── 下拉選單 ── */
.navbar__item { position: relative; }
/* .navbar__item--dropdown > a { display: flex; align-items: center; gap: 5px; } */
.dropdown-arrow { transition: transform .25s; flex-shrink: 0; }
.navbar__item--dropdown {
  padding-bottom: 16px;
  margin-bottom: -16px;
}

.navbar__dropdown {
  display: none;
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translateX(-50%);
  min-width: 150px;
  background: rgba(20,20,30,0.97);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 6px 0;
  list-style: none;
  z-index: 200;
  white-space: nowrap;
  top: 100%; 
}
.navbar__item--dropdown:hover > .navbar__dropdown { display: block; }

.navbar__dropdown li { position: relative; }
.navbar__dropdown li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  font-size: 14px; font-weight: 400;
  color: rgba(255,255,255,.75);
  text-transform: none; letter-spacing: .5px;
  transition: color .2s, background .2s;
}
.navbar__dropdown li a::after { display: none; }
.navbar__dropdown li a:hover { color: var(--primary); background: rgba(255,255,255,.05); }

/* ── 第二層子分類 ── */
.navbar__dropdown--sub {
  top: 0; left: 100%; transform: none;
  display: none;
}
.navbar__dropdown li.has-children:hover > .navbar__dropdown--sub { display: block; }


/* 箭頭樣式 */
.arrow-icon::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,.5);
  border-bottom: 2px solid rgba(255,255,255,.5);
  transform: rotate(45deg);
  transition: transform 0.3s;
  margin-left: 10px;
  vertical-align: middle;
}

/* 預設隱藏，社群圖示僅在手機/平板顯示 */
.footer__social-links-container {
  display: none;
}

.footer__grid{
  display: grid;
}

.footer__maintainer{
  font-size: 15px;
  color: var(--light-bg);
  padding: 5px;
  text-align: center;
  opacity: 0.7;
}


@media screen and (max-width: 1024px) {
  .footer__social-links-container {
    display: flex !important;       /* 開啟彈性佈局 */
    justify-content:flex-start;     /* 水平置中 (不論數量多少) */
    align-items: center;            /* 垂直置中 */
    gap: 25px;                      /* 圖示之間的固定間距 */
    width: 100%;                    /* 撐滿寬度 */
  }

  .footer__social-links-container .nav-icon-link {
    display: flex;
    transition: transform 0.2s;
  }

  /* 調整圖示大小，讓手機上更容易點擊 */
  .footer__social-links-container .nav-icon-link svg {
    width:40px; 
    height:40px; 
  }
  
  
  .footer__grid{
    gap: 30px !important;
  }

  .footer__social-links-container a[title="Facebook"]{
    display: none;
  }

}

@media screen and (max-width: 640px){
  .footer__social-links-container{
    justify-content: center;
  }

}


/* ════════════════════════════════
   訂閱區塊
════════════════════════════════ */
/* .subscribe-section { padding: 20px 0; background: var(--dark); } */
.subscribe-inner   { 
  max-width: 460px; 
  margin: 0 auto; 
  text-align: center; 
  padding-bottom: 30px;
  border-radius: 30px;
  /* background: rgba(255, 255, 255, .3); */
  opacity: 0.85;

}
.subscribe-title   {
  font-family: var(--font-head); 
  font-weight: 600;
  color: var(--text-light); 
  margin-bottom: 12px;
  font-size:2rem;
}

.subscribe-desc    { 
  font-size: 15px; 
  color: rgba(255,255,255,.8); 
  margin-bottom: 20px; 
  color:var(--text-light)

}

.subscribe-form    { display: flex; flex-direction: column; gap: 12px; }
.subscribe-input   {
  padding: 12px 18px; font-size: 16px; font-family: var(--font-body);
  background: rgba(255,255,255,.2); 
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 15px;
  color: #fff; outline: none;
  transition: border .2s;
}
.subscribe-input::placeholder { color: rgba(255,255,255,1); }
.subscribe-input:focus { border-color: var(--primary); }
.subscribe-form .btn-primary { width: 100%; text-align: center; padding: 10px; }
.subscribe-message {
  margin-top: 16px; font-size: 14px; color: var(--primary); text-align: center;
}

@media (max-width: 640px){
  .subscribe-section{
    padding: 10px 15px 0;
  }
}

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */
.footer {
  background-color: var(--dark);
  padding: 60px 20px 30px;
  color: rgba(255,255,255,.65);
}
.footer__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 60px; 
  padding: 50px 30px 60px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 25px;
}

.privacy{
  color: var(--text-light);
}



/* 桌機：Facebook 關閉時，兩欄置中 */
@media (min-width: 1024px) {
  .footer__grid--no-social {
    grid-template-columns: 1.4fr 1fr;  /* 拿掉第三欄 */
    max-width: 66.67%;                 /* 維持與三欄等比的寬度 */
    margin-inline: auto;               /* 水平置中 */
  }

  .contact-fab {
    display: none;
  }
}

.footer__brand-name {
  font-family: var(--font-head); font-size: 1.3rem;
  color: #fff; margin-bottom: 16px;
}
.footer__brand-name span { color: var(--primary); }
.footer__bio { font-size: 13.5px; line-height: 1.8; }
.footer__heading {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--primary); margin-bottom: 20px; font-weight: 500;
}
.footer__info p { font-size: 13.5px; line-height: 2; }
.footer__info strong { color: rgba(255,255,255,.85); font-weight: 500; }
/* .footer__social-row { display: flex; gap: 12px; margin-top: 4px; }
.footer__social-row a {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.65); transition: all .2s;
} */
.footer__fb-container {
  width: 100%;
  min-height: 130px; /* 給予最小高度，防止 SDK 載入前高度為 0 */
  overflow: hidden;
  margin-top: 10px;
}
.fb-page, .fb-page span, .fb-page iframe {
  max-width: 100% !important; /* 確保在手機版不會超出螢幕 */
}
/* .footer__social-row a:hover { border-color: var(--primary); color: var(--primary); }
.footer__social-row svg { width: 16px; height: 16px; fill: currentColor; } */
.footer__bottom {
  align-items: center;
  font-size: 15px; 
  color: rgba(255,255,255,.4);
  text-align: center;
}

.footer__view-count {
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: 0.03em;
  padding: 10px 0 10px;
}

/* ════════════════════════════════════════════════
   FB Mini Card — 加到 base.css 末尾
   ════════════════════════════════════════════════ */

.facebook-wrapper {
  width: 100%;
  max-width: 340px;
  overflow: visible;
  display: flex;
  justify-content: start;
}

.fb-mini-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.fb-mini-card:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(24,119,242,.4);
  text-decoration: none;
}

.fb-mini-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.fb-mini-card__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1877F2;
  color: #fff;
  font-size: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fb-mini-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fb-mini-card__name {
  font-size: 18px;
  font-weight: 600;
  color:var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-mini-card__action {
  font-size: 14px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fb-mini-card__icon {
  font-size: 43px;
  color: #1877F2;
  flex-shrink: 0;
}


/* .facebook-wrapper {
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  border-radius: 8px; 
}

.facebook-wrapper iframe {
  display: block;
  width: 100%;
  max-width: 340px;
  border: none;
} */


/* ── RWD ── */
@media (max-width: 960px) {
  .navbar__links,
  .navbar__social { display: none; }
  .navbar__burger  { display: flex; }
  .footer__grid    { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px){
  .footer{
    padding: 20px 20px 30px 50px;
  }

 .nav-icon-link-phoneLine{
  display: none ;
  }

  #phoneline{
    display: none;
  }

  .footer__grid { 
    margin: 0 0 0 80px;
    margin-bottom: 20px; 
  }

  .footer__social-links-container{
    justify-content: center;
  }
}


/* ── 1. 外層浮動容器 (僅在手機版啟用) ── */
@media (max-width: 768px) {
  .contact-fab {
    position: fixed;
    bottom: 65px;
    right: 20px;
    z-index: 9999; /* 確保高於所有網頁層級 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* 核心修正：避免外層隱形框阻擋網頁，只允許按鈕本身接收點擊 */
    pointer-events: none; 
  }

  /* ── 2. 收合狀態：主觸發按鈕 ── */
  .fab-trigger {
    position: absolute; /* 修正：與面板定點重疊，避免排列錯位 */
    bottom: 0;
    right: 0;
    display: flex;             
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--fab-bg, #DCB5FF);       
    border: none;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.16);
    color: #fff;
    cursor: pointer;
    
    /* 初始狀態：滾動前隱藏 */
    visibility: hidden;         
    opacity: 0;                
    transform: translateY(20px) scale(0.8); 
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    pointer-events: auto; /* 允許點擊 */
  }

  /* 往下滑超過指定距離後：平滑顯現 */
  .fab-trigger.fab--visible {
    visibility: visible;       
    opacity: 1;                
    transform: translateY(0) scale(1); 
  }

  /* 當面板展開時，主按鈕完全消失且不可點擊 */
  .contact-fab.is-open .fab-trigger {
    visibility: hidden;
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none !important; /* 修正：徹底防禦誤觸 */
  }

  .fab-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
  }
  
  .fab-trigger svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  /* ── 3. 展開狀態面板 (順序：關閉 × ➔ 電話 ➔ LINE) ── */
  .fab-panel {
    position: absolute; /* 修正：定點在底部往上生長 */
    bottom: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    
    /* 初始狀態隱藏 */
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px) scale(.95);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    pointer-events: none; /* 隱藏時不可點擊 */
  }

  /* 修正：配合 JS 點擊事件，當外層 .is-open 時啟動面板點擊 */
  .contact-fab.is-open .fab-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto; /* 核心修正：展開時允許點擊 LINE 和電話 */
  }

  /* ── 4. 各圓形按鈕共用樣式 ── */
  .fab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
    pointer-events: auto !important; /* 強制按鈕可點擊 */
  }
  
  .fab-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
  }
  
  /* 修正：禁止 SVG 內部攔截手指觸控，點擊事件全權交由外層 <a> 標籤處理 */
  .fab-btn svg {
    width: 30px;
    height: 30px;
    pointer-events: none; 
  }

  /* ── 5. 關閉 (×) 按鈕 ── */
  .fab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 49px;
    height: 49px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    color: #333333;
    transition: background .15s, transform .15s;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    pointer-events: auto;
  }
  
  .fab-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
  }
  
  .fab-close svg {
    width: 26px;          /* 修正：內部圖示放大到 26px (原本是 16px) */
    height: 26px;         /* 修正：內部圖示放大到 26px */
    stroke-width: 2.5;    /* 保持線條粗細，確保清晰度 */
    pointer-events: none;
  }


}


@media (max-width: 640px) {
  .container      { padding: 10px 10px 0;}
  .navbar__inner  { padding: 0 20px;}
  .footer__grid   { 
    grid-template-columns: 1fr; 
    gap: 36px; 
    padding: 0 15px 30px; 
    display: grid; 
    text-align: center; 
    justify-content: center; 
    margin: 0 0 20px;
  }
  .footer         { padding: 20px 15px 20px; }
  .footer__bottom { flex-direction: column; gap: 8px; text-align: center; }
  .footer__social-row{
    justify-items: center;
  }
  .footer__social-links-container{justify-content: center;}

  .facebook-2 {
    width: 100% !important; /* 手機版填滿容器 */
    max-width: calc(100vw - 40px); /* 扣除邊距，確保圓角不貼邊 */
    margin: 0 auto;
  }

  .facebook-wrapper{
    justify-content: center;
  }


}