/* 5-COMPONENTS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--ease-base);
  min-height: 44px; /* 觸控友善 */
}
.btn--primary {
  background: var(--color-brand);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-brand-hover);
  color: #fff;
}
.btn--outline {
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.btn--ink {
  background: var(--color-ink);
  color: #fff;
}
.btn--ink:hover {
  background: var(--color-ink-hover);
  color: #fff;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card__title {
  margin-bottom: var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.field__input,
.field__textarea {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 44px;
}

/* ============================================
   區塊 CTA：pill-btn / section-actions
   首頁與各內頁共用，故置於 components 層（每頁載入）
   ============================================ */
.section-actions {
  text-align: center;
  margin-top: clamp(28px, 3vw, 40px);
}
.section-actions--pair {
  display: flex;
  gap: var(--space-5);
  justify-content: center;
  flex-wrap: wrap;
}
/* 按鈕：白 pill＋棕框＋底部棕色疊層(3D)，右側奶油圓圈+牛皮箭頭 icon */
.pill-btn {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 36px;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1.4px solid var(--color-ink);
  color: #231815;
  font-size: 16px;
  font-weight: var(--fw-medium);
  text-decoration: none;
  box-shadow: 0 3px 0 0 var(--color-ink);
  transition:
    transform var(--ease-base),
    box-shadow var(--ease-base);
}
.pill-btn::after {
  content: "";
  flex-shrink: 0;
  width: 25px;
  height: 23px;
  background: url("../images/home/btn-arrow.svg") center / contain no-repeat;
}
.pill-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 var(--color-ink);
  color: #231815;
}
/* 橘色版：橘框、橘色底部疊層，箭頭換成橘色雙色 icon */
.pill-btn--brand {
  border-color: var(--color-brand);
  box-shadow: 0 3px 0 0 var(--color-brand);
}
.pill-btn--brand::after {
  background: url("../images/home/btn-arrow-orange.svg") center / contain
    no-repeat;
}
.pill-btn--brand:hover {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 var(--color-brand);
  color: var(--color-brand);
}

/* ============================================
   Header 組件
   ============================================ */
.site-header__logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  text-decoration: none;
}
.site-header__logo-zh {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-ink);
  letter-spacing: 0.04em;
}
.site-header__logo-en {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-brand);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.custom-logo-link {
  display: inline-flex;
}
.custom-logo {
  height: 50px;
  width: auto;
}
.site-header__logo img {
  width: auto;
  display: block;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}
.site-nav__list > li {
  display: flex;
  align-items: center;
}
/* 以 ｜ 分隔（對齊設計稿單行選單樣式） */
.site-nav__list > li:not(:last-child)::after {
  content: "｜";
  color: #000;
}
.site-nav__link,
.site-nav__list a {
  display: inline-block;
  padding: 4px 6px;
  color: #000;
  font-weight: var(--fw-normal);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.25rem);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__link:hover,
.site-nav__list a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--color-ink);
  font-weight: 600;
}

/* CTA 膠囊：橘 132×40, radius 20 */
.site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 26px;
  border-radius: 40px;
  background: var(--color-brand);
  color: #fff;
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.25rem);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease-base);
}
.site-header__cta:hover {
  background: var(--color-brand-hover);
  color: #fff;
}

/* 漢堡按鈕 */
.menu-toggle {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 20px;
  height: 20px;
  padding: 3px;
  background: #5a3b1f;
  border: 0;
  cursor: pointer;
}
.menu-toggle__bar {
  display: block;
  width: 8px;
  height: 1px;
  border-radius: 40px;
  background: #fff;
  transition:
    transform var(--ease-base),
    opacity var(--ease-base),
    background var(--ease-base);
}
/* 點擊展開後：透明底 + 1px #5A3B1F 框；橫線改深棕色以利在透明底上辨識 */
.menu-toggle[aria-expanded="true"] {
  background: transparent;
  border: 1px solid #5a3b1f;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar {
  background: #5a3b1f;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Footer 組件
   ============================================ */
/* 前置 CTA：對話氣泡 + 紙盒（Locofy .frame-parent 轉寫、忠實數值） */
/* 氣泡群：問句在上、答句在下，靠右下偏移堆疊出對話感 */
.footer-cta__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: -108px;
}

