/* 全站頁首 H2「圖示＋文字」（sg-head.css）
   owner 11/11 定案：電腦與手機都用 H2；毛玻璃預設 75%／6px、首頁大圖上 32%／2px；電腦版放大 125%。
   來源：頁首實驗室 _tmp/header-lab-20261110/site/header-lab/h2/header.css（設計說明與量測在同資料夾 NOTES.md），
   由實驗室 work/port/import_from_lab.py 轉成正式站用（實驗室的 html 屬性選擇器 → :root；最後一段是正式站的頁面配合改）。
   頁首 HTML 是 tools/partials/sg-head.*.html，跑 tools/sync-header.py 套到全站；不要手改各頁 SG HEAD 區塊。
   頁首的選擇器都以 .sgh--h2 開頭；:root 開頭的是頁首大小倍率與頁面配合（捲動留白、各 kit 的頁首高）。 */

/* ---------------------------------------------------------------- 電腦版大小（owner 11/11「大小放大成125倍」）
   --h2-s：電腦版大小倍率（≥1280 用這個值，預設 1.25）；992～1279 從 1 隨視窗寬平滑變大到 --h2-s（992＝1、1280＝--h2-s）；
     倍率小於 1 時 ≥992 一律用 --h2-s（縮小一定放得下）；≤991 不縮放（手機／平板用各自的固定大小）。
     頁首高 --h2-h 不跟倍率：768 以上 104、767 以下 88（owner 11/12 照 palcall.snowgame.school）。
   --h2-u：放大後的「設計稿 1px」（衍生值，不要直接改）；電腦版的尺寸都寫成 calc(N * var(--h2-u))，線寬（細線、圖示 2px 線、圓框）不放大。
   寫在 :root：頁面配合的 scroll-padding-top、--rs-nav 等也要用；頁首自己也再算一次 --h2-u。
   改大小請改 :root 上的 --h2-s（只改頁首上的，頁首會變、頁面的留白不會跟）。 */
:root, .sgh--h2.sgh { --h2-u: 1px; }
:root { --h2-s: 1.25; }
@media (min-width: 992px) {
  :root, .sgh--h2.sgh {
    --h2-u: calc(1px + min((var(--h2-s) - 1) * 1px, clamp(0px, (100vw - 992px) * (var(--h2-s) - 1) / 288, (var(--h2-s) - 1) * 1px)));
  }
}

