/* ============================================================
   HKOEA — Header / Footer / Nav
   ============================================================ */

/* ---------- 進度條 ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 90;
  pointer-events: none;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dk), var(--gold), var(--gold-lt));
  transform-origin: 0 50%;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line2);
}

.site-header .bar {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0 var(--gutter);
  height: 72px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 34px);
}

/* ---------- Logo ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

/* 圖像版標誌：深色主題顯示金色版，淺色主題顯示原銅色版。
   裁切後比例 446×248（約 1.8:1），以高度約束。 */
.brand__img {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* 預設（深色主題）：金色版可見 */
.brand__img--gold {
  display: block;
}

.brand__img--ink {
  display: none;
}

html[data-theme="light"] .brand__img--gold {
  display: none;
}

html[data-theme="light"] .brand__img--ink {
  display: block;
}

/* 保留舊有文字樣式以防其他位置引用 */
.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__txt {
  display: flex;
  flex-direction: column;
  line-height: 1.06;
}

.brand__name {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
}

/* ---------- 主導航 ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.4vw, 22px);
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 8px 2px;
  font-size: 0.9rem;
  color: var(--ink2);
  transition: color 0.22s var(--ease);
  white-space: nowrap;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.28s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- 右側工具列 ---------- */
.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--ink2);
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease),
    background-color 0.22s var(--ease);
}

.icon-btn:hover {
  color: var(--gold);
  border-color: var(--line);
}

/* ---------- 語言切換 ---------- */
.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--ink2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.lang__btn:hover {
  color: var(--gold);
  border-color: var(--line);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: none;
  z-index: 100;
}

.lang.is-open .lang__menu {
  display: block;
}

.lang__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink2);
  font-size: 0.85rem;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.lang__menu button:hover,
.lang__menu button[aria-current="true"] {
  background: var(--panel2);
  color: var(--gold);
}

/* ---------- 手機選單按鈕 ---------- */
.burger {
  display: none;
}

/* ---------- 手機抽屜 ---------- */
.drawer {
  position: fixed;
  inset: 72px 0 auto 0;
  z-index: 79;
  background: var(--bg);
  border-bottom: 1px solid var(--line2);
  padding: 18px var(--gutter) 28px;
  display: none;
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
}

.drawer.is-open {
  display: block;
}

.drawer a {
  display: block;
  padding: 14px 0;
  font-size: 1.02rem;
  border-bottom: var(--hair);
  color: var(--ink2);
}

.drawer a:last-of-type {
  border-bottom: 0;
}

.drawer .btn {
  width: 100%;
  margin-top: 18px;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: var(--hair);
  background: var(--bg2);
  padding-block: clamp(48px, 6vw, 76px) 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
}

.footer-brand .brand {
  margin-bottom: 16px;
}

.footer-brand .brand__img {
  height: 46px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.footer-col li + li {
  margin-top: 10px;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--ink2);
  transition: color 0.2s var(--ease);
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  margin-top: clamp(36px, 5vw, 60px);
  padding-top: 22px;
  border-top: var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.partner-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--gold);
}

/* ============================================================
   響應式
   ============================================================ */

@media (max-width: 980px) {
  .nav {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .site-header .bar {
    height: 64px;
    gap: 10px;
  }

  .brand__sub {
    display: none;
  }

  .drawer {
    inset: 64px 0 auto 0;
  }

  .tools .btn {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   勞工處職業介紹所牌照展示
   ============================================================ */

.footer-addr {
  margin-top: 14px;
  font-style: normal;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30ch;
}

.licence-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 30px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}

.licence-bar__badge {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--gold);
}

.licence-bar__txt {
  font-size: 0.815rem;
  line-height: 1.5;
  color: var(--ink2);
}

.licence-bar__txt b {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 600;
}

@media (max-width: 560px) {
  .licence-bar {
    align-items: flex-start;
    padding: 13px 15px;
  }
}

/* ============================================================
   分析同意條（GA4 Consent Mode）
   ------------------------------------------------------------
   只在設定 GA_MEASUREMENT_ID 且使用者未表態時由 analytics.js 建立。
   固定於底部，不遮擋主要 CTA；高度約 76px，已預留 safe-area。
   ============================================================ */

.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 12px clamp(14px, 3vw, 28px) calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-top: var(--hair);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transform: translateY(105%);
  opacity: 0;
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
}

.consent.is-on {
  transform: none;
  opacity: 1;
}

.consent__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  flex-wrap: wrap;
}

.consent__text {
  flex: 1 1 340px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink2);
  margin: 0;
}

.consent__acts {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.consent__ok,
.consent__no {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease);
}

.consent__ok {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #0b0b0c;
}

.consent__ok:hover {
  background: var(--gold-lt, #e8c778);
}

.consent__no {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.consent__no:hover {
  color: var(--ink);
  border-color: var(--muted);
}

@media (max-width: 560px) {
  .consent__inner {
    gap: 10px;
  }

  .consent__acts {
    width: 100%;
  }

  .consent__ok,
  .consent__no {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent {
    transition: none;
  }
}
