/* =========================================================
   古今車用中｜景觀志工餐廳 — 網站樣式
   依照原 WordPress（Astra + Elementor）網站的配色與版面：
   米白底、白色頁首、Merriweather 標題、Open Sans 內文、
   綠色按鈕、黑色頁尾。
   ========================================================= */

:root {
  --bg: #f8f6f3;          /* 頁面底色（原站） */
  --white: #ffffff;
  --text: #333333;        /* 內文 */
  --heading: #111111;     /* 標題 */
  --muted: #777777;
  --green: #6a9739;       /* 按鈕、副標、選單目前頁 */
  --green-light: #8bc34a; /* 回到頂端、手機選單按鈕 */
  --title-green: #7aa444; /* 首頁商品名稱 */
  --footer: #111111;
  --line: #e5e1da;

  --font-heading: "Merriweather", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "Open Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: #557a2c; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--green); color: #fff; padding: 0.5rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* 圖片缺漏時的替代畫面 */
.media { position: relative; background: #ece9e3; overflow: hidden; }
.media > img { width: 100%; height: 100%; object-fit: cover; }
img.img-missing { opacity: 0; }
.media.is-missing::after {
  content: attr(data-label);
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 0.5rem; text-align: center; color: #999; font-size: 0.9rem;
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 5px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #5a8230; border-color: #5a8230; color: #fff; }
.btn--small { padding: 10px 26px; font-size: 15px; text-transform: uppercase; }

/* ---------- 頁首 ---------- */
.site-header { background: var(--white); }
.header-inner {
  display: flex; align-items: center; gap: 30px;
  padding: 20px 40px;
  min-height: 160px;
}
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  flex: none;
}
.brand img {
  width: 120px; height: auto;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.brand img.img-missing { display: none; }
.site-title { font-family: var(--font-heading); font-size: 13px; font-weight: 700; color: var(--text); }

.main-nav ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 0 20px; line-height: 60px;
  color: var(--text); text-decoration: none;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--green); }

.menu-toggle {
  display: none;
  margin-left: auto;
  padding: 8px 12px;
  border: 0; border-radius: 2px;
  background: var(--green-light); color: #fff;
  font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; vertical-align: -4px; }

@media (max-width: 921px) {
  .header-inner { flex-wrap: wrap; min-height: 0; padding: 14px 20px; gap: 0; }
  .brand img { width: 72px; border-radius: 10px; }
  .site-title { font-size: 12px; }
  .menu-toggle { display: inline-block; }
  .main-nav { display: none; width: 100%; margin-top: 12px; border-top: 1px solid var(--line); }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 0 4px; line-height: 50px; border-bottom: 1px solid var(--line); }
}

/* ---------- 首頁 ---------- */
.home-banner { margin-top: 30px; }
.home-banner img { width: 100%; height: auto; }
.home-banner img.img-missing { display: none; }

.section { padding: 40px 20px; }
.section-title { font-size: 34px; text-align: center; margin-bottom: 0.4em; }
.section-sub { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--green); text-align: center; margin: 0 0 20px; }
@media (max-width: 767px) {
  .section-title { font-size: 26px; }
  .section-sub { font-size: 18px; }
}

/* 餐廳簡介／品牌故事 */
.story {
  max-width: 1300px; margin: 0 auto;
  display: grid; grid-template-columns: 58% 1fr; gap: 30px; align-items: center;
}
.story-photo img { width: 100%; height: auto; }
.story-text { font-size: 15px; }
.story-text p { margin-bottom: 1.5em; }
.story-btn { text-align: center; }
@media (max-width: 921px) { .story { grid-template-columns: 1fr; } }

