/* ===========================================================
   浪花咖啡 Wave Coffee — 全站共用樣式
   設計系統：色彩變數 / 版面容器 / header・nav / 共用元件 / footer
   全站僅此一份 CSS，所有頁面共用
   =========================================================== */

/* ---------- 1. 設計變數 ---------- */
:root {
  /* 主色：浪花藍綠 */
  --color-primary: #1f6f7a;
  --color-primary-dark: #14535c;
  --color-primary-soft: #e6f0f0;
  /* 輔色：烘焙焦糖金 */
  --color-accent: #c98a4b;
  --color-accent-dark: #a86f36;
  /* 中性 */
  --color-deep: #10262b;          /* 深色底：hero 遮罩 / footer */
  --color-bg: #f8f5ef;            /* 米白背景 */
  --color-surface: #ffffff;
  --color-text: #23302f;
  --color-muted: #6b7b7a;
  --color-line: #e4ded3;

  --font-base: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-head: "Noto Serif TC", "PingFang TC", "Songti TC", serif;

  --radius: 16px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --shadow: 0 14px 40px rgba(16, 38, 43, .12);
  --shadow-sm: 0 4px 16px rgba(16, 38, 43, .08);

  /* 版面：置中容器 + 左右內距，避免內容撞到視窗邊緣 */
  --container: 1140px;
  --container-narrow: 760px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(3.25rem, 7vw, 5.5rem);
  --header-h: 72px;
}