/* 氣泡共用排版（背景圖各自指定）；浮在右上角紙盒裝飾之上 */
.footer-cta__bubble {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  line-height: var(--lh-base);
  background: no-repeat center / 100% 100%;
}

/* 問句：米色底、棕字、尾巴右下（cta-bubble-a.webp）；對應 Locofy .group-container 360×90 */
/* 文字靠上避開下方尾巴區 */
.footer-cta__bubble--q {
  align-self: flex-start;
  align-items: flex-start;
  width: min(360px, 86vw);
  z-index: 2;
  min-height: 90px;
  margin-bottom: -34px;
  margin-left: -35px;
  padding: 24px 24px 44.5px;
  font-size: var(--fs-lg);
  color: #5a3b1f;
  background-image: url("../images/home/cta-bubble-a.webp");
}

/* 答句：棕底、白字、尾巴左下（cta-bubble-q.webp）；對應 Locofy .group-parent 379×122 */
/* 上移與問句氣泡重疊出對話層次 */
.footer-cta__bubble--a {
  align-self: flex-end;
  width: min(379px, 90vw);
  min-height: 122px;
  margin-left: 105px;
  padding: 27.5px 28px 49.5px;
  line-height: normal;
  font-size: var(--fs-lg);
  color: #fff;
  background-image: url("../images/home/cta-bubble-q.webp");
}