/* 影片 */
.video { max-width: 830px; margin: 0 auto; aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 首頁手作美食（每頁 3 項） */
.featured { max-width: 1000px; margin: 0 auto; }
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.featured-card { text-align: center; }
.featured-card .media { aspect-ratio: 4 / 3; margin-bottom: 14px; }
.featured-card h3 { font-size: 18px; margin-bottom: 12px; }
.featured-card h3 a { color: var(--title-green); text-decoration: none; }
.featured-card h3 a:hover { color: var(--green); }
.pager { display: flex; justify-content: center; gap: 4px; margin-top: 28px; font-size: 14px; }
.pager button {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  font: inherit; color: var(--green);
}
.pager button[aria-current="page"] { color: var(--text); cursor: default; }
.pager .pager-next { margin-left: 16px; }
@media (max-width: 767px) { .featured-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }

/* 圖片橫幅（原站：暗色遮罩＋白字） */
.band {
  position: relative;
  height: 430px;
  display: grid; place-items: center;
  color: #fff; text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.band > img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.45); }
.band p { margin: 0; font-size: 18px; letter-spacing: 0.1em; line-height: 1.6; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
@media (max-width: 767px) { .band { height: 300px; } }

/* 聯絡資訊＋地圖 */
.contact-block {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center;
}
.contact-card { text-align: center; font-size: 15px; line-height: 1.6; }
.contact-card img { width: 200px; margin: 0 auto 10px; }
.contact-card img.img-missing { display: none; }
.contact-card .name { margin-bottom: 1.4em; }
.contact-card a { color: var(--text); text-decoration: none; }
.map { height: 285px; background: #ece9e3; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 767px) { .contact-block { grid-template-columns: 1fr; } }

/* ---------- 內頁 ---------- */
.page { max-width: 840px; margin: 30px auto 60px; padding: 0 20px; }
.page-title { font-size: 28px; text-align: center; margin-bottom: 20px; }
.page-card { background: var(--white); padding: 30px; }
@media (max-width: 767px) { .page-card { padding: 20px 16px; } }

/* 菜單圖片頁 */
.menu-image { max-width: 600px; margin: 0 auto; }
.menu-image a { display: block; }
.menu-image .media { min-height: 300px; background: none; }
.menu-image .media > img { height: auto; }

/* 餐廳志工 */
.team-photo { margin-bottom: 30px; }
.vol-heading { font-size: 24px; margin-top: 10px; }
.vol-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 30px; }
.vol-cols .stars { margin: 14px 0 4px; letter-spacing: 2px; }
.vol-cols .small { font-size: 14px; }
.quality-head { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.quality-head img { width: 130px; flex: none; }
.quality-head img.img-missing { display: none; }
.quality-head p { margin: 0; text-align: center; font-size: 14px; }
.cat-lines { list-style: none; margin: 0 0 24px; padding: 0; text-align: center; }
.cat-lines li { font-size: 20px; line-height: 2; }
.cat-lines a { color: var(--text); text-decoration: none; margin: 0 0.6em; }
.cat-lines a:hover { color: var(--green); }
.center { text-align: center; }
@media (max-width: 767px) { .vol-cols { grid-template-columns: 1fr; } }

/* 手作美食（分類側欄＋商品格） */
.shop { max-width: 1000px; margin: 30px auto 60px; padding: 0 20px; display: grid; grid-template-columns: 230px 1fr; gap: 30px; }
.shop-side h2 { font-size: 15px; margin-bottom: 0.4em; }
.shop-side ul { margin: 0; padding-left: 1.3em; font-size: 14px; line-height: 1.9; }
.shop-side a { text-decoration: none; }
.shop-side a[aria-current="true"] { color: var(--heading); font-weight: 700; }
.shop-side .count { color: var(--text); margin-left: 0.3em; }
.shop-side .show-all { display: inline-block; margin-top: 10px; font-size: 14px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 20px; align-content: start; }
.shop-card a { text-decoration: none; color: inherit; display: block; }
.shop-card .media { aspect-ratio: 1 / 1; margin-bottom: 10px; }
.shop-card .cat { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.shop-card h3 { font-size: 15px; line-height: 1.5; margin: 0; }
.shop-card a:hover h3 { color: var(--green); }
.shop-empty { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 921px) { .shop { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }

/* 單一商品頁 */
.product-main { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-main .media { background: none; }
.product-main .media > img { height: auto; }
.product-info h1 { font-size: 26px; }
.product-info .meta { font-size: 14px; color: var(--muted); }
.product-info .note { color: #a0522d; font-weight: 600; }
.product-info .order { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; }
.product-info .order a { font-weight: 600; }
.related { margin-top: 50px; }
.related h2 { font-size: 22px; margin-bottom: 20px; }
@media (max-width: 767px) { .product-main { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--footer); color: var(--bg); font-size: 14px; }
.footer-inner { max-width: 1000px; margin: 0 auto; padding: 50px 20px 60px; }
.footer-logo { width: 60px; margin-bottom: 18px; }
.footer-logo.img-missing { display: none; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-row p { margin: 0; }
.site-footer a { color: var(--bg); text-decoration: none; }
.site-footer a:hover { color: var(--green-light); }
.footer-fb { display: inline-flex; align-items: center; gap: 6px; }
.footer-fb svg { width: 14px; height: 14px; }

/* 回到頂端 */
.to-top {
  position: fixed; right: 30px; bottom: 30px; z-index: 40;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--green-light); color: #fff;
  text-decoration: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top svg { width: 14px; height: 14px; }
.to-top:hover { color: #fff; background: var(--green); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
.shop-side .show-all[hidden] { display: none; }
