/* 橫列／RWD 共用 chrome（配色暫沿用破曉，各布景覆寫。）
 * class／id 前綴：hnav／Hnav；html.layout-rwd／layout-hnav 由 JS 依 DOM 掛上。
 * RWD＝所有 @media 斷點與左／右漢堡；橫列＝寬版投影左欄（左漢堡出現即藏橫列）。
 */
/* ---------- 橫列基礎（不依賴斷點；只勾橫列時可整頁左右捲） ---------- */

.hnav-img {
  max-height: 3.25rem;
  max-width: 100%;
  width: auto;
  height: auto;
  vertical-align: middle;
  object-fit: contain;
}

.hnav-mask {
  display: none;
  position: fixed;
  top: 0rem;
  right: 0rem;
  bottom: 0rem;
  left: 0rem;
  background-color: rgba(47, 74, 72, 0.35);
  z-index: 900;
  border: 0rem;
  padding: 0rem;
  margin: 0rem;
  cursor: pointer;
}
html.hnav-open-l .hnav-mask,
html.hnav-open-r .hnav-mask {
  display: block;
}

.hnav-rwd-bar {
  display: none;
}

.hnav-btn-l,
.hnav-btn-r {
  display: none;
  position: absolute;
  top: 0.25rem;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0rem;
  padding: 0.35rem;
  border: 0.0625rem solid #5B9A96;
  border-radius: 0.25rem;
  background-color: #F4F7F5;
  color: #2F4A48;
  cursor: pointer;
  z-index: 1;
}
.hnav-btn-l {
  left: 0.25rem;
}
.hnav-btn-r {
  right: 0.25rem;
}
.hnav-btn-l img,
.hnav-btn-r img {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
}
html.hnav-open-l .hnav-btn-l,
html.hnav-open-r .hnav-btn-r {
  background-color: #2F7A78;
}

#Hnav {
  /* 1～8／三欄皮：與左欄、內容區上緣對齊；第九套由 style.php 在 chrome 後覆寫 margin:0 */
  margin: -2rem 2rem 2.5rem 2rem;
  background-color: #F4F7F5;
  border-bottom: 0.1875rem solid #E8B84A;
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}
.hnav-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}
.hnav-panel {
  display: block;
  flex: 1 1 auto;
  min-width: 0rem;
}
.hnav-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-height: 3.5rem;
}
.hnav-bar-access {
  display: flex;
  align-items: center;
  padding: 0rem 0.5rem 0rem 0.75rem;
  flex: 0 0 auto;
  min-height: 3.5rem;
}
.hnav-list {
  display: flex;
  flex-wrap: nowrap;
  align-content: flex-start;
  list-style: none;
  margin: 0rem;
  padding: 0rem;
  flex: 1 1 auto;
  min-width: 0rem;
}
.hnav-item {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  text-align: center;
  min-width: 0rem;
  max-width: 100%;
  box-sizing: border-box;
}
/* 展開時抬高該格，下拉才能蓋住第二列（勿把第二列往下推） */
.hnav-list > .hnav-item:has(> a[aria-expanded="true"]),
.hnav-list > .hnav-item:focus-within {
  z-index: 50;
}
.hnav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.25rem 0.35rem;
  color: #2F4A48;
  font-size: 1rem;
  text-decoration: none;
  box-sizing: border-box;
}
.hnav-link:link,
.hnav-link:visited {
  color: #2F4A48;
  text-decoration: none;
}
.hnav-link:hover {
  color: #2F7A78;
  text-decoration: none;
  background-color: #E4EDE8;
}
.hnav-item.hnav-current > .hnav-link {
  font-weight: bold;
  border-bottom: 0.1875rem solid #2F7A78;
}
.hnav-caret {
  margin-left: 0.25rem;
  font-size: 0.75rem;
}
/* 橫列圖檔選單：▼ 浮在圖上，圖可占滿格子 */
#Hnav .hnav-list > .hnav-item.hnav-has-img > .hnav-link {
  position: relative;
  padding: 0.2rem 0.2rem;
}
#Hnav .hnav-list > .hnav-item.hnav-has-img > .hnav-link .hnav-img {
  max-width: 100%;
  max-height: 3.25rem;
}
#Hnav .hnav-list > .hnav-item.hnav-has-img > .hnav-link .hnav-caret {
  position: absolute;
  right: -0.1rem;
  /* bottom: 0.1rem; */
  margin: 0rem;
  padding: 0.05rem 0.15rem;
  font-size: 0.65rem;
  line-height: 1;
  color: #2F4A48;
  background-color: rgba(244, 247, 245, 0.9);
  border-radius: 0.125rem;
  pointer-events: none;
}
.hnav-drop {
  position: absolute;
  left: 0rem;
  top: 100%;
  min-width: 100%;
  margin: 0rem;
  padding: 0.25rem 0rem;
  list-style: none;
  text-align: left;
  background-color: #FFFFFF;
  border: 0.0625rem solid #5B9A96;
  z-index: 30;
  /* 浮層：不占文件流，不推移第二列 */
}
.hnav-drop .hnav-link {
  justify-content: flex-start;
  min-height: 2.75rem;
  padding-left: 1rem;
  padding-right: 1rem;
  white-space: nowrap;
}
.hnav-drop .hnav-img {
  display: block;
  margin: 0.25rem 0rem;
  max-height: 3.25rem;
  max-width: 100%;
}