/* 紙盒：對話氣泡群（.footer-cta__dialog）右上角的裝飾圖（對應 Locofy .brown-box-white-1-icon） */
.footer-cta__box {
  position: absolute;
  z-index: 3;
  top: clamp(-20px, -3vw, -16px);
  right: clamp(-42px, -16vw, -120px);
  width: clamp(200px, 22vw, 239px);
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

/* 棕底 LOGO */
.site-footer__logo {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
}
.site-footer__logo img {
  height: 52px;
  width: auto;
  display: block;
}

/* 聯絡資訊 */
.site-footer__contact-col {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.site-footer__contact-row {
  display: flex;
  gap: var(--space-1);
  align-items: baseline;
  font-size: 20px; /* 電腦版聯絡資訊 20px */
}
.site-footer__contact-row dt::after {
  content: "：";
}
.site-footer__contact-row dd {
  margin: 0;
  color: var(--color-text-invert);
}
.site-footer__contact-row a {
  color: var(--color-text-invert);
  text-decoration: none;
}
.site-footer__contact-row a:hover {
  color: var(--color-brand);
}

/* 社群圓 icon */
.site-footer__social {
  list-style: none;
  display: flex;
  gap: var(--space-8);
  padding: 0;
  margin: 0;
}
.site-footer__social a {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform var(--ease-base);
}
.site-footer__social a:hover {
  transform: translateY(-2px);
  color: #fff;
}
.site-footer__social a img {
  width: 100%; /* 社群圖示 16px（圓底維持 48） */
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-footer__copy {
  font-size: 16px; /* 電腦版 copyright 16px */
  text-align: center;
  margin: 0;
  white-space: nowrap; /* 電腦版一行不換行 */
}

/* ≤1024：行動版下拉面板內選單改直式 */
@media (max-width: 1024px) {
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav__list > li:not(:last-child)::after {
    content: none;
  }
  .site-nav__list a,
  .site-nav__link {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
    text-align: center;
  }
  /* 只有右選單（面板最末清單）的最後一項去底線；左選單最後一項保留底線，
     與右選單第一項之間仍有分隔。 */
  .site-nav--right .site-nav__list > li:last-child a,
  .site-nav--right .site-nav__list > li:last-child .site-nav__link {
    border-bottom: 0;
  }
}

/* ≤768：footer 間距收斂、CTA 氣泡置中、紙盒裝飾縮為右上角小角標 */
@media (max-width: 768px) {
  .footer-cta__inner {
    padding-block: var(--space-12) var(--space-8);
    padding-top: 0;
    padding-bottom: 0;
  }
  .footer-cta__dialog {
    margin-top: -37px;
    align-items: center;
  }
  .footer-cta__bubble--q,
  .footer-cta__bubble--a {
    align-self: center;
  }
  .footer-cta__box {
    width: clamp(120px, 30vw, 180px);
  }
  .site-footer__contact {
    gap: var(--space-4) var(--space-8);
  }
}

/* ≤640：手機 header CTA 縮為小圓角橘鈕（radius 10、12px）；footer 依設計稿重排 */
@media (max-width: 640px) {
  /* 區塊 CTA pill-btn 手機尺寸（全站共用，與首頁一致：14px、padding 0 9px 2px） */
  .pill-btn {
    min-height: 0;
    gap: 6px;
    padding: 0 9px 2px;
    font-size: 14px;
  }
  .pill-btn::after {
    width: 16px;
    height: 14px;
  }

  .site-footer {
    padding-top: 0;
  }
  /* header CTA */
  .site-header__cta {
    min-height: 16px;
    padding: 0 10px;
    font-size: 12px;
  }

  .footer-cta__bubble {
    align-items: flex-start;
  }

  /* footer 對話氣泡：縮至滿版寬、文字不貼邊；問句答句字級統一 --fs-xs */
  .footer-cta__bubble--q,
  .footer-cta__bubble--a {
    width: 100%;
    font-size: var(--fs-xs);
    min-height: 49.64px;
    padding: 9.16px 11px;
  }

  .footer-cta__bubble--q {
    margin-left: -50px;
    margin-bottom: -13px;
  }

  .footer-cta__bubble--a {
    min-height: 68px;
    margin-left: 0;
  }
  /* 手機版隱藏角落紙盒裝飾，避免與氣泡爭位 */
  .footer-cta__box {
    top: -3px;
    right: -14.69px;
    filter: none;
  }
  /* 設計稿手機 footer：4 行單欄連續排列、整組置中（內文 13px/22px） */
  .site-footer__inner {
    gap: 20px;
    padding-block: 8px 0;
  }

  .site-footer__logo img {
    height: 24px;
  }
  .site-footer__contact {
    flex-direction: column;
    gap: 16px;
  }
  .site-footer__contact-col {
    gap: 16px;
  }
  .site-footer__contact-row {
    font-size: 13px;
    line-height: 22px;
  }
  /* 社群圓 icon：3 個一排、gap 36、圓底 36 */
  .site-footer__social {
    gap: 12px;
  }
  .site-footer__social a {
    width: 36px;
    height: 36px;
  }

  .site-footer__social a img {
    width: 24px;
    height: 24px;
  }
  /* 白線 + copyright 12px 置中 */
  .site-footer__bottom {
    margin-top: 0;
    padding-top: 16px;
    padding-bottom: 18px;
    max-width: 308px;
  }
  .site-footer__copy {
    font-size: 12px;
    white-space: normal; /* 手機恢復可換行 */
  }
  /* 手機維持兩行堆疊（版權 / 網頁設計） */
  .site-footer__copy-line {
    display: block;
  }

  .menu-toggle__bar {
    display: block;
    width: 10px;
    height: 1px;
    border-radius: 40px;
    background: #fff;
    transition:
      transform var(--ease-base),
      opacity var(--ease-base);
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
    background: #5a3b1f;
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    background: #5a3b1f;
  }
}

/* ============================================
   內頁共用區塊：Hero + 區塊說明 bar
   各內頁共用，只需傳入文字與背景圖；
   數值沿用 Locofy（banner 1920×412 下緣圓角 90px、
   標題 Swei Gothic 60px 白字、白底前言 #41220e、
   米色說明 bar #ffe9ce 內文 700px）。
   原 .cpb-hero / .bxs-hero / .cpb-sec-head__lead /
   .bxs-type__lead 已統一至此。
   ============================================ */

/* ---- 內頁 Hero（page-hero）：背景圖 + 疊放文字 ---- */
.page-hero {
  position: relative;
  min-height: clamp(220px, 21.5vw, 412px);
  background-color: #fff;
}
/* banner 背景圖：絕對鋪滿，下緣圓角 90px。背景圖由 inline --hero-bg 變數帶入。 */
.page-hero__media {
  position: absolute;
  inset: 0;
  border-radius: 0 0 90px 90px;
  background-image: var(--hero-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
/* hero 內容：疊在 banner 上層、置中。
   padding-top 下限容納固定 header，避免標題被蓋住。 */
.page-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 1030px;
  padding-top: clamp(72px, 9vw, 170px);
  padding-bottom: clamp(31px, 5vw, 72px);
  text-align: center;
}
.page-hero__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.page-hero__title {
  margin: 0;
  font-family: "Swei Gothic CJK JP", var(--font-sans);
  font-size: clamp(2rem, 1.5rem, 3.75rem); /* 60px */
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.page-hero__subtitle {
  margin: 0;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); /* 24px */
  font-weight: 500;
  color: #fff;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
/* 白底前言 bar #fff、內文 #41220e 16px */
.page-hero__lead {
  margin: 0;
  width: 100%;
  min-height: 46px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 20px;
  color: #41220e;
}

/* ---- 區塊說明 bar（page-sec-lead）：米色 #ffe9ce、內文 700px ---- */
.page-sec-lead {
  margin: 0;
  width: 800px;
  max-width: 100%;
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 50px;
  box-sizing: border-box;
  background-color: #ffe9ce;
  font-size: 16px;
  line-height: 20px;
  color: #000;
}

/* ---- 分頁 H2 票根標籤膠囊（page-tab）：原稿 Union 票根造型 SVG。
   各頁 H2 共用此樣式；背景票根 SVG 由各頁 inline style 指定（圖檔不同）。
   疊在區塊說明 bar 上緣（margin-bottom 負值）。 ---- */
.page-tab {
  position: relative;
  z-index: 1;
  margin: 0 0 -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 51px;
  padding: 9px 40px;
  /* 背景圖：客製頁用 --tab-bg 變數帶入；其他頁用 inline background-image。
     拆成 longhand，避免簡寫含未定義變數污染 inline 設定。 */
  background-image: var(--tab-bg);
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); /* 24px */
  font-weight: 500;
  color: #5a3b1f;
  box-sizing: border-box;
}
/* 長標題：較寬 padding（搭配較寬的票根 SVG，由 inline style 指定圖） */
.page-tab--wide {
  padding-inline: 52px;
}

/* 電腦版（≥1280）：hero 前言與區塊說明維持單行，框寬依文字自適應 */
/* 電腦版（≥1280）：僅 hero 前言維持單行（框寬依文字自適應）。
   區塊說明 .page-sec-lead 維持固定寬，較長文字自然換行。 */
@media (min-width: 1280px) {
  .page-hero__lead {
    max-width: 1030px;
    white-space: nowrap;
  }
}
/* ≤640：內頁 Hero／說明 bar 依手機設計稿（375 寬）調整 */
@media (max-width: 640px) {
  /* 內頁緊接 Hero 的第一個內容區塊：上方間距收斂為 32px（全站內頁共用） */
  .page-hero + section {
    padding-top: 32px !important;
  }

  /* Hero banner：圓角 30px、整體較矮 */
  .page-hero {
    min-height: 246px;
  }
  .page-hero__media {
    border-radius: 0 0 30px 30px;
    /* 有手機專屬圖則用之，否則 fallback 回桌機 --hero-bg */
    background-image: var(--hero-bg-mobile, var(--hero-bg));
  }
  .page-hero__inner {
    gap: 8px;
    max-width: 300px;
  }
  .page-hero__heading {
    gap: 8px;
  }
  .page-hero__title {
    font-size: 24px;
    line-height: 1.2;
  }
  .page-hero__subtitle {
    font-size: 14px;
  }
  /* 白底前言：13px / 22px、棕字 */
  .page-hero__lead {
    max-width: 300px;
    padding: 11px;
    font-size: 13px;
    line-height: 22px;
  }
  /* 票根標題 H2：13px。全站內頁手機統一改用客製膠囊 SVG（短 130×36）。
     !important 蓋過各頁 inline background-image。 */
  .page-tab {
    min-width: 132px;
    min-height: 0;
    margin: 0 0 -19px;
    padding: 11px 28px;
    font-size: 13px;
    background-image: url("../images/custom-paper-box/intro-card__label-shape-461-5208.svg") !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
  }
  /* 長標題改用寬膠囊 SVG（140×36） */
  .page-tab--wide {
    background-image: url("../images/custom-paper-box/small-batch__tag-shape-461-5533.svg") !important;
  }
  /* 區塊說明 bar：高度自適應、13px / 22px */
  .page-sec-lead {
    width: 100%;
    max-width: 300px;
    min-height: 0;
    padding: 36px 20px 20px;
    font-size: 13px;
    line-height: 22px;
  }
}