.sgh--h2.sgh {
  --h2-ink: #17375a; --h2-text: #3a5167; --h2-blue: #1d6aa8; --h2-blue-2: #14507f;
  --h2-cyan: #4edce9; --h2-cyan-soft: #cdf3f8; --h2-cyan-pale: #dcf6fa;
  --h2-ice: #eaf6fc; --h2-band: #f3fafd; --h2-line: #d2e4ee; --h2-line-2: #b4d3e3;
  --h2-shadow: 0 14px 28px -22px rgba(23, 55, 90, .5);
  --h2-ease: cubic-bezier(.22, 1, .36, 1);
  --h2-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --h2-h: 104px; --h2-art: calc(40 * var(--h2-u)); --h2-art-pad: calc(5 * var(--h2-u));
  /* 電腦版內容欄：1440 以下維持 1120（Logo 左緣對齊頁面內容欄＝課程頁大標題左緣），更寬的螢幕按視窗寬 76% 放寬，
     最多 1120×倍率（1920 寬＝1400，跟整個放大 125% 同比例）；倍率大時至少 860×倍率（內容本身約 800×倍率，留 60 以上的空） */
  --h2-col: clamp(max(1120px, 860 * var(--h2-u)), 76%, 1120 * var(--h2-u));
  /* 透明（毛玻璃）：owner 11/12 第二次用試看預覽的調整面板定的值（定案，不要自己改）
     原話：「頂部列：底色 #C6E9FB／不透明度 75%／模糊 4px／背後色彩加強 150%｜首頁大圖上：不透明度 45%／模糊 3px」
     底色 #C6E9FB＝rgb(198, 233, 251)；其他地方（捲過首頁大圖後、其他所有頁）：不透明度 .75、模糊 4px、saturate(1.5)；
     首頁大圖上：.45、3px（--h2-hero-*，見下面「首頁大圖上」）。
     其他 --h2-glass-* 是衍生值，不要直接改 */
  --h2-glass-a: .75;
  --h2-glass-blur: 4px;
  --h2-hero-a: .45;
  --h2-hero-blur: 3px;
  --h2-glass-bg: rgba(198, 233, 251, var(--h2-glass-a));
  --h2-glass-fx: blur(var(--h2-glass-blur)) saturate(1.5);
  /* 下緣細線（#d2e4ee）：a＝1 時實線，越透明越淡，但至少留 .3 */
  --h2-glass-line: rgba(210, 228, 238, calc(.3 + var(--h2-glass-a) * .7));
  /* 陰影（kit 陰影）：a＝1 時 .5，越透明越淡 */
  --h2-glass-shadow: 0 14px 28px -22px rgba(23, 55, 90, calc(var(--h2-glass-a) * .5));
  /* 滑過：半透明白（a＝1 時全白，a＝0 時 .4） */
  --h2-glass-hover: rgba(255, 255, 255, calc(.4 + var(--h2-glass-a) * .6));
  /* 語言前的細直線：淺色線在透出藍天時會看不到，改用半透明海軍藍（白底上約等於 #d2e4ee，照片上也看得到） */
  --h2-glass-sep: rgba(23, 55, 90, .16);
  position: fixed; inset: 0 0 auto; z-index: 1000;
  display: block; float: none; clear: none; box-sizing: border-box; width: auto; max-width: 100vw; height: var(--h2-h); min-height: 0;
  margin: 0; padding: 0; border: 0; background: none;
  color: var(--h2-ink); font-family: var(--h2-sans); font-size: 16px; font-weight: 400; line-height: 1.2; letter-spacing: normal;
  text-align: left; text-transform: none; text-shadow: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
/* 首頁大圖上（owner 11/11「只有首頁這邊不一樣」）：頁首壓在首頁大圖 section.camera（只有 / 與 /en/ 有）上時用 --h2-hero-*。
   有大圖的頁一載入就是大圖狀態（:has，不等 JS，所以不會先閃一下 .75）；header.js 在大圖下緣捲到頁首下緣以上時加 sgh2--past
   （換回 .75／4px），捲回大圖再拿掉。不支援 :has() 的瀏覽器靠 header.js 加的 sgh2--hero（載入時可能先出現一下 .75）。
   兩條分開寫：同一條裡有瀏覽器看不懂的 :has()，整條都會被丟掉。 */
:root:has(section.camera) .sgh--h2.sgh:not(.sgh2--past) { --h2-glass-a: var(--h2-hero-a); --h2-glass-blur: var(--h2-hero-blur); }
.sgh--h2.sgh.sgh2--hero { --h2-glass-a: var(--h2-hero-a); --h2-glass-blur: var(--h2-hero-blur); }
.sgh--h2.sgh::before, .sgh--h2.sgh::after { content: none; display: none; }
.sgh--h2 *, .sgh--h2 *::before, .sgh--h2 *::after { box-sizing: border-box; }
.sgh--h2 svg { display: block; flex: none; overflow: visible; }

/* ---------------------------------------------------------------- 列：Logo｜圖示選單｜語言｜馬上預定（漢堡只在手機） */
/* 下緣細線與陰影畫在列上：打開的選單從 .navbar 的 100% 開始，不會蓋掉細線；往下捲隱藏時 header.js 把陰影收掉。
   毛玻璃也只在這一層（根元素不加 backdrop-filter／filter／opacity，不然它會變成打開選單 overlay 的定位容器） */
.sgh--h2 .sgh2-bar {
  display: flex; align-items: center; height: 100%; margin: 0;
  padding: 0 max(80px, calc((100% - var(--h2-col)) / 2));   /* G7 B8：下限 80＝課程頁 kit、頁尾的左右留白 */
  border-bottom: 1px solid var(--h2-glass-line); background: var(--h2-glass-bg); box-shadow: var(--h2-glass-shadow);
  -webkit-backdrop-filter: var(--h2-glass-fx); backdrop-filter: var(--h2-glass-fx);
}
.sgh--h2.sgh2-is-up:not(.sgh2-reveal):not(.sgh2-open) .sgh2-bar { box-shadow: none; }
.sgh--h2 .sgh2-brand {
  display: block; flex: none; float: none; margin: 0 auto 0 0; padding: 0; border-radius: 8px; line-height: 0; color: inherit;
}
.sgh--h2 .sgh2-logo { display: block; width: auto; height: calc(64 * var(--h2-u)); max-width: none; margin: 0; padding: 0; border: 0; }

.sgh--h2 .sgh2-menu {
  display: flex; align-items: center; gap: calc(2 * var(--h2-u)); position: relative; float: none; margin: 0; padding: 0; background: none;
}
/* 一個選項：圓形圖示在上、字在下（頁尾 .sgf__tile） */
.sgh--h2 .sgh2-item {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(4 * var(--h2-u));
  float: none; vertical-align: middle; min-width: calc(64 * var(--h2-u)); height: calc(76 * var(--h2-u)); margin: 0;
  padding: calc(4 * var(--h2-u)) calc(8 * var(--h2-u)) calc(6 * var(--h2-u)); border: 0; border-radius: calc(16 * var(--h2-u));
  background: transparent; color: var(--h2-ink); font-family: var(--h2-sans); font-size: calc(16 * var(--h2-u)); font-weight: 700; line-height: 1.25;
  letter-spacing: .04em; text-align: center; text-decoration: none; white-space: nowrap;
}
.sgh--h2 .sgh2-name { display: block; margin-right: -.04em; }
.sgh--h2 .sgh2-art {
  display: grid; place-items: center; flex: none; width: var(--h2-art); height: var(--h2-art); padding: var(--h2-art-pad);
  border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--h2-line-2);
}
.sgh--h2 .sgh2-art svg, .sgh--h2 .sgh2-book__art svg {
  width: 100%; height: 100%; fill: none; stroke: var(--h2-ink); stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round;
}
.sgh--h2 .sgh2-art svg *, .sgh--h2 .sgh2-book__art svg * { vector-effect: non-scaling-stroke; }
/* 目前頁：圓底淡青＋青色內框；字下方一條青色短線（畫在連結自己的 ::after） */
/* owner 11/11：雪場個別頁的「雪場介紹」是目前所在區（aria-current="true"），樣子跟目前頁一樣 */
.sgh--h2 .sgh2-item[aria-current="page"] .sgh2-art, .sgh--h2 .sgh2-item[aria-current="true"] .sgh2-art {
  background: var(--h2-cyan-soft); box-shadow: inset 0 0 0 2px var(--h2-cyan);
}
/* owner 11/11：短底線改海軍藍（青線壓在首頁大圖上只有 1.03～1.2:1；海軍藍在各種底上 ≥ 5.7:1） */
.sgh--h2 .sgh2-item[aria-current="page"]::after, .sgh--h2 .sgh2-item[aria-current="true"]::after {
  content: ""; position: absolute; left: calc(50% - 11 * var(--h2-u)); bottom: var(--h2-u); width: calc(22 * var(--h2-u));
  height: calc(3 * var(--h2-u)); border-radius: calc(3 * var(--h2-u)); background: var(--h2-ink);
}
/* 語言：跟選項同一種樣子，前面一條細直線隔開 */
.sgh--h2 .sgh2-lang { margin-left: calc(13 * var(--h2-u)); }
.sgh--h2 .sgh2-lang::before {
  content: ""; position: absolute; left: calc(-8 * var(--h2-u)); top: calc(18 * var(--h2-u)); bottom: calc(18 * var(--h2-u)); width: 1px;
  background: var(--h2-glass-sep);
}