.hnav-more-item {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
}
.hnav-more-item #HnavBtnMore {
  flex: 1 1 auto;
  width: 100%;
  min-width: 2.75rem;
  min-height: 3.5rem;
  margin: 0rem;
  padding: 0rem 0.75rem;
  border: 0rem;
  background-color: transparent;
  color: #2F4A48;
  font-size: 1.25rem;
  cursor: pointer;
}
.hnav-more-item #HnavBtnMore:hover,
html.hnav-open-more .hnav-more-item #HnavBtnMore {
  background-color: #E4EDE8;
  color: #2F7A78;
}

#HnavMore {
  display: none;
  background-color: #FFFFFF;
  border-top: 0.0625rem solid #5B9A96;
  max-height: 24rem;
  overflow: auto;
}
html.hnav-open-more #HnavMore {
  display: block;
}
.hnav-more-list {
  list-style: none;
  margin: 0rem;
  padding: 0.25rem 0rem;
}
.hnav-acc-link,
.hnav-more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.25rem 1rem;
  color: #2F4A48;
  text-decoration: none;
  box-sizing: border-box;
}
.hnav-acc-link:link,
.hnav-acc-link:visited,
.hnav-more-link:link,
.hnav-more-link:visited {
  color: #2F4A48;
  text-decoration: none;
}
.hnav-acc-link:hover,
.hnav-more-link:hover {
  color: #E4EDE8;
  background-color: #2F7A78;
  text-decoration: none;
}
.hnav-acc-icon {
  margin-left: 0.5rem;
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
}
#DivContentRight .hnav-acc-icon {
  display: none;
}
.hnav-acc-sub {
  list-style: none;
  margin: 0rem;
  padding: 0rem 0rem 0.25rem 1.5rem;
}
.hnav-acc-sub .hnav-more-link {
  min-height: 2.75rem;
  padding-left: 1.25rem;
}
.hnav-more-list .hnav-img,
.hnav-acc-sub .hnav-img {
  display: block;
  margin: 0.25rem 0rem;
  max-height: 3.25rem;
  max-width: 100%;
}
/* 最窄態完整手風琴；桌面／中寬不顯示 */
.hnav-flat-list {
  display: none;
  margin: 0rem;
  padding: 0.25rem 0rem;
  list-style: none;
  background-color: #FFFFFF;
}

/* 左欄漢堡抽屜內的手風琴符號 */
#DivMenu .MenuTitle_0 a[role="button"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* RWD：主欄可隨視窗縮窄（只勾橫列時不套用，以免強迫改版寬） */
html.layout-rwd #DivMain {
  width: 100%;
  max-width: 60rem;
  box-sizing: border-box;
}

