@layer theme-custom {
/* --------------------------------------------------
   Logo 尺寸校正（v2）
   來源 PNG：1264x1264，實際圖形佔中央 449x594，
   四周仍有透明留白，且圖形中心比畫布中心偏上約 38px。
   -------------------------------------------------- */

.navbar .navbar-brand{
  position:relative !important;
  display:inline-block !important;
  width:54px !important;
  height:72px !important;
  overflow:hidden !important;
  padding:0 !important;
  line-height:0 !important;
}
.navbar .navbar-brand img{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  transform:translate(calc(-50% + 0.4px), calc(-50% + 4.6px)) !important;
  height:153px !important;
  width:auto !important;
  max-width:none !important;
  max-height:none !important;
}

.logo-img{
  position:relative !important;
  display:inline-block !important;
  width:30px !important;
  height:40px !important;
  overflow:hidden !important;
}
.logo-img img{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  transform:translate(calc(-50% + 0.2px), calc(-50% + 2.6px)) !important;
  height:85px !important;
  width:auto !important;
  max-width:none !important;
  max-height:none !important;
}

/* --------------------------------------------------
   桌機版導覽列：滑鼠移入即展開下拉選單
   主題原本只吃 Bootstrap 的「點擊」觸發，訪客把滑鼠
   移上去不會有任何反應，容易誤以為選單壞掉。
   加一段 hover 展開，點擊行為不受影響。
   -------------------------------------------------- */

@media (min-width:992px){
  nav.navbar li.dropdown:hover > .dropdown-menu{
    display:block !important;
  }
  /* 讓標題與選單之間沒有滑鼠會掉出去的空隙 */
  nav.navbar li.dropdown > .dropdown-menu{
    margin-top:0 !important;
  }
}

/* --------------------------------------------------
   頁尾：整塊統一鐵灰
   自訂頁尾內容本身不帶底色與內距，全部交給這一層。
   -------------------------------------------------- */

footer{
  background:#3A3A3A !important;
  padding:50px 0 20px !important;
}

/* --------------------------------------------------
   若首頁最後一個區塊剛好是「自由編輯區塊」，
   CMS 會把它包在 .html-info 裡（自帶 margin-bottom:24px），
   導致區塊與頁尾之間出現一道白縫。只在這種情況下關掉。
   -------------------------------------------------- */

main > section.index-editor:last-child{
  padding-bottom:0 !important;
}
main > section.index-editor:last-child .html-info{
  margin-bottom:0 !important;
}
}