/* 馬上預定：kit 主藍膠囊，左邊一顆白圓月曆 */
.sgh--h2 .sgh2-book {
  display: inline-flex; align-items: center; gap: calc(9 * var(--h2-u)); flex: none; float: none;
  height: calc(52 * var(--h2-u)); margin: 0 0 0 calc(14 * var(--h2-u)); padding: 0 calc(22 * var(--h2-u)) 0 calc(6 * var(--h2-u));
  border: 0; border-radius: 999px;
  background: var(--h2-blue); color: #fff; font-family: var(--h2-sans); font-size: calc(16 * var(--h2-u)); font-weight: 700; line-height: 1;
  letter-spacing: .06em; text-decoration: none; white-space: nowrap;
}
.sgh--h2 .sgh2-book__art {
  display: grid; place-items: center; flex: none; width: calc(40 * var(--h2-u)); height: calc(40 * var(--h2-u)); padding: calc(5 * var(--h2-u));
  border-radius: 50%; background: #fff;
}

.sgh--h2 .sgh2-bar .sgh2-burger { display: none; }
/* 列上的語言鈕（owner 11/11 晚「語言切換放這邊」）：只有平板 768～991 顯示，其他寬度用選單裡那一個 */
.sgh--h2 .sgh2-bar .sgh2-barlang { display: none; }

/* G7 B7、B9 滑過：只給有滑鼠的裝置（觸控點完不會一直卡在滑過色）；
   滑過時字加底線（照頁尾：1.5px、離字 4px；白底頁上滑過的白底幾乎看不出來），目前頁那格不加（它有青色短線） */
