/* ==========================================================
   小北咖啡 Xiaobei Coffee — 全站共用樣式
   ========================================================== */
:root {
  /* 配色 */
  --color-primary: #6f4e37;        /* 咖啡棕 */
  --color-primary-dark: #4a3324;
  --color-accent: #c8a165;         /* 焦糖金 */
  --color-accent-soft: #f1e3cc;
  --color-bg: #faf6f0;             /* 奶油白 */
  --color-surface: #ffffff;
  --color-text: #2e241d;
  --color-muted: #7a6a5d;
  --color-border: #e6dccf;
  --color-dark: #241a14;

  /* 字體 */
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", Georgia, serif;

  /* 字級階層 */
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-h3: clamp(1.15rem, 1rem + .5vw, 1.35rem);
  --fs-h2: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem);
  --fs-h1: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);

  /* 間距與版面 */
  --container: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 6rem);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(46, 36, 29, .08);
  --header-h: 4.25rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.3; margin: 0 0 .6em; color: var(--color-dark); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: .5rem;
  background: var(--color-primary); color: #fff; padding: .5em 1em; border-radius: var(--radius-sm); z-index: 200;
}
.skip-link:focus { left: .5rem; color: #fff; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--alt { background: var(--color-surface); }
.section--dark { background: var(--color-dark); color: #eadfd2; }
.section--dark h2, .section--dark h3 { color: #fff; }

.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2rem, 5vw, 3rem); }
.section-head p { color: var(--color-muted); margin: 0; }
.section--dark .section-head p { color: #cbbcaa; }
.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: .5em;
}

.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.split {
  display: grid;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse > :first-child { order: 2; }
}
.split__media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.6em;
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn--accent { background: var(--color-accent); color: var(--color-dark); }
.btn--accent:hover { background: #b58c4f; color: var(--color-dark); }
.btn--outline { border-color: currentColor; color: var(--color-primary); background: transparent; }
.btn--outline:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn--light { border-color: #fff; color: #fff; background: transparent; }
.btn--light:hover { background: #fff; color: var(--color-dark); }
.btn-group { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 240, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.logo {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; color: var(--color-dark);
}
.logo:hover { color: var(--color-primary); }
.logo__mark {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--color-primary); color: #fff; font-size: 1rem;
}
.nav-toggle {
  display: none;
  background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--color-dark);
}
.nav-toggle__bar { display: block; width: 1.5rem; height: 2px; background: currentColor; margin: 5px 0; transition: transform .25s, opacity .25s; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); }
.site-nav a { color: var(--color-text); font-weight: 500; padding-block: .35em; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--color-primary); border-bottom-color: var(--color-accent); }
.site-nav .btn { padding: .5em 1.2em; border-bottom: 2px solid transparent; color: #fff; }
.site-nav .btn:hover { color: #fff; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; inset: var(--header-h) 0 auto 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    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.25rem; }
  .site-nav li a { display: block; padding: .8em 0; border-bottom: 1px solid var(--color-border); }
  .site-nav li:last-child a { margin-top: 1rem; text-align: center; border-bottom: 2px solid transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero (首頁) ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 46rem);
  display: flex; align-items: center;
  color: #fff;
  background: var(--color-dark) url("../images/hero-bg.svg") center / cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(36, 26, 20, .85) 0%, rgba(36, 26, 20, .55) 55%, rgba(36, 26, 20, .25) 100%);
}
.hero .container { padding-block: clamp(4rem, 10vw, 7rem); }
.hero__content { max-width: 36rem; }
.hero h1 { color: #fff; }
.hero p { font-size: var(--fs-lg); color: #eadfd2; margin-bottom: 1.75rem; }
.hero .eyebrow { color: var(--color-accent); }

/* ---------- Page hero (內頁) ---------- */
.page-hero {
  position: relative;
  background: var(--color-primary-dark) url("../images/about-shop.svg") center / cover no-repeat;
  color: #fff; text-align: center;
  isolation: isolate;
}
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(36, 26, 20, .7); }
.page-hero .container { padding-block: clamp(3.5rem, 9vw, 6rem); }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #eadfd2; margin: 0 auto; max-width: 36rem; }
.breadcrumb { font-size: var(--fs-sm); margin-bottom: 1rem; color: #cbbcaa; }
.breadcrumb a { color: var(--color-accent); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .25s;
}
.card:hover { transform: translateY(-4px); }
.card__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card__body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card__body h3 { margin: 0; }
.card__body p { color: var(--color-muted); margin: 0; font-size: var(--fs-sm); }
.card__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.price { color: var(--color-primary); font-weight: 700; white-space: nowrap; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .2em .7em; border-radius: 999px;
  background: var(--color-accent-soft); color: var(--color-primary-dark);
  align-self: flex-start;
}

/* 特色 */
.feature { text-align: center; padding: 1.75rem 1.25rem; }
.feature__icon {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-primary); font-size: 1.5rem;
}
.feature p { color: var(--color-muted); margin: 0; }
.section--dark .feature p { color: #cbbcaa; }

/* ---------- Menu list (菜單頁) ---------- */
.menu-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 2.5rem; }
.menu-tabs a {
  padding: .5em 1.3em; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); font-weight: 500;
}
.menu-tabs a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.menu-category { scroll-margin-top: calc(var(--header-h) + 1rem); }
.menu-category + .menu-category { margin-top: clamp(2.5rem, 6vw, 4rem); }
.menu-list { list-style: none; display: grid; gap: 0 clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.menu-item { padding-block: 1rem; border-bottom: 1px dashed var(--color-border); }
.menu-item__head { display: flex; align-items: baseline; gap: .75rem; }
.menu-item__name { font-weight: 700; font-size: var(--fs-lg); color: var(--color-dark); }
.menu-item__dots { flex: 1; border-bottom: 1px dotted var(--color-muted); transform: translateY(-.3em); min-width: 1rem; }
.menu-item__desc { color: var(--color-muted); font-size: var(--fs-sm); margin: .2rem 0 0; }

/* ---------- Testimonials ---------- */
.quote {
  background: var(--color-surface); border-radius: var(--radius); padding: 1.75rem;
  border: 1px solid var(--color-border); box-shadow: var(--shadow); margin: 0;
}
.quote p { font-family: var(--font-serif); font-size: var(--fs-lg); }
.quote footer { color: var(--color-muted); font-size: var(--fs-sm); }
.stars { color: var(--color-accent); letter-spacing: .1em; }

/* ---------- Info / hours ---------- */
.info-list { list-style: none; display: grid; gap: .9rem; }
.info-list li { display: flex; gap: .75rem; align-items: flex-start; }
.info-list strong { min-width: 4.5rem; color: var(--color-dark); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: .7em 0; border-bottom: 1px solid var(--color-border); }
.hours-table td { text-align: right; color: var(--color-muted); }
.map-embed {
  width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--color-accent-soft);
}

/* ---------- Timeline (關於) ---------- */
.timeline { list-style: none; border-left: 3px solid var(--color-accent); padding-left: 1.5rem; display: grid; gap: 1.75rem; max-width: 44rem; margin-inline: auto; }
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 9px); top: .45em;
  width: 15px; height: 15px; border-radius: 50%; background: var(--color-primary); border: 3px solid var(--color-bg);
}
.timeline__year { font-weight: 700; color: var(--color-primary); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.form label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: var(--fs-sm); }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; color: inherit;
  padding: .75em 1em; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface);
}
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--color-accent); border-color: var(--color-accent); }
.form-note { font-size: var(--fs-sm); color: var(--color-muted); margin: 0; }
.form-status { font-weight: 700; color: var(--color-primary); margin: 0; }
.form .btn { justify-self: start; }

/* ---------- FAQ (details) ---------- */
details {
  max-width: 48rem; margin-inline: auto;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 0 1.25rem;
}
details + details { margin-top: .75rem; }
summary {
  cursor: pointer; font-weight: 700; padding-block: 1rem; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; color: var(--color-dark);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--color-accent); font-size: 1.25rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details > :not(summary) { color: var(--color-muted); padding-bottom: 1rem; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--color-primary); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #f1e3cc; max-width: 36rem; margin: 0 auto 1.75rem; }
.cta-band .btn-group { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: #cbbcaa; padding-top: clamp(3rem, 7vw, 4.5rem); font-size: var(--fs-sm); }
.site-footer a { color: #eadfd2; }
.site-footer a:hover { color: var(--color-accent); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-footer h2 { font-size: 1.05rem; color: #fff; margin-bottom: .8em; }
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; display: grid; gap: .45rem; }
.site-footer .logo { color: #fff; margin-bottom: .75rem; }
.footer-bottom {
  margin-top: 2.5rem; padding-block: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: center; color: #9b8a7a;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
