/*

 ② 頁尾:免責句+背書句(連到嘉韻)+隱私權政策 —— 法律字樣 14,是全站唯一低於 18 的中文(設計系統第 4 節)
 ③ 頁尾選單兩欄 ④ 手機頁尾選單點按範圍*/

/*診療項目底下的子頁收在「診療項目」底下
點了往下展開(+ 的直線收掉變 −),再點收起;「診療項目」字照舊是連結(進總覽頁)
所以字跟 + 分開,不是整列一顆按鈕
 一律預設收起(opt2-menu.js 檔尾)。側欄、手機全屏選單同一套。子頁往內縮 24 = 屬於上面那項
 收起來時子頁不佔高度 → 側欄每列照客戶原本的高度(58),1536×740 的筆電「預約健保門診」也看得到(展開時要往下捲)*/
html body :is(.rr-drawer, .hd .mnav) .nav-acc-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
html body :is(.rr-drawer, .hd .mnav) .nav-acc-h > a { flex: 1; border-bottom: 0; }   /* 線畫在整組(.nav-acc)下面 */
html body :is(.rr-drawer, .hd .mnav) .nav-acc-t { flex: none; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer; color: inherit; }
html body :is(.rr-drawer, .hd .mnav) .nav-acc-i { fill: none; stroke: currentColor; stroke-linecap: round; }
html body :is(.rr-drawer, .hd .mnav) .nav-acc-i .v { transform-box: fill-box; transform-origin: center; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
html body :is(.rr-drawer, .hd .mnav) .nav-acc.is-open .nav-acc-i .v { transform: scaleY(0); }
html body :is(.rr-drawer, .hd .mnav) .nav-sub { display: grid; grid-template-rows: 0fr; overflow: hidden; transition: grid-template-rows .35s cubic-bezier(.2, .8, .2, 1); }
html body :is(.rr-drawer, .hd .mnav) .nav-acc.is-open .nav-sub { grid-template-rows: 1fr; }
html body :is(.rr-drawer, .hd .mnav) .nav-sub-in { display: grid; min-height: 0; visibility: hidden; transition: visibility 0s .35s; }   /* 收起來時裡面的連結按 Tab 也跳過 */
html body :is(.rr-drawer, .hd .mnav) .nav-acc.is-open .nav-sub-in { visibility: visible; transition: none; }
@media (prefers-reduced-motion: reduce) { html body :is(.rr-drawer, .hd .mnav) :is(.nav-sub, .nav-sub-in, .nav-acc-i .v) { transition: none; } }
/* 側欄:列高、線色、字色跟客戶 v2.css 的側欄大項一樣;+ 14、線寬 1.5 ≈ 18 號字的筆畫;鈕 40×40,往右推 13 讓 + 的右緣對齊選單右緣 */
html body .rr-drawer nav .nav-acc { border-bottom: 1px solid rgba(80, 81, 80, .15); }
html body .rr-drawer nav .nav-acc .nav-acc-t { width: 40px; height: 40px; margin-right: -13px; color: #3B5348; }   /* 多一層 .nav-acc:上面共用那條(margin 0)比較強,不加會被蓋掉 */
html body .rr-drawer nav .nav-acc-t:hover { color: #96503C; }
html body .rr-drawer nav .nav-acc-i { width: 14px; height: 14px; stroke-width: 1.5; }
html body .rr-drawer nav .nav-sub-in { padding-left: var(--s-5); }   /* 底部留白不能放這層(收起來時內距縮不掉,會多出一條空白)→ 放在最後一個子頁 */
html body .rr-drawer nav .nav-sub a { padding: var(--s-1) 0; border-bottom: 0; line-height: 24px; }   /* 子頁每列 32,大項 58 */
html body .rr-drawer nav .nav-sub a:last-child { padding-bottom: calc(var(--s-1) + var(--s-3)); }
/* 手機全屏選單:大項 24/500,子頁 18(全站最小字)、點按高 27+17 = 44;+ 16、線寬 2 ≈ 24 號 500 字的筆畫;鈕 44×44(點按最小),往右推 14 讓 + 右緣對齊 */
html body .hd .mnav nav .nav-acc { border-bottom: 1px solid var(--ln); }
html body .hd .mnav nav .nav-acc-t { width: 44px; height: 44px; margin-right: -14px; color: var(--c-green-dk); }
html body .hd .mnav nav .nav-acc-t:is(:hover, :focus-visible) { color: var(--c-green); }
html body .hd .mnav nav .nav-acc-i { width: 16px; height: 16px; stroke-width: 2; }
html body .hd .mnav nav .nav-sub-in { padding-left: var(--s-5); }
html body .hd .mnav nav .nav-sub a { padding: 8.5px 0; border-bottom: 0; font-size: var(--t-body); line-height: 1.5; }
html body .hd .mnav nav .nav-sub a:last-child { padding-bottom: calc(8.5px + var(--s-2)); }

html body .ft .ft-law { flex: 1 1 100%; margin: 0; font-size: var(--t-legal); line-height: 1.75; color: rgba(255, 255, 255, .72); }
/* 頁尾最後一排原本是一行(版權+小綠人),多了法律字樣要換行:法律字樣各自一整行在上,版權與小綠人照舊在最下面一行*/
html body .ft .ft-legal { flex-wrap: wrap; row-gap: var(--s-2); }
html body .ft .ft-law a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
html body .ft .ft-law a:is(:hover, :focus-visible) { color: #fff; }

/* ③ 頁尾選單排成兩欄*/
html body .ft .ft-nav nav { grid-template-columns: repeat(2, max-content); grid-template-rows: repeat(5, auto); grid-auto-flow: column; column-gap: var(--s-6); }

/* ④ 手機頁尾選單點按範圍 44(設計系統第 20 節;字不動,內距加大、負外距抵掉) */
@media (max-width: 767px) {
  html body .ft .ft-nav nav a { padding-block: 7.6px; margin-block: -7.6px; }
  html body .ft .ft-law a { display: inline-block; padding-block: 9.75px; margin-block: -9.75px; }   /* 14px 字、行高 24.5 → 44;旁邊幾行沒有別的連結,點按範圍蓋過去不會點錯 */
}

/*照嘉韻:一排大分類,滑過展開底下的頁面;手機平板沒有滑過,點第一下展開、第二下才進那頁 = opt2-menu.js 檔尾)
 大分類英文小字後面一個細線小箭頭 = 這項有下拉;下拉 = 淺米色圓角卡、深綠字、一列 44 高,卡片中線對齊那一項的中線*/
html body .hd .hd-nav .hd-dd { position: relative; display: grid; }
html body .hd .hd-nav small .hd-dd-i { display: inline-block; width: 8px; height: 5px; margin-left: 6px; vertical-align: 2px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
html body .hd .hd-nav .hd-dd-p { position: absolute; top: 100%; left: 50%; z-index: 5; display: grid; min-width: max-content; margin-top: var(--s-4); padding: var(--s-2) 0; border-radius: var(--r-card, 12px); background: #F3EFE6; box-shadow: 0 12px 32px rgba(59, 83, 72, .16);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
html body .hd .hd-nav .hd-dd-p::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--s-4); }   /* 滑鼠從大分類移到卡片中間那段空隙,選單不會收起來 */
html body .hd .hd-nav .hd-dd:is(:hover, :focus-within, .is-open) .hd-dd-p { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }
html body .hd .hd-nav .hd-dd-p a { display: block; padding: 0 var(--s-5); font-size: var(--t-body); line-height: 44px; text-align: left; white-space: nowrap; color: var(--c-green-dk) !important; text-decoration: none; }
html body .hd .hd-nav .hd-dd-p a:is(:hover, :focus-visible) { color: var(--c-green) !important; text-decoration: underline; text-underline-offset: 4px; }
html body .hd .hd-nav .hd-dd-p a[aria-current] { color: var(--c-green) !important; font-weight: 500; }
html body .hd .hd-nav .hd-dd-p a[aria-current]::after { content: none; }
@media (min-width: 1200px) { html body .hd .hd-nav { width: max-content; } }   /* 選單置中是 left 50%,寬度會被限制在畫面一半 → 1200 附近字會被擠成兩行;改成照內容寬 */
/*電腦版不再置中
 改成靠頁首右邊:選單右緣 = 頁首內容右緣(跟左上 logo 的左邊距一樣 56,左右對稱);上下位置照舊*/
@media (min-width: 1200px) {
  html body .hd .hd-in { position: relative; }   /* 選單是浮起來的(position absolute),以頁首內容那條為準 → right 0 = 內容右緣 */
  html body .hd .hd-nav { left: auto; right: 0; transform: none; }
}
/*間距 28 時選單寬 1053:1365 寬以上離左上 logo(右緣 188)至少 68
 1200–1364 寬放不下 → 項目間距收成 12(選單寬 909,1200 寬時離 logo 47、1364 時 211)。漢堡鈕那套全屏選單只做到 1199,不往上延*/
@media (min-width: 1200px) and (max-width: 1364.98px) { html body .hd .hd-nav { gap: var(--s-3); } }
/*字會擠成兩行)→ 901–1199 都跟平板一樣用右上漢堡鈕+全屏選單(樣子照 cards.css 900 以下那段)*/
@media (min-width: 901px) and (max-width: 1199.98px) {
  html body .hd .hd-nav { display: none; }
  html body .hd .mnav { display: block; position: relative; margin-left: auto; }
  html body .hd .mnav summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: var(--btn-h); height: var(--btn-h); min-height: 0; padding: 0; border: 0; border-radius: 8px; background: var(--c-green); transition: background-color .2s; }
  html body .hd .mnav summary::-webkit-details-marker { display: none; }
  html body .hd .mnav summary:hover, html body .hd .mnav[open] summary { background: var(--c-green-dk); }
  html body .hd .mnav .mnav-bars { display: grid; gap: 4px; }
  html body .hd .mnav .mnav-bars i { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .3s, opacity .3s; }
  html body .hd .mnav[open] .mnav-bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  html body .hd .mnav[open] .mnav-bars i:nth-child(2) { opacity: 0; }
  html body .hd .mnav[open] .mnav-bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  html body .hd .mnav nav { top: calc(100% + 8px); }
}
/* 全屏選單一列一列滑上來(cards.css 只排到第 7 個):大分類變 9 項後,下面那組小字和最下面一列順延*/
@media (max-width: 1199px) {
  html body .hd .mnav nav > :nth-child(8) { --i: 7; } html body .hd .mnav nav > :nth-child(9) { --i: 8; }
  html body .hd .mnav nav > :nth-child(10) { --i: 9; } html body .hd .mnav nav > :nth-child(11) { --i: 10; }
}