/* ---------- 2. 基礎重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-base);
  font-size: clamp(.97rem, .93rem + .2vw, 1.05rem);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.32; font-weight: 700; }
/* 一致的字級階層 */
h1 { font-size: clamp(1.95rem, 1.4rem + 2.6vw, 3.3rem); }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.35rem); }
h3 { font-size: clamp(1.12rem, 1.02rem + .45vw, 1.35rem); }
h4 { font-size: 1.05rem; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  z-index: 200; background: var(--color-primary); color: #fff;
  padding: .7em 1.4em; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ---------- 3. 版面容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--surface { background: var(--color-surface); }
.section--tint { background: var(--color-primary-soft); }
.section--deep { background: var(--color-deep); color: #f0ece4; }
.section--deep .section-head p,
.section--deep .muted { color: #b9c6c6; }

/* 區塊標題 */
.section-head {
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.section-head--left { margin-inline: 0; text-align: left; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: .6rem;
}
.section--deep .eyebrow { color: var(--color-accent); }
.section-head p { color: var(--color-muted); margin-top: .85rem; }

/* ---------- 4. 按鈕（相對內距，同排尺寸一致） ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  padding: .78em 1.6em;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--accent { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--color-accent-dark); }
.btn--ghost { background: transparent; color: var(--color-primary); border-color: currentColor; }
.btn--ghost:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn--light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.65); backdrop-filter: blur(4px); }
.btn--light:hover { background: #fff; color: var(--color-deep); border-color: #fff; }
.btn--sm { font-size: .9rem; padding: .6em 1.3em; }

/* CTA 群組：同排按鈕大小一致、換行時仍對齊 */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}
.btn-group--center { justify-content: center; }

/* ---------- 5. Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 245, 239, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand__mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
}
.brand__name { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.brand__name small { display: block; font-family: var(--font-base); font-size: .64rem; letter-spacing: .22em; color: var(--color-muted); font-weight: 500; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: currentColor;
  border-radius: 2px; margin-inline: auto; transition: transform .25s, opacity .25s;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.7rem); }
.site-nav a {
  position: relative;
  font-size: .96rem;
  font-weight: 500;
  padding-block: .35em;
  color: var(--color-text);
  transition: color .2s;
}
.site-nav a:hover { color: var(--color-primary); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--color-accent);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--color-primary); font-weight: 700; }
.site-nav .nav-cta a::after { display: none; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(440px, 72vh, 660px);
  color: #fff;
  background: var(--color-deep) center / cover no-repeat;
  isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(16,38,43,.86) 0%, rgba(16,38,43,.66) 48%, rgba(16,38,43,.34) 100%);
}
.hero__inner { padding-block: clamp(3.5rem, 9vw, 6rem); max-width: 640px; }
.hero__title { color: #fff; }
.hero__lead { margin-top: 1.1rem; font-size: clamp(1rem, .95rem + .35vw, 1.15rem); color: #dfe7e6; }
.hero .btn-group { margin-top: 2rem; }

/* 次級頁面標頭（內頁共用） */
.page-hero {
  position: relative;
  color: #fff;
  background: var(--color-primary-dark) center / cover no-repeat;
  isolation: isolate;
  text-align: center;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16,38,43,.78), rgba(16,38,43,.6));
}
.page-hero__inner { padding-block: clamp(3rem, 8vw, 5rem); max-width: 680px; margin-inline: auto; }
.page-hero h1 { color: #fff; }
.page-hero p { margin-top: .9rem; color: #d6e0df; }

/* 麵包屑 */
.breadcrumb { font-size: .85rem; color: var(--color-muted); padding-block: 1rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .45rem; }
.breadcrumb li + li::before { content: "／"; margin-right: .45rem; color: var(--color-line); }
.breadcrumb a:hover { color: var(--color-primary); }

/* ---------- 7. 卡片與格線 ---------- */
.grid { display: grid; gap: clamp(1.1rem, 2.5vw, 1.9rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-primary-soft); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: clamp(1.15rem, 3vw, 1.6rem); display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card__body p { color: var(--color-muted); font-size: .95rem; }
.card__foot { margin-top: auto; padding-top: .4rem; }

.price { font-family: var(--font-head); font-weight: 700; color: var(--color-accent-dark); white-space: nowrap; }

/* 特色小卡（無圖） */
.feature { text-align: center; padding: clamp(1.4rem, 3vw, 2rem); }
.feature__icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.5rem;
}
.section--deep .feature { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
.section--deep .feature__icon { background: rgba(255,255,255,.1); color: var(--color-accent); }
.section--deep .card__body p, .section--deep .feature p { color: #b9c6c6; }

/* ---------- 8. 圖文並列 ---------- */
.media-split {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.media-split__figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-split__figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-split--reverse .media-split__figure { order: 2; }
.media-split__body > * + * { margin-top: 1rem; }
.media-split__body p { color: var(--color-muted); }

/* ---------- 9. 菜單清單 ---------- */
.menu-list { display: grid; gap: .2rem; }
.menu-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1rem;
  padding-block: .95rem;
  border-bottom: 1px dashed var(--color-line);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item__name { font-family: var(--font-head); font-weight: 700; }
.menu-item__name span { display: block; font-family: var(--font-base); font-size: .78rem; letter-spacing: .1em; color: var(--color-muted); font-weight: 400; }
.menu-item__desc { flex: 1 1 240px; font-size: .9rem; color: var(--color-muted); }

/* 標籤 */
.tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .3em .85em;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}
.tag--accent { background: #f7ead9; color: var(--color-accent-dark); }
.tag-row { display: flex; flex-wrap: wrap; gap: .45rem; }

/* ---------- 10. 資訊表 / 統計 ---------- */
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  text-align: left; padding: .85rem .6rem;
  border-bottom: 1px solid var(--color-line); font-size: .95rem;
}
.info-table th { width: 34%; font-weight: 700; color: var(--color-primary-dark); white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 1.2rem; text-align: center; }
.stats__num { font-family: var(--font-head); font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); font-weight: 700; color: var(--color-accent); line-height: 1.1; }
.stats__unit { font-size: .5em; margin-left: .1em; }
.stats__label { font-size: .88rem; color: var(--color-muted); }
.section--deep .stats__label { color: #b9c6c6; }

/* ---------- 11. 表單 ---------- */
.form { display: grid; gap: 1.1rem; }
.form__row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; gap: .4rem; }
.field label { font-size: .9rem; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  padding: .7em .9em;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 122, .16);
}
.field textarea { min-height: 140px; resize: vertical; }
.form__note { font-size: .85rem; color: var(--color-muted); }
.form-status { font-size: .92rem; font-weight: 700; color: var(--color-primary-dark); }

/* ---------- 12. FAQ ---------- */
.faq { display: grid; gap: .8rem; }
.faq details {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
}
.faq summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; color: var(--color-accent); font-weight: 700; flex: none; }
.faq details[open] summary::after { content: "－"; }
.faq details[open] summary { margin-bottom: .6rem; }
.faq p { color: var(--color-muted); font-size: .95rem; }

/* ---------- 13. CTA 帶 ---------- */
.cta-band { background: var(--color-primary); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #d5e6e6; margin-top: .8rem; }
.cta-band .btn-group { margin-top: 1.8rem; }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--color-deep); color: #c3cfcf; padding-block: clamp(2.6rem, 6vw, 4rem) 0; }
.site-footer h4 { color: #fff; margin-bottom: .9rem; font-size: 1rem; }
.site-footer a { transition: color .2s; }
.site-footer a:hover { color: var(--color-accent); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.footer-grid ul { display: grid; gap: .5rem; font-size: .93rem; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__name small { color: #8fa2a2; }
.site-footer .footer-about p { font-size: .92rem; margin-top: 1rem; max-width: 34ch; }
.footer-bottom {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-block: 1.4rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
  justify-content: space-between; align-items: center;
  font-size: .85rem; color: #8fa2a2;
}

/* ---------- 15. 工具類 ---------- */
.muted { color: var(--color-muted); }
.text-center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.mt-lg { margin-top: clamp(2rem, 5vw, 3rem); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* 進場動畫 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 16. RWD ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gutter) 1.2rem;
  }
  .site-nav li { border-bottom: 1px solid var(--color-line); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding-block: .9em; }
  .site-nav a::after { display: none; }
  .site-nav .nav-cta { margin-top: .9rem; }
  .site-nav .nav-cta .btn { width: 100%; }
  .media-split--reverse .media-split__figure { order: 0; }
}

@media (max-width: 560px) {
  .btn-group .btn { width: 100%; }
  .btn-group--auto .btn { width: auto; }
  .hero { min-height: 420px; }
  .info-table th { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