@media (max-width: 60rem) {
  /* 僅 html.layout-rwd：斷點、左／右漢堡；有橫列時一併藏 #Hnav */
  html.layout-rwd {
    scroll-padding-top: 3.25rem;
  }
  html.layout-rwd #DivMain {
    width: 100%;
    background-image: none;
  }
  html.layout-rwd #DivTitle {
    height: 8rem;
    min-height: 8rem;
    margin-top: 3.25rem;
    background-size: cover;
  }
  html.layout-rwd #DivGuide {
    padding: 1rem 0.6255rem 0rem 0rem;
    float: none;
  }
  html.layout-rwd a.GuideLink,
  html.layout-rwd a.GuideLink:link,
  html.layout-rwd a.GuideLink:visited,
  html.layout-rwd a.GuideLink:hover {
    color: #8b5035;
  }
  html.layout-rwd .WebTitle {
    padding: 0rem 1rem 1rem 3.5rem;
  }
  /* 左漢堡已出現：橫列交由左抽屜，不再顯示 */
  html.layout-rwd.layout-hnav #Hnav {
    display: none !important;
  }
  /* 若尚未藏橫列（理論上與上式同斷點）；保留兩列規則供日後微調斷點差 */
  html.layout-rwd .hnav-list {
    flex-wrap: wrap;
  }
  html.layout-rwd .hnav-item {
    flex: 1 1 8rem;
    min-width: 7rem;
  }
  html.layout-rwd .hnav-rwd-bar {
    display: block;
    position: fixed;
    top: 0rem;
    left: 0rem;
    width: 100%;
    height: 3.25rem;
    z-index: 1200;
    margin: 0rem;
    padding: 0rem;
    box-sizing: border-box;
    border-bottom: 0.0625rem solid rgba(47, 74, 72, 0.25);
    background-color: rgba(244, 247, 245, 0.8);
  }
  html.layout-rwd .hnav-btn-l,
  html.layout-rwd .hnav-btn-r {
    display: block;
  }
  html.layout-rwd.hnav-no-right .hnav-btn-r {
    display: none;
  }
  html.layout-rwd #DivContent,
  html.layout-rwd #DivContentLeft,
  html.layout-rwd #DivContentFrame {
    width: auto;
    float: none;
    margin: 0.625rem 0.75rem;
  }
  html.layout-rwd #DivContent {
    background-color: #FFFFFF;
    padding-bottom: 1rem;
  }
  html.layout-rwd #DivMenu {
    display: block;
    position: fixed;
    left: 0rem;
    top: 3.25rem;
    bottom: 0rem;
    width: 16rem;
    margin: 0rem;
    padding: 0.75rem 0.5rem 1rem 0.5rem;
    overflow: auto;
    background-color: #FFFFFF;
    z-index: 1100;
    visibility: hidden;
    transform: translateX(-110%);
    box-sizing: border-box;
  }
  html.layout-rwd.hnav-open-l #DivMenu {
    visibility: visible;
    transform: translateX(0rem);
  }
  html.layout-rwd #DivMenu .MenuTitle_0 > a,
  html.layout-rwd #DivMenu .MenuSubTitle_0 > a,
  html.layout-rwd #DivContentRight .MenuTitle_2 > a,
  html.layout-rwd #DivContentRight .MenuSubTitle_2 > a {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    vertical-align: middle;
  }
  html.layout-rwd #DivMenu a:focus-visible,
  html.layout-rwd #DivContentRight a:focus-visible {
    outline: 0.1875rem dashed #60a0ff;
    outline-offset: -0.1875rem;
  }
  html.layout-rwd #DivMenu img {
    display: block;
    margin: 0.25rem 0rem;
    max-height: 3.25rem;
    max-width: 100%;
  }
  html.layout-rwd #DivContentRight {
    display: block;
    position: fixed;
    right: 0rem;
    top: 3.25rem;
    bottom: 0rem;
    width: 16rem;
    margin: 0rem;
    padding: 0.75rem 0.5rem 1rem 0.5rem;
    overflow: auto;
    background-color: #f3f4f9;
    z-index: 1100;
    float: none;
    visibility: hidden;
    transform: translateX(110%);
    box-sizing: border-box;
  }
  html.layout-rwd.hnav-open-r #DivContentRight {
    visibility: visible;
    transform: translateX(0rem);
  }
  html.layout-rwd #DivContentRight .hnav-acc-icon {
    display: inline;
  }
  html.layout-rwd #DivContentRight .MenuTitle_2 a[role="button"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  html.layout-rwd .MenuTitle_0,
  html.layout-rwd .MenuSubTitle_0,
  html.layout-rwd .MenuTitle_2,
  html.layout-rwd .MenuSubTitle_2 {
    margin-left: 0.25rem;
    min-height: 2.75rem;
  }
  html.layout-rwd .MenuTitle_0,
  html.layout-rwd .MenuTitle_2,
  html.layout-rwd .MenuSubTitle_2 {
    background-position: left 25%;
    background-size: 5%;
  }
  html.layout-rwd #DivBottom {
    height: 6rem;
  }
  /* 頁尾下內距：僅橫列版型（公用九／自訂讀九）；1～8 只開 RWD 不要 */
  html.layout-rwd.layout-hnav #DivBottom {
    padding: 0rem 0rem 2rem 0rem;
  }
  html.layout-rwd #FootAlign {
    text-align: center;
  }
  html.layout-rwd #MarkCreativecommons,
  html.layout-rwd #MarkAccessibility {
    display: none;
  }
}

/* ====== 螢幕寬度低於 36rem：僅 RWD 細調（不再把橫列收成另一顆漢堡） ====== */
@media (max-width: 36rem) {
  html.layout-rwd #DivGuide {
    padding: 0.3rem 1.5rem 0rem 0rem;
  }
  html.layout-rwd #DivTitle {
    background-position: left;
    height: 6.25rem;
  }
  html.layout-rwd #DivContent {
    background-color: #FFFFFF;
  }
  html.layout-rwd #WebOrgLogo {
    width: 3rem;
  }
  html.layout-rwd #WebOrgTitle {
    width: 14rem;
  }
  html.layout-rwd .MenuTitle_0,
  html.layout-rwd .MenuSubTitle_0,
  html.layout-rwd .MenuTitle_2,
  html.layout-rwd .MenuSubTitle_2 {
    background-size: 4%;
  }
  html.layout-rwd .FootBlock {
    padding-top: 1rem;
  }
  html.layout-rwd #MarkCreativecommons,
  html.layout-rwd #MarkAccessibility {
    display: none;
  }
  html.layout-rwd #FootAlign {
    text-align: center;
  }
}
/* ---------- chrome 結束 ---------- */