@media (hover: hover) {
  .sgh--h2 .sgh2-item:hover { background: var(--h2-glass-hover); color: var(--h2-ink); }
  .sgh--h2 .sgh2-item:not([aria-current]):hover {
    text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: calc(4 * var(--h2-u));
  }
  .sgh--h2 .sgh2-book:hover { background: var(--h2-blue-2); color: #fff; }
}

/* ---------------------------------------------------------------- ≤991：收成漢堡
   （768–991 一排放「圖示＋字」字要縮到 14px 又擠，所以平板也收起來）
   列上 Logo｜月曆預定鈕｜圓形漢堡；選單＝頁首下面的白卡圖示格（像頁尾 F5；手機中英都一列 3 格、語言是最後一格；平板是直式窄卡、語言在列上） */
@media (max-width: 991px) {
  /* 頁首高：平板跟電腦一樣 104、手機 88 寫在手機那段（owner 11/12 照 palcall.snowgame.school）；平板 Logo 跟電腦一樣大 80（owner 11/12「平板改回這個」），手機另外寫在手機那段 */
  .sgh--h2.sgh { --h2-art: 52px; --h2-art-pad: 7px; }
  .sgh--h2 .sgh2-bar { padding: 0 20px; }
  .sgh--h2 .sgh2-logo { height: 80px; }
  .sgh--h2 .sgh2-book { gap: 8px; height: 48px; margin: 0 10px 0 12px; padding: 0 18px 0 5px; font-size: 16px; letter-spacing: .04em; }
  .sgh--h2 .sgh2-book__art { width: 38px; height: 38px; padding: 4px; }
  /* 漢堡：跟圖示同一種白圓（1.5px 淡藍內框） */
  .sgh--h2 .sgh2-bar .sgh2-burger {
    display: flex; align-items: center; justify-content: center; position: relative; float: none; flex: none;
    width: 48px; height: 48px; margin: 0; padding: 0; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--h2-line-2);
    color: var(--h2-ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .sgh--h2 .sgh2-bar .sgh2-burger.w--open { background: var(--h2-cyan-soft); box-shadow: inset 0 0 0 2px var(--h2-cyan); color: var(--h2-ink); }
  .sgh--h2 .sgh2-burger__box { position: relative; display: block; width: 18px; height: 14px; }
  .sgh--h2 .sgh2-burger__box i { position: absolute; left: 0; width: 18px; height: 2.25px; border-radius: 2px; background: currentColor; }
  .sgh--h2 .sgh2-burger__box i:nth-child(1) { top: 0; }
  .sgh--h2 .sgh2-burger__box i:nth-child(2) { top: 5.875px; }
  .sgh--h2 .sgh2-burger__box i:nth-child(3) { top: 11.75px; }
  .sgh--h2 .sgh2-burger.w--open .sgh2-burger__box i:nth-child(1) { transform: translateY(5.875px) rotate(45deg); }
  .sgh--h2 .sgh2-burger.w--open .sgh2-burger__box i:nth-child(2) { opacity: 0; }
  .sgh--h2 .sgh2-burger.w--open .sgh2-burger__box i:nth-child(3) { transform: translateY(-5.875px) rotate(-45deg); }

  /* 打開的選單：sg-site.js 把 nav 搬進 .w-nav-overlay（頁首下緣起）並加 data-nav-menu-open。白卡（kit 卡片）裡的圖示格；
     平板是靠右的直式窄卡（下面另一段），手機左右各留 10px */
  .sgh--h2 .w-nav-overlay { min-height: calc(100vh - var(--h2-h)); background: rgba(23, 55, 90, .28); }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] {
    display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px 2px; align-items: start;
    position: absolute; top: 0; left: auto; right: 20px; width: 440px; min-width: 0; margin: 8px 0 0; padding: 12px 8px 8px;
    border: 1px solid var(--h2-line); border-radius: 20px; background: #fff; box-shadow: var(--h2-shadow); text-align: center;
    /* G7 B1：視窗很矮時（400% 放大 320×225、手機橫拿 667×300）白卡最多到視窗下緣上 8px，放不下就在白卡裡捲（焦點移過去也會捲到） */
    max-height: calc(100vh - var(--h2-h) - 16px); max-height: calc(100dvh - var(--h2-h) - 16px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item {
    display: flex; grid-column: span 4; width: auto; min-width: 0; height: auto; min-height: 92px; margin: 0; padding: 6px 2px 10px; gap: 6px;
    font-size: 15px; letter-spacing: .04em;
  }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-name { margin-right: -.04em; }
  /* 一列 3 格（中文 6 格＝3＋3；英文 5 格、沒有語言鈕的 404 5 格＝3＋2，第二列兩格置中：第 4 格從第 3 欄起） */
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item:nth-child(4):nth-last-child(2) { grid-column: 3 / span 4; }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item[aria-current="page"]::after,
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item[aria-current="true"]::after { bottom: 3px; }
  /* 語言（owner 11/12「這應該要這樣才對」）：手機是圖示格的最後一格，跟其他格同大小（圓在上、字在下），不再另外一列、上面也沒有細線；
     平板的白卡裡把它藏起來（語言在頁首列上，見平板那段） */
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-lang::before { content: none; }
}

/* ---------------------------------------------------------------- 平板 768～991（owner 11/11 附圖 ref/owner-tablet-menu-20261111.png）
   窄窄一條直式白卡：靠右、接在 × 正下方（右緣對齊 ×＝列的右內距 20），一項一列、圖示在上字在下置中；
   寬度＝最長的字剛好放得下（absolute＋width auto 會縮到內容寬，字 nowrap 不拆行）；語言在最下面、上面細線；矮視窗照 B1 在卡片裡捲 */
@media (min-width: 768px) and (max-width: 991px) {
  .sgh--h2 .sgh2-menu[data-nav-menu-open] {
    display: flex !important; flex-direction: column; align-items: stretch; gap: 2px;
    right: 20px; width: auto; padding: 8px 6px; border-radius: 18px;
  }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item,
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-lang:nth-child(n) {
    flex: none; flex-direction: column; gap: 6px; height: auto; min-height: 0; margin: 0; padding: 8px 12px 11px;
    border-radius: 14px; font-size: 15px;
  }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-lang:nth-child(n) { margin-top: 4px; padding-top: 12px; }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-lang .sgh2-art { width: var(--h2-art); height: var(--h2-art); padding: var(--h2-art-pad); }
}

/* 平板 768～991：語言鈕放在頁首列上「馬上預定」左邊（owner 11/11 晚，ref/owner-tablet-lang-20261111.png；先不做示意圖的白底），
   樣子照電腦版（語言圖示圓在上、字在下），比電腦版小一點（高 64、圓 34；頁首高改 104 後大小不變）；選單白卡裡的語言列（含上面細線）在平板拿掉，同一寬度只看得到一份 */
@media (min-width: 768px) and (max-width: 991px) {
  .sgh--h2 .sgh2-bar .sgh2-barlang {
    display: inline-flex; flex: none; min-width: 52px; height: 64px; margin: 0; padding: 2px 6px 4px; gap: 3px; font-size: 14px;
  }
  .sgh--h2 .sgh2-bar .sgh2-barlang .sgh2-art { width: 34px; height: 34px; padding: 4px; }
  .sgh--h2 .sgh2-menu .sgh2-lang.sgh2-item { display: none !important; }
}

/* ---------------------------------------------------------------- 手機 ≤767（owner 11/12）：頁首高 88（照 palcall.snowgame.school；Logo、按鈕大小不變）；Logo 最多 68 高、
   預約鈕字 15.5px、高 52、月曆圓 36、只顯示「預定」（「馬上」包在 .sgh2-book__pre 裡藏起來）；白卡左右各留 10px */
@media (max-width: 767px) {
  .sgh--h2.sgh { --h2-h: 88px; }
  .sgh--h2 .sgh2-bar { padding: 0 8px 0 10px; }
  /* Logo 最多 68 高（寬 171）；列上放不下時只有 Logo 等比例縮，預約鈕、漢堡不縮 */
  .sgh--h2 .sgh2-brand { flex: 0 1 171px; min-width: 0; }
  .sgh--h2 .sgh2-logo { width: 100%; height: auto; }
  /* 預約鈕：字 15.5px、高 52；中文字框寬 2.2em（owner 調的兩行寫法，「預定」剛好一行） */
  .sgh--h2 .sgh2-book { gap: 6px; height: auto; min-height: 52px; margin: 0 6px; padding: 6px 16px 6px 6px; font-size: 15.5px; }
  .sgh--h2 .sgh2-book__txt:not(:lang(en)) { display: block; width: 2.2em; white-space: normal; word-break: break-all; line-height: 1.15; text-align: left; }
  .sgh--h2 .sgh2-book__pre { display: none; }   /* 手機只顯示「預定」 */
  .sgh--h2 .sgh2-book__art { width: 36px; height: 36px; }
  .sgh--h2 .sgh2-bar .sgh2-burger { width: 44px; height: 44px; }
  .sgh--h2 .sgh2-menu[data-nav-menu-open] { left: 10px; right: 10px; width: auto; }
}
/* 窄手機：預定鈕字距收一點、月曆圓 34、選單圖示圓小一點（列左右內距、預約鈕大小同手機；放不下時只有 Logo 等比例縮） */
@media (max-width: 359px) {
  .sgh--h2 .sgh2-book { letter-spacing: .02em; }
  .sgh--h2 .sgh2-book__art { width: 34px; height: 34px; }
  .sgh--h2.sgh { --h2-art: 48px; --h2-art-pad: 6px; }
}
/* G7 B6 放大 500%（Chrome 最大，256 寬）：漢堡被推出畫面 → 拿掉預定鈕的月曆圓、收內距（字照手機只顯示「預定」；列左右內距同手機 10／8） */
@media (max-width: 299px) {
  .sgh--h2 .sgh2-book { gap: 0; margin: 0 4px; padding: 6px 10px; }
  .sgh--h2 .sgh2-book__art { display: none; }
}
@media (hover: hover) and (max-width: 991px) {
  .sgh--h2 .sgh2-menu[data-nav-menu-open] .sgh2-item:hover { background: var(--h2-band); }
}

/* ================================================================ G7 修正（11/11）
   B3 選單開著時：頁首不隱藏、頁面不捲動（CSS :has() 為主；header.js 也加 sgh2-open／html.sgh2-menu-open，給不支援 :has() 的瀏覽器）。
   B4 往下捲收起後用鍵盤回到頁首：header.js 在焦點進來而頁首藏著時加 sgh2-reveal，焦點離開頁首就拿掉。
      （不用 :focus-within：按 Esc 關選單後焦點留在漢堡，之後用滑鼠往下捲，頁首就一直不收。）
   transform: none !important 蓋過 sg-site.js 寫在行內的 translate3d。兩條分開寫（看不懂 :has() 的瀏覽器會丟掉整條）。 */
.sgh--h2.sgh:has(.w-nav-button.w--open) { transform: none !important; }
.sgh--h2.sgh.sgh2-open, .sgh--h2.sgh.sgh2-reveal { transform: none !important; }
:root:has(.sgh--h2 .w-nav-button.w--open) { overflow: hidden; }
:root.sgh2-menu-open { overflow: hidden; }
/* B5 焦點框：全站藍框（opt.css，3px、外移 2px）外面墊一圈白（到元素外 11px），首頁大圖上也 ≥ 3:1；白底上看不出來 */
.sgh--h2 a:focus-visible, .sgh--h2 [role="button"]:focus-visible { box-shadow: 0 0 0 11px #fff; }
.sgh--h2 .sgh2-book:focus-visible { box-shadow: 0 0 0 13px #fff; }   /* 膠囊兩端是圓的，白圈要再大一點才包得住藍框外側 */
.sgh--h2 .sgh2-bar .sgh2-burger:focus-visible { box-shadow: inset 0 0 0 1.5px var(--h2-line-2), 0 0 0 11px #fff; }
.sgh--h2 .sgh2-bar .sgh2-burger.w--open:focus-visible { box-shadow: inset 0 0 0 2px var(--h2-cyan), 0 0 0 11px #fff; }
/* B2 Windows 高對比（forced-colors）：白圓、內框陰影、底色都會被拿掉，漢堡三條線（currentColor 底）變成跟底一樣的顏色。
   改用系統色：漢堡外框與線（開著時的 × 也是這三條）、目前頁圓框與短線、預定鈕外框 */
@media (forced-colors: active) {
  .sgh--h2 .sgh2-bar .sgh2-burger { border: 2px solid ButtonText; }
  .sgh--h2 .sgh2-burger__box i { background: ButtonText; forced-color-adjust: none; }
  .sgh--h2 .sgh2-item[aria-current="page"] .sgh2-art, .sgh--h2 .sgh2-item[aria-current="true"] .sgh2-art { outline: 2px solid Highlight; outline-offset: -2px; }
  .sgh--h2 .sgh2-item[aria-current="page"]::after, .sgh--h2 .sgh2-item[aria-current="true"]::after { background: Highlight; forced-color-adjust: none; }
  .sgh--h2 .sgh2-book { border: 2px solid ButtonText; }
}

/* ---------------------------------------------------------------- 透明的退路
   不支援 backdrop-filter（只會半透明、不會糊）：底下經過的字會清楚透出來，所以退回接近不透明 .96、實線、白色滑過。
   這裡寫死顏色、不用 --h2-glass-* 衍生值（舊瀏覽器可能不支援 rgba() 裡的 calc()）。 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sgh--h2 .sgh2-bar { background: rgba(198, 233, 251, .96); border-bottom-color: var(--h2-line); box-shadow: var(--h2-shadow); }
  @media (hover: hover) { .sgh--h2 .sgh2-item:hover { background: #fff; } }
  .sgh--h2 .sgh2-lang::before { background: var(--h2-line); }
  /* 首頁大圖上：後面只有照片、沒有會透出來的字，不用 .96；但沒有模糊時照片細節（纜車、樹、山稜）比 3px 模糊時更銳利地壓在字後面，
     所以比大圖上的 .45 再高一點到 .5（照片退一半，仍看得出是透明的大圖）。不支援毛玻璃的瀏覽器多半也不支援 :has()，只寫 JS 的那條。
     底色跟毛玻璃同一個 #C6E9FB（owner 11/12），同一條頂部列在不同瀏覽器顏色一致。 */
  .sgh--h2.sgh.sgh2--hero .sgh2-bar { background: rgba(198, 233, 251, .5); }
}
/* 系統設定「減少透明度」：不透明（owner 11/12 定的頂部列底色 #C6E9FB 實底，跟毛玻璃同一個顏色；
   --h2-band 不改，白卡選單滑過還在用它） */
@media (prefers-reduced-transparency: reduce) {
  .sgh--h2 .sgh2-bar {
    background: #c6e9fb; border-bottom-color: var(--h2-line); box-shadow: var(--h2-shadow);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  @media (hover: hover) { .sgh--h2 .sgh2-item:hover { background: #fff; } }
  .sgh--h2 .sgh2-lang::before { background: var(--h2-line); }
}

/* ---------------------------------------------------------------- 動態：0.3 秒內；要求減少動態時不動 */
@media (prefers-reduced-motion: no-preference) {
  .sgh--h2 .sgh2-item, .sgh--h2 .sgh2-book, .sgh--h2 .sgh2-bar .sgh2-burger { transition: background-color .2s, box-shadow .2s; }
  .sgh--h2 .sgh2-art { transition: background-color .2s, box-shadow .2s, transform .3s var(--h2-ease); }
  @media (hover: hover) { .sgh--h2 .sgh2-item:hover .sgh2-art { transform: translateY(calc(-2 * var(--h2-u))); } }
  .sgh--h2 .sgh2-burger__box i { transition: transform .25s var(--h2-ease), opacity .2s; }
  .sgh--h2 .sgh2-bar { transition: box-shadow .3s; }
  /* 大圖上 ↔ 其他：0.3 秒淡換。header.js 在載入後才加 sgh2-anim，重新整理停在中間（還原捲動位置）那一下直接換、不淡 */
  .sgh--h2.sgh2-anim .sgh2-bar {
    transition: box-shadow .3s, background-color .3s, border-bottom-color .3s, -webkit-backdrop-filter .3s, backdrop-filter .3s;
  }
  .sgh--h2 .w-nav-overlay { animation: sgh2-scrim .3s ease both; }
}
@keyframes sgh2-scrim { from { background-color: rgba(23, 55, 90, 0); } }
@media (prefers-reduced-motion: reduce) {
  .sgh--h2, .sgh--h2 *, .sgh--h2 *::before, .sgh--h2 *::after { transition: none !important; animation: none !important; }
}

/* ================================================================ 頁面配合改（示範；移植時改到各頁 CSS，不屬於頁首）
   1. 鍵盤 Tab 往回走時，焦點不要停在頁首底下：整頁 scroll-padding-top＝頁首高＋8（CHECK-READY focuscover 的修法）。
   2. kit 頁（課程、交通、教練、常見問題）的 --xx-nav 原本是 100／120（舊頁首高），改成新頁首高。
   頁首高 768 以上 104、767 以下 88（owner 11/12 照 palcall.snowgame.school），所以一律 104px、手機段 88px。
   （跳至主要內容：.skip-link 是 z-index 10000，本頁首 z-index 1000（舊頁首 ≤991 是 99999 才蓋住它），不用另外改。） */
:root { scroll-padding-top: calc(104px + 8px); }
:root .rs { --rs-nav: 104px; }
:root .ar { --ar-nav: 104px; }
:root .cr { --cr-nav: 104px; }
:root .qa-v6 { --qa6-nav: 104px; }
@media (max-width: 767px) {
  :root { scroll-padding-top: calc(88px + 8px); }
  :root .rs { --rs-nav: 88px; }
  :root .ar { --ar-nav: 88px; }
  :root .cr { --cr-nav: 88px; }
  :root .qa-v6 { --qa6-nav: 88px; }
}

/* ================================================================ 正式站另外的頁面配合改（實驗室 header.css 之外；由 import_from_lab.py 接在最後）
   原則：每頁頂端跟換頁首前一樣——頁首下緣到第一塊內容的距離不變（不被蓋、也不多出空白）。
   --sgh-nav ＝新頁首高（768 以上 104、767 以下 88；owner 11/12 照 palcall.snowgame.school）
   --sgh-old ＝舊頁首高（≥480 是 120、≤479 是 100）
   --sgh-dy  ＝兩者的差（負數＝新頁首比較矮）；寫死舊頁首高的地方一律「原值 ＋ --sgh-dy」，選擇器、@media、順序照原檔抄。 */
:root { --sgh-nav: 104px; --sgh-old: 120px; --sgh-dy: calc(var(--sgh-nav) - var(--sgh-old)); }
@media (max-width: 767px) {
  :root { --sgh-nav: 88px; }
}
@media (max-width: 479px) {
  :root { --sgh-old: 100px; }
}

/* 1. 捲動落點：實驗室示範的 html { scroll-padding-top } 會跟各頁自己的 scroll-margin-top 疊加
   （實測 /reserve#notice 1440 寬落點從 136 變 244），所以不用；改成「沒有自己設 scroll-margin 的元素」才給頁首高＋8
   （:where() 權重 0，各頁原本的 scroll-margin-top 都比它優先，落點照舊）。 */
:root { scroll-padding-top: auto; }
:where(a[href], button, input, select, textarea, summary, [tabindex], [id]) { scroll-margin-top: calc(var(--sgh-nav) + 8px); }

/* 2. 聯絡頁 C6（contact-kit.css，實驗室盤點之後才上線）的 --ct-nav 原本是 100／120（舊頁首高），跟其他 kit 一樣改成新頁首高。 */
:root .ct { --ct-nav: var(--sgh-nav); }

/* 3. 頁首下面的頂端留白（寫死舊頁首高）：原值 ＋ --sgh-dy */
/* 3a. 雪場 24 頁、招募、退款：.top-bar（snowgame webflow css 611、2410、2876、3538） */
.top-bar { padding-top: calc(200px + var(--sgh-dy)); }
@media screen and (max-width: 991px) {
  .top-bar { padding-top: calc(170px + var(--sgh-dy)); }
}
@media screen and (max-width: 767px) {
  .top-bar { padding-top: calc(150px + var(--sgh-dy)); }
}
@media screen and (max-width: 479px) {
  .top-bar { padding-top: calc(130px + var(--sgh-dy)); }
}
/* 3b. 滑雪指南 /blog、/en/blog：.guide-hero（opt.css 1934、2177）。G7 B10：1440 寬頁首下面的白縫 */
.guide-hero { margin-top: calc(120px + var(--sgh-dy)); }
@media screen and (max-width: 991px) {
  .guide-hero { margin-top: calc(100px + var(--sgh-dy)); }
}
/* 3c. 雪場介紹 /introduction：.intro-hero--h1（intro-hero.css 12、142、146） */
.intro-hero--h1 { padding-top: calc(140px + var(--sgh-dy)); }
@media (min-width: 480px) {
  .intro-hero--h1 { padding-top: calc(160px + var(--sgh-dy)); }
}
@media (min-width: 768px) {
  .intro-hero--h1 { padding-top: calc(136px + var(--sgh-dy)); }
}
/* 3d. 常見問題 /qa：.qa6-hero（qa.css 34、219、252） */
.qa-v6 .qa6-hero { padding-top: calc(128px + var(--sgh-dy)); }
@media (min-width: 480px) {
  .qa-v6 .qa6-hero { padding-top: calc(156px + var(--sgh-dy)); }
}
@media (min-width: 768px) {
  .qa-v6 .qa6-hero { padding-top: calc(176px + var(--sgh-dy)); }
}
/* 3e. 租借 /rental、雪票 /tickets：.ra-hero（rental.css 65、471、735、770） */
.rental-a .ra-hero { padding-top: calc(116px + var(--sgh-dy)); }
@media (min-width: 480px) {
  .rental-a .ra-hero { padding-top: calc(136px + var(--sgh-dy)); }
}
@media (max-width: 767px) {
  .rental-a .ra-hero { padding-top: calc(140px + var(--sgh-dy)); }
}
@media (min-width: 480px) and (max-width: 767px) {
  .rental-a .ra-hero { padding-top: calc(160px + var(--sgh-dy)); }
}

/* 4. 電腦版黏在頁首下面的段落標題 top: 160px（access-kit 469、coaches-kit 466、contact-kit 433、rental 586） */
@media (min-width: 1024px) {
  .ar .ar-guide__in > .ar-head, .cr .cr-guide__in > .cr-head, .ct .ct-guide__in > .ct-head, .rental-a .ra-guide__in > .ra-head { top: calc(160px + var(--sgh-dy)); }
}

/* 5. 錨點落點 scroll-margin-top（rental 31、lesson-prices 2、course-choice 3、site-content 19／90） */
.rental-a a, .rental-a button, .rental-a summary, .ra-end a { scroll-margin-top: calc(140px + var(--sgh-dy)); }
#lesson-prices { scroll-margin-top: calc(136px + var(--sgh-dy)); }
.sg-choice { scroll-margin-top: calc(136px + var(--sgh-dy)); }
.coach-directory { scroll-margin-top: calc(135px + var(--sgh-dy)); }
#season-hours { scroll-margin-top: calc(125px + var(--sgh-dy)); }
