/* =========================================================
   Pisco 酒譜平台 — 白底簡潔風格（參考 NYT Cooking）
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-2: #f7f7f5;
  --bg-3: #eeeeec;
  --surface: #ffffff;
  --line: #e6e6e6;
  --line-strong: #cccccc;
  --text: #121212;
  --text-2: #555555;
  --text-3: #8a8a8a;
  --accent: #d0391f;
  --accent-strong: #a92b15;
  --accent-soft: #fbe9e5;
  --navy: #121212;
  --heart: #e0446a;
  --ok: #1f8a5b;
  --danger: #c9363e;
  --radius: 4px;
  --radius-sm: 4px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.45);
  --font-sans: "Libre Franklin", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-caps: "Libre Franklin", "Noto Sans TC", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* ---------- 語言切換（靜態文字） ---------- */
/* 中文介面：標題改用簡約黑體（Noto Sans TC），較細的字重＋寬一點的字距 */
html[lang="zh-Hant"] {
  --font-serif: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
html[lang="zh-Hant"] :is(h1, h2, h3, h4, .feature-title, .feature-item-title) {
  font-weight: 500; letter-spacing: .04em;
}
html[lang="zh-Hant"] :is(.intro h1, .learn-hero h1, .feature-title, .recipe-content h2) {
  font-weight: 500; letter-spacing: .06em;
}
html[lang="zh-Hant"] :is(.by, .card-meta, .recipe-by, .result-count) { font-weight: 300; }
html[lang="zh-Hant"] .intro p.sub, html[lang="zh-Hant"] .learn-hero .sub { font-weight: 300; }

html[lang="en"] .lang-zh { display: none !important; }
html:not([lang="en"]) .lang-en { display: none !important; }

/* 小標（全大寫、字距寬） */
.kicker, .eyebrow {
  font-family: var(--font-caps); font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  margin: 0;
}

/* ---------- 試看版提示條 ---------- */
.demo-bar {
  background: var(--bg-2); color: var(--text-2); border-bottom: 1px solid var(--line);
  font-size: 13px; text-align: center; padding: 8px 16px;
}

/* ---------- 頁首 ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.header-top { display: flex; align-items: center; gap: 20px; padding-top: 26px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.logo { height: 58px; width: auto; }
.brand-text {
  font-family: var(--font-caps); font-weight: 700; font-size: 13px; letter-spacing: .2em;
  color: var(--text-2); padding-left: 16px; border-left: 1px solid var(--line-strong);
  text-transform: uppercase; line-height: 1.4;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  background: none; border: 0; padding: 6px 4px; font-family: var(--font-serif); font-size: 16px; color: var(--text);
}
.lang-toggle:hover { color: var(--accent); text-decoration: underline; }
.header-sep { width: 1px; height: 24px; background: var(--line-strong); }
.main-nav { display: flex; gap: 40px; padding-bottom: 16px; }
.main-nav a {
  font-family: var(--font-caps); font-weight: 700; font-size: 15px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text); text-decoration: none; padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a.active { border-bottom-color: var(--accent); }

@media (max-width: 760px) {
  .header-top { padding-top: 14px; padding-bottom: 8px; gap: 10px; }
  .logo { height: 40px; }
  .brand-text { display: none; }
  .header-actions { gap: 8px; }
  .header-sep { display: none; }
  .main-nav { gap: 24px; padding-bottom: 8px; }
  .main-nav a { font-size: 13px; }
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 2px; padding: 11px 20px; text-decoration: none;
  font-family: var(--font-caps); font-weight: 700; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; line-height: 1.2; transition: background .15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }
@media (max-width: 420px) { .header-actions .btn { padding: 10px 12px; font-size: 12px; letter-spacing: .06em; } }

/* ---------- 標題區 ---------- */
.intro { padding-top: 40px; padding-bottom: 28px; }
.intro h1 {
  margin: 8px 0 6px; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.2; text-wrap: balance;
}
.intro p.sub { margin: 0; color: var(--text-2); font-size: clamp(15px, 1.6vw, 17px); max-width: 40em; }
@media (max-width: 640px) { .intro { padding-top: 24px; padding-bottom: 18px; } }

/* ---------- 最新酒譜（四欄） ---------- */
.featured { background: var(--bg-2); padding: 36px 0 40px; }
.featured .list-head { margin-bottom: 16px; }
.featured-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.feature-item { display: flex; flex-direction: column; gap: 12px; background: none; border: 0; padding: 0; text-align: left; }
.feature-thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-3); }
.feature-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.feature-item:hover img { transform: scale(1.05); }
.feature-text { display: flex; flex-direction: column; gap: 4px; }
.feature-text .kicker { font-size: 11px; letter-spacing: .12em; }
.feature-item-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--text); }
.feature-item:hover .feature-item-title { text-decoration: underline; text-underline-offset: 3px; }
.by { font-family: var(--font-serif); color: var(--text-2); font-size: 15px; }
.feature-text .date { font-size: 13px; color: var(--text-3); }
@media (max-width: 860px) {
  .featured { padding: 24px 0 28px; }
  .featured-list { grid-template-columns: 1fr; gap: 16px; }
  .feature-item { flex-direction: row; gap: 14px; align-items: flex-start; }
  .feature-thumb { flex: 0 0 120px; }
  .feature-item-title { font-size: 17px; }
  .by { font-size: 14px; }
}

/* ---------- 所有酒譜：標題、搜尋、篩選 ---------- */
.recipes { padding-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { font-family: var(--font-serif); font-size: clamp(26px, 3vw, 34px); margin: 6px 0 0; line-height: 1.2; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 0 1 380px;
  border-bottom: 2px solid var(--text); padding: 4px 2px;
}
.search:focus-within { border-bottom-color: var(--accent); }
.search svg { width: 20px; height: 20px; color: var(--text); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 8px 0; font-size: 16px; font-family: var(--font-serif); }
.search input::placeholder { color: var(--text-3); }
.search-top {
  margin-top: 22px; max-width: 640px; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 20px; background: #fff;
}
.search-top:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-top input { padding: 11px 0; font-size: 17px; }
@media (max-width: 640px) { .recipes { padding-top: 32px; } .search-top { margin-top: 16px; } }

.filters { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0 6px; }
.filter-group { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.filter-label {
  flex-shrink: 0; width: 110px; font-family: var(--font-caps); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 999px; padding: 6px 15px; font-size: 14px; white-space: nowrap; transition: all .15s ease;
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 0 8px; }
.chip-fav { display: inline-flex; align-items: center; gap: 6px; }
.chip-fav svg { width: 15px; height: 15px; color: var(--heart); }
.chip-fav[aria-pressed="true"] { background: var(--heart); border-color: var(--heart); color: #fff; }
.chip-fav[aria-pressed="true"] svg { color: #fff; }
.result-count { color: var(--text-3); font-size: 14px; font-family: var(--font-serif); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 14px; padding: 4px; margin-left: auto; text-decoration: underline; }

@media (max-width: 640px) {
  .filter-group { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-label { width: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
}

/* ---------- 酒譜卡片（雜誌風：沒有外框） ---------- */
/* 一排三張；平板兩張；手機兩張 */
.grid { display: grid; gap: 44px 36px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 32px 0 80px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; } }
@media (max-width: 640px) { .grid { gap: 28px 14px; padding-top: 20px; } }
.card { position: relative; cursor: pointer; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-3); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.fav-btn {
  position: absolute; right: 10px; top: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.92); border: 0; color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .15s ease;
}
.fav-btn svg { width: 19px; height: 19px; }
.fav-btn:hover { transform: scale(1.08); }
.fav-btn[aria-pressed="true"] { color: var(--heart); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.fav-btn.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }
.card-body { padding: 14px 0 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 2px 0 0; font-family: var(--font-serif); font-size: 21px; font-weight: 700; line-height: 1.3; }
.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.card-meta { margin: 0; color: var(--text-2); font-size: 15px; font-family: var(--font-serif); }
.card-flavors { margin: 2px 0 0; font-size: 13px; color: var(--accent-strong); }
.card-foot { margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 13px; }
.card-foot span { display: inline-flex; align-items: center; gap: 4px; }
.card-foot svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .card-media { aspect-ratio: 1 / 1; }
  .card .kicker { font-size: 10px; letter-spacing: .1em; }
  .card h3 { font-size: 17px; }
  .card-meta { font-size: 13px; }
  .card-foot { font-size: 12px; flex-wrap: wrap; }
  .fav-btn { width: 34px; height: 34px; right: 8px; top: 8px; }
}
.empty { text-align: center; color: var(--text-2); padding: 60px 0 100px; font-family: var(--font-serif); }

/* ---------- 跳出視窗（共用） ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.modal-panel {
  position: relative; background: var(--bg); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  width: min(1000px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); overflow: hidden; display: flex;
}
dialog[open] .modal-panel { animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.modal-close {
  position: absolute; right: 14px; top: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.95); border: 1px solid var(--line); color: var(--text);
}
.modal-close svg { width: 20px; height: 20px; }

/* 酒譜照片：完整置中顯示不裁切，空白處用同一張照片模糊當背景 */
/* 電腦版：視窗固定高度，照片欄寬度跟著照片比例走，照片剛好塞滿不留邊也不裁切 */
/* 比較寬的照片（例如正方形）把視窗高度調低一點，照片欄不超過 62% 寬也能塞滿 */
.recipe-panel { height: min(760px, calc(100dvh - 48px), calc(min(1000px, 100vw - 48px) * .62 / var(--rn, .8))); }
.recipe-panel .recipe-media { flex: 0 0 auto; height: 100%; aspect-ratio: var(--ratio, 4 / 5); min-width: 32%; max-width: 62%; background: var(--bg-3); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.recipe-panel .recipe-media::before { content: ""; position: absolute; inset: -40px; background: var(--photo) center / cover no-repeat; filter: blur(28px) brightness(.85); }
.recipe-panel .recipe-media img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.recipe-content { flex: 1; overflow-y: auto; padding: 40px 40px 40px; }
.recipe-content h2 { font-family: var(--font-serif); font-size: 34px; line-height: 1.2; margin: 8px 48px 8px 0; }
.recipe-by { color: var(--text-2); margin: 0 0 14px; font-family: var(--font-serif); font-size: 17px; }
.recipe-by strong { color: var(--text); }
.recipe-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--text-3); font-size: 14px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.recipe-stats span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.recipe-stats .fav-inline { white-space: nowrap; flex-shrink: 0; }
.recipe-stats svg { width: 16px; height: 16px; }
.recipe-stats .fav-inline {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 16px; color: var(--text); font-size: 14px;
}
.recipe-stats .fav-inline[aria-pressed="true"] { color: var(--heart); border-color: var(--heart); }
.recipe-stats .fav-inline[aria-pressed="true"] svg { fill: currentColor; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; background: var(--bg-2); margin: 0 0 28px; }
.fact { padding: 12px 16px; }
.fact dt { font-family: var(--font-caps); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.fact dd { margin: 2px 0 0; font-size: 15px; }
.recipe-section h4 { margin: 0 0 10px; font-family: var(--font-caps); font-size: 13px; letter-spacing: .16em; color: var(--accent); font-weight: 700; }
.recipe-section + .recipe-section { margin-top: 28px; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ingredients li span:last-child { font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.method { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.method li { counter-increment: step; position: relative; padding: 0 0 14px 40px; }
.method li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; font-family: var(--font-caps);
}
@media (max-width: 760px) {
  dialog { margin: 0; width: 100%; height: 100%; max-height: 100dvh; }
  .modal-panel { width: 100%; height: 100dvh; max-height: 100dvh; flex-direction: column; overflow-y: auto; }
  .recipe-panel { height: 100dvh; }
  .recipe-panel .recipe-media { flex: none; height: auto; aspect-ratio: auto; min-width: 0; max-width: none; }
  .recipe-panel .recipe-media img { height: auto; max-height: 72dvh; }
  .recipe-content { overflow: visible; padding: 22px 18px 40px; }
  .recipe-content h2 { font-size: 26px; margin-right: 0; }
  .recipe-stats { flex-wrap: wrap; }
}

/* ---------- 投稿表單 ---------- */
.submit-panel { flex-direction: column; width: min(760px, calc(100vw - 48px)); }
.submit-head { padding: 28px 32px 14px; border-bottom: 1px solid var(--line); }
.submit-head h2 { margin: 0; font-family: var(--font-serif); font-size: 28px; }
.submit-head p { margin: 4px 0 6px; color: var(--text-2); font-size: 14px; }
.submit-body { overflow-y: auto; padding: 22px 32px 8px; }
.submit-foot { padding: 14px 32px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; align-items: center; background: #fff; }
.form-section-title { font-family: var(--font-caps); font-size: 12px; letter-spacing: .16em; color: var(--accent); font-weight: 700; margin: 22px 0 10px; text-transform: uppercase; }
.form-section-title:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .label { font-size: 14px; color: var(--text); font-weight: 500; }
.req { color: var(--heart); margin-left: 2px; }
.hint { font-size: 12.5px; color: var(--text-3); }
.type-lock { font-size: 12.5px; color: var(--accent); }
.input, .select, .textarea {
  width: 100%; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 16px; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select:disabled { background-color: var(--bg-2); color: var(--text-2); cursor: not-allowed; opacity: 1; }
.textarea { min-height: 120px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23555555' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field.invalid .input, .field.invalid .select, .field.invalid .textarea, .field.invalid .photo-drop, .field.invalid .check-group { border-color: var(--danger); }
.err { color: var(--danger); font-size: 12.5px; display: none; }
.field.invalid .err { display: block; }
.photo-drop {
  position: relative; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--text-2);
  background: var(--bg-2); overflow: hidden; cursor: pointer;
}
.photo-drop:hover { border-color: var(--accent); }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop svg { width: 34px; height: 34px; color: var(--accent); margin: 0 auto 6px; }
.photo-drop img { width: 100%; max-height: 320px; object-fit: contain; }
.photo-drop.has-img { min-height: 0; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill span { display: inline-block; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; color: var(--text); background: #fff; cursor: pointer; user-select: none; }
.check-pill input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.check-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ing-rows { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 1fr 140px 40px; gap: 8px; }
.ing-row .remove { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); color: var(--text-3); display: grid; place-items: center; }
.ing-row .remove:hover { color: var(--danger); border-color: var(--danger); }
.add-row { align-self: flex-start; margin-top: 4px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-done { text-align: center; padding: 56px 32px 48px; }
.submit-done .done-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: #e2f4ea; color: var(--ok); }
.submit-done .done-icon svg { width: 36px; height: 36px; }
.submit-done h3 { font-family: var(--font-serif); font-size: 26px; margin: 0 0 8px; }
.submit-done p { color: var(--text-2); margin: 0 0 24px; }
@media (max-width: 760px) {
  .submit-panel { width: 100%; }
  .submit-head { padding: 20px 64px 10px 18px; }
  .submit-head h2 { font-size: 23px; }
  .submit-body { padding: 16px 18px 8px; overflow: visible; }
  .submit-foot { position: sticky; bottom: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .submit-foot .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .ing-row { grid-template-columns: 1fr 96px 40px; }
}

/* ---------- 提示訊息 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s ease; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 頁尾（深藍） ---------- */
.site-footer { background: var(--bg-2); color: var(--text-3); border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 13px; }
.footer-inner { display: flex; align-items: center; gap: 28px; }
.footer-logo { height: 92px; width: auto; mix-blend-mode: multiply; flex-shrink: 0; }
.footer-info { flex: 1; min-width: 0; }
.footer-info p { margin: 0; }
.footer-company { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: .06em; }
.footer-company-en { font-family: var(--font-caps); font-size: 13px; color: var(--text-2); letter-spacing: .04em; margin-bottom: 6px !important; }
.footer-note, .footer-copy { font-size: 13px; color: var(--text-3); }
.footer-line { flex-shrink: 0; display: inline-block; line-height: 0; transition: opacity .15s ease; }
.footer-line:hover { opacity: .85; }
.footer-line img { height: 36px; width: auto; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; text-align: center; gap: 16px; }
  .footer-logo { height: 80px; }
}

/* =========================================================
   Pisco 學堂頁
   ========================================================= */
.learn-hero { background: var(--bg-2); padding: 48px 0 40px; }
.learn-hero h1 { font-family: var(--font-serif); font-size: clamp(30px, 4.6vw, 48px); line-height: 1.2; margin: 10px 0 10px; text-wrap: balance; }
.learn-hero .sub { color: var(--text-2); margin: 0; max-width: 40em; font-size: 17px; }
.learn-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 80px; }
.toc { position: sticky; top: 24px; align-self: start; }
.toc .kicker { color: var(--text-3); margin-bottom: 12px; }
.toc a { display: block; color: var(--text-2); padding: 7px 0 7px 14px; border-left: 2px solid var(--line); font-size: 14px; text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.article { max-width: 760px; }
.article section { scroll-margin-top: 20px; padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.article section:last-child { border-bottom: 0; }
.article h2 { font-family: var(--font-serif); font-size: 32px; margin: 0 0 16px; line-height: 1.25; }
.article h3 { font-family: var(--font-caps); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 28px 0 4px; }
.article p, .article li { color: var(--text-2); font-size: 16.5px; }
.article strong { color: var(--text); }
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.info-card { background: var(--bg-2); padding: 20px 22px; border-top: 3px solid var(--accent); }
.info-card h4 { margin: 4px 0 8px; font-family: var(--font-serif); font-size: 21px; color: var(--text); }
.info-card p { margin: 0; font-size: 15px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); margin: 16px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--navy); color: #fff; font-family: var(--font-caps); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.table td { color: var(--text-2); }
.table tr:nth-child(even) td { background: var(--bg-2); }
.table tr:last-child td { border-bottom: 0; }
.draft-note { background: #fff7e6; border-left: 4px solid #e0a43a; color: #6b4a10; padding: 12px 16px; font-size: 14px; margin-bottom: 36px; }
.spec-recipe { background: var(--bg-2); margin: 18px 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.spec-photo { width: 100%; height: 100%; min-height: 260px; object-fit: cover; background: var(--bg-3); }
.spec-body { padding: 22px 26px; }
.spec-body .kicker { display: block; margin-bottom: 4px; }
.spec-recipe h4 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 22px; }
@media (max-width: 640px) {
  .spec-recipe { grid-template-columns: 1fr; }
  .spec-photo { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
  .spec-body { padding: 18px 18px 20px; }
}
.spec-recipe ul { margin: 0; padding-left: 20px; }
@media (max-width: 860px) {
  .learn-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 28px; padding-bottom: 64px; }
  .toc { display: none; }
  .article h2 { font-size: 26px; }
}

/* =========================================================
   質感：色塊、調酒杯線條圖樣、顆粒感
   ========================================================= */
:root {
  --ice: #ffffff;
}

/* 標題區（首頁、學堂）：白底＋極淡的調酒杯線條 */
.block-navy {
  position: relative; isolation: isolate; overflow: hidden; color: var(--text);
  background: #fff; border-bottom: 1px solid var(--line);
}
.block-navy::before {
  content: ""; position: absolute; inset: -12% 0; z-index: -1;
  background: url("../img/glasses-gray.svg") 0 0 / 600px 600px repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 75%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 75%);
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
.block-navy .eyebrow { color: var(--accent); }
.block-navy h1 { color: var(--text); }
.block-navy .sub, .block-navy p.sub { color: var(--text-2); }
.search-top { color: var(--text); }

/* 最新酒譜：白底、上下細線 */
.block-ice { position: relative; background: #fff; border-bottom: 1px solid var(--line); }

/* 標題區間距 */
.intro.block-navy { max-width: none; padding: 56px 0 48px; }
.intro.block-navy > .container { position: relative; }
@media (max-width: 640px) {
  .intro.block-navy { padding: 36px 0 32px; }
  .block-navy::before { -webkit-mask-image: linear-gradient(180deg, transparent 10%, #000 90%); mask-image: linear-gradient(180deg, transparent 10%, #000 90%); opacity: .7; }
}
.learn-hero.block-navy { padding: 56px 0 48px; }

/* 區塊標題下的小色條 */
.section-head h2::after, .article h2::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 12px;
  background: var(--accent);
  transform-origin: left; transition: transform .8s cubic-bezier(.2,.7,.2,1) .2s;
}
.js-motion .reveal:not(.in) h2::after, .js-motion .section-head:not(.in) h2::after { transform: scaleX(0); }

/* 卡片微質感 */
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.18));
}
.info-card, .spec-recipe, .facts { position: relative; }

/* =========================================================
   捲動效果
   ========================================================= */
/* 淡入上移（只在 JS 啟動後才隱藏，確保沒有 JS 也看得到內容） */
.js-motion .reveal {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity .8s ease, transform .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
.js-motion .reveal.in { opacity: 1; transform: none; }

/* 照片由下往上揭開 */
.js-motion .reveal-photo .spec-photo, .js-motion .reveal-photo .feature-thumb {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.1s cubic-bezier(.6,.05,.2,1) calc(var(--d, 0ms) + 100ms);
}
.js-motion .reveal-photo.in .spec-photo, .js-motion .reveal-photo.in .feature-thumb { clip-path: inset(0 0 0 0); }

/* 頁首：往下捲時上半部捲走，只留導覽列黏在頂端（高度不變，不會跳動） */
.site-header { position: sticky; top: calc(-1 * var(--top-h, 0px)); z-index: 60; transition: box-shadow .3s ease; }
.site-header.compact { box-shadow: 0 8px 24px -16px rgba(0,0,0,.5); }
.main-nav { align-items: center; }
.nav-mini { display: none; align-items: center; }
.nav-mini-logo { order: -1; margin-right: -12px; }
.nav-mini-logo img { height: 30px; width: auto; }
.nav-mini-submit { margin-left: auto; gap: 6px; }
/* 黏住導覽列裡的搜尋 */
.mini-search { display: flex; align-items: center; gap: 4px; }
.mini-search-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--text);
  display: grid; place-items: center; flex-shrink: 0;
}
.mini-search-btn:hover { color: var(--accent); }
.mini-search-btn svg { width: 20px; height: 20px; }
.mini-search-input {
  width: 0; opacity: 0; padding: 7px 0; border: 1px solid transparent; border-radius: 999px;
  background: #fff; font-size: 15px; outline: none; transition: width .3s ease, opacity .2s ease, padding .3s ease;
}
.site-header.searching .mini-search-input { width: 240px; opacity: 1; padding: 7px 14px; border-color: var(--line-strong); }
.site-header.searching .mini-search-input:focus { border-color: var(--accent); }
.main-nav a, .nav-mini-submit .btn { white-space: nowrap; }
@media (max-width: 760px) {
  /* 手機上導覽列黏住時：縮小間距、按鈕只留文字，讓一行放得下 */
  .site-header.compact .main-nav { gap: 14px; }
  .site-header.compact .main-nav a { font-size: 12px; letter-spacing: .08em; }
  .site-header.compact .nav-mini-submit .btn svg { display: none; }
  .site-header.compact .nav-mini-submit { gap: 2px; }
  .mini-search-btn { width: 32px; height: 32px; }
}
@media (max-width: 760px) {
  /* 手機上展開搜尋時，暫時把導覽文字和 Logo 收起來，讓搜尋欄夠寬 */
  .site-header.searching .main-nav > a, .site-header.searching .nav-mini-submit .btn { display: none; }
  .site-header.searching .nav-mini-submit { flex: 1; margin-left: 0; }
  .site-header.searching .mini-search { flex: 1; }
  .site-header.searching .mini-search-input { width: auto; flex: 1; min-width: 0; }
}
.main-nav .nav-mini-submit .btn { color: #fff; border-bottom: 0; letter-spacing: .1em; }
.main-nav .nav-mini-submit .btn:hover { color: #fff; }
.main-nav a.nav-mini-logo { padding: 0; border-bottom: 0; }
/* 學堂頁：目錄與段落定位要避開黏住的導覽列 */
.toc { top: 84px; }
.article section { scroll-margin-top: 80px; }
.nav-mini-submit .btn { padding: 8px 14px; font-size: 12px; }
.site-header.compact .nav-mini { display: flex; animation: navMiniIn .3s ease both; }
@keyframes navMiniIn { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 760px) { .nav-mini-logo img { height: 24px; } .nav-mini-submit .btn { padding: 7px 10px; letter-spacing: .04em; } }

/* 頂端閱讀進度條 */
.scroll-progress {
  position: fixed; left: 0; top: 0; z-index: 70; height: 3px; width: 100%;
  background: var(--accent);
  transform-origin: left; transform: scaleX(0); pointer-events: none;
}

/* 回到頂端 */
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 55; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--navy); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: all .3s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent-strong); }
.to-top svg { width: 20px; height: 20px; }

/* 系統設定「減少動態效果」的使用者：關掉所有動畫 */
@media (prefers-reduced-motion: reduce) {
  .js-motion .reveal, .js-motion .reveal-photo .spec-photo, .js-motion .reveal-photo .feature-thumb {
    opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important;
  }
  .block-navy::before { transform: none !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   酒類警語：固定在畫面最下方（依菸酒管理法規定標示）
   ========================================================= */
:root { --warn-h: 38px; }
.alcohol-warning {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
  min-height: var(--warn-h); padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
  background: var(--navy); color: #fff; text-align: center;
  font-size: 14px; font-weight: 700; letter-spacing: .08em; line-height: 1.4;
}
body { padding-bottom: calc(var(--warn-h) + env(safe-area-inset-bottom)); }
.to-top { bottom: calc(var(--warn-h) + 20px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(var(--warn-h) + 24px + env(safe-area-inset-bottom)); }
/* 每一句警語保持在同一行，不從中間斷開 */
.modal-warning span { display: inline-block; margin: 0 .5em; }
.modal-warning {
  margin: 28px 0 0; padding: 12px 14px; background: var(--navy); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-align: center; border-radius: var(--radius-sm);
}
@media (max-width: 640px) {
  :root { --warn-h: 34px; }
  .alcohol-warning { font-size: 12px; letter-spacing: .02em; padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* 調酒師「By 名字」：用小標的字體，一般粗細，顏色維持原本 */
.by-name { font-family: var(--font-caps); font-weight: 400; letter-spacing: .04em; }
.recipe-by .by-name { color: var(--text-2); }

/* By／From 一般粗細，調酒師與店家名稱粗體 */
.card-meta strong, .by strong, .recipe-by strong { font-weight: 700; }

/* 酒譜視窗裡的調酒師、店家名稱：柔和一點（中等粗細、深灰色） */
.recipe-by { font-size: 16px; }
.recipe-by strong { font-weight: 500; color: var(--text-2); }

/* =========================================================
   目前篩選條件列：往下捲時固定在導覽列下方
   ========================================================= */
.active-filters {
  position: fixed; left: 0; right: 0; top: 0; z-index: 58;
  background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 18px -14px rgba(0, 0, 0, .35);
  transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.active-filters.show { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.af-inner { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.af-label {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; padding: 4px 0; font-family: var(--font-caps); font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.af-chips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.af-chips::-webkit-scrollbar { display: none; }
.af-chip {
  flex-shrink: 0; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px; white-space: nowrap;
}
.af-chip-label { border: 0; background: none; color: inherit; padding: 5px 4px 5px 13px; font-size: inherit; }
.af-chip-x {
  border: 0; background: none; color: inherit; padding: 5px 10px 5px 4px; display: grid; place-items: center; opacity: .75;
}
.af-chip-x:hover { opacity: 1; }
.af-chip-x svg { width: 13px; height: 13px; }
.af-clear {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  display: grid; place-items: center;
}
.af-clear:hover { border-color: var(--accent); color: var(--accent); }
.af-clear svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .af-inner { gap: 8px; }
  .af-label { font-size: 11px; letter-spacing: .04em; }
  .af-chip { font-size: 12px; }
  .af-chip-label { padding: 4px 3px 4px 11px; }
  .af-chip-x { padding: 4px 9px 4px 3px; }
}

.af-label svg { width: 14px; height: 14px; transition: transform .2s ease; }
.active-filters.panel-open .af-label svg { transform: rotate(180deg); }
/* 調整條件面板 */
.af-panel { border-top: 1px solid var(--line); background: #fff; max-height: 70vh; overflow-y: auto; }
.af-panel .container { padding-top: 14px; padding-bottom: 14px; }
.af-group { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.af-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.af-panel-foot .btn { padding: 9px 22px; }
@media (max-width: 640px) {
  .af-group { flex-direction: column; align-items: flex-start; gap: 6px; }
  .af-panel .chips { flex-wrap: wrap; width: auto; margin: 0; padding: 0; overflow: visible; }
}

/* 沒有篩選條件時的提示 */
.af-empty {
  flex-shrink: 0; border: 1px dashed var(--line-strong); background: none; color: var(--text-2);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; white-space: nowrap;
}
.af-empty:hover { border-color: var(--accent); color: var(--accent); }

/* 酒譜視窗裡的警語：黏在視窗最下方，捲動時一直看得到（手機全螢幕時也一樣） */
.modal-warning {
  position: sticky; bottom: 0; z-index: 3;
  margin: 28px -40px -40px; border-radius: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
@media (max-width: 760px) {
  .modal-warning { margin: 28px -18px -40px; font-size: 12px; }
}
@media (min-width: 761px) {
  /* 電腦版：內容區本身會捲動，拿掉底部留白讓警語貼齊視窗底邊 */
  .recipe-content { padding-bottom: 0; }
  .modal-warning { margin-bottom: 0; }
}

/* =========================================================
   分享
   ========================================================= */
.share-btn svg { width: 18px; height: 18px; }
.share-inline svg { width: 16px; height: 16px; }
.share-panel {
  flex-direction: column; width: min(460px, calc(100vw - 32px)); padding: 26px 26px 24px; border-radius: 12px;
}
.share-title { font-family: var(--font-serif); font-size: 22px; margin: 4px 40px 18px 0; line-height: 1.3; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; margin-bottom: 20px; }
.share-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
  color: var(--text-2); font-size: 12px; background: none; border: 0; padding: 0; text-align: center;
}
.share-item:hover { color: var(--text); text-decoration: none; }
.share-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  transition: transform .15s ease;
}
.share-item:hover .share-icon { transform: translateY(-2px); }
.share-icon svg { width: 26px; height: 26px; }
.share-icon b { font-family: var(--font-caps); font-size: 12px; letter-spacing: .02em; color: #fff; }
.share-copy { display: flex; gap: 8px; }
.share-copy .input { flex: 1; min-width: 0; font-size: 13px; padding: 9px 12px; color: var(--text-2); }
.share-copy .btn { flex-shrink: 0; }
/* 手機上分享選單從下方滑出，不佔滿整個畫面 */
@media (max-width: 760px) {
  #shareModal { inset: auto 0 0 0; width: 100%; height: fit-content; margin: 0; max-height: none; }
  #shareModal .share-panel {
    width: 100%; height: auto; max-height: 90dvh; border-radius: 16px 16px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }
  .share-grid { gap: 14px 4px; }
  .share-icon { width: 48px; height: 48px; }
}

/* 手機版表格：每一列變成一張小卡片，欄位名稱放在內容上方，不會擠成直排 */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; border: 0; }
  .table-stack { min-width: 0; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--line); border-left: 3px solid var(--accent); margin-bottom: 10px; padding: 12px 14px; background: #fff; }
  .table-stack tr:nth-child(even) td { background: none; }
  .table-stack td { border: 0; padding: 4px 0; font-size: 15px; }
  .table-stack td.cell-head { font-size: 17px; font-weight: 700; color: var(--text); padding-top: 0; padding-bottom: 6px; }
  .table-stack td[data-zh]::before {
    content: attr(data-zh); display: block; font-family: var(--font-caps); font-size: 11px; font-weight: 700;
    letter-spacing: .1em; color: var(--text-3); margin-bottom: 1px;
  }
  html[lang="en"] .table-stack td[data-en]::before { content: attr(data-en); text-transform: uppercase; }
}
/* =========================================================
   學堂頁：品牌與酒莊圖片
   ========================================================= */
.figure { margin: 18px 0; }
.figure img { width: 100%; height: auto; display: block; background: var(--bg-3); }
.figure figcaption { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.figure-wide img { aspect-ratio: 16 / 9; object-fit: cover; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.photo-pair .figure { margin: 0; }
.photo-pair img { aspect-ratio: 4 / 5; object-fit: cover; }
.flow-steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.flow-steps li { background: var(--bg-2); padding: 12px 14px; border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.flow-steps b { font-family: var(--font-caps); font-size: 12px; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.brand-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin: 26px 0; }
.brand-row.reverse .brand-photo { order: 2; }
.brand-row .figure { margin: 0; }
.brand-photo img { aspect-ratio: 4 / 5; object-fit: cover; }
.brand-copy .kicker { display: block; margin: -4px 0 12px; }
.brand-logo { display: block; height: 64px; width: auto; margin: 0 auto 10px; }
/* La Caravedo Logo 和 Portón logo 一樣高 */
.brand-logo-dark { height: 64px; }
.spec-photo-contain { object-fit: contain !important; background: #fff !important; }
.spec-note { font-family: var(--font-caps); font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--accent); margin: 0 0 6px; text-transform: uppercase; }
@media (max-width: 640px) {
  .photo-pair { gap: 8px; }
  .flow-steps { grid-template-columns: 1fr; }
  .brand-row { grid-template-columns: 1fr; gap: 16px; }
  .brand-row.reverse .brand-photo { order: 0; }
  .brand-photo img { aspect-ratio: 4 / 3; }
}

/* 學堂頁：前往品牌頁的連結區塊 */
.brand-cta {
  display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 22px; width: 100%;
  background: var(--bg-2); text-decoration: none; color: var(--text); overflow: hidden;
  border: 0; padding: 0; text-align: left; cursor: pointer;
}
.brand-cta img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; }
.brand-cta-text { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 18px 0; color: var(--text-2); font-size: 15px; }
.brand-cta-text strong { font-size: 20px; color: var(--text); font-weight: 600; }
.brand-cta:hover strong { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .brand-cta { grid-template-columns: 1fr; gap: 0; }
  .brand-cta img { aspect-ratio: 16 / 9; min-height: 0; }
  .brand-cta-text { padding: 16px 18px; }
}

/* Our Brands 跳出視窗 */
.brand-panel { flex-direction: column; width: min(900px, calc(100vw - 48px)); overflow-y: auto; }
.brand-panel-body { padding: 40px 48px 48px; }
.brand-panel-title { font-family: var(--font-serif); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.25; margin: 8px 48px 24px 0; }
.brand-article { max-width: none; }
.brand-article section { scroll-margin-top: 20px; }
@media (max-width: 760px) {
  .brand-panel { width: 100%; }
  .brand-panel-body { padding: 26px 18px 48px; }
  .brand-panel-title { margin-right: 52px; }
}
.brand-panel > .modal-warning { margin: 0 !important; flex-shrink: 0; }
/* 長內容視窗：右上角的 × 捲動時固定在上方 */
.brand-panel > .modal-close { position: sticky; top: 14px; align-self: flex-end; margin: 14px 14px -54px 0; flex-shrink: 0; }
@media (max-width: 760px) {
  .recipe-panel > .modal-close { position: sticky; top: 12px; align-self: flex-end; margin: 12px 12px -52px 0; flex-shrink: 0; }
}

/* 學堂頁插圖 */
.article .figure-wide { margin: 4px 0 22px; }
.pair-caption { margin: -8px 0 20px !important; font-size: 13px !important; color: var(--text-3) !important; }
.brand-cta-wrap { margin-top: 18px; }
.figure-portrait { max-width: 480px; }
.figure-portrait img { aspect-ratio: 4 / 5; object-fit: cover; }
#brands .brand-cta-wrap { margin-top: 4px; }

/* 經典調酒：插圖與結構化酒譜 */
.spec-illus { object-fit: cover; background: #ecebe7; height: auto !important; min-height: 0 !important; aspect-ratio: 1 / 1; align-self: start; }
.spec-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.spec-meta div { background: #fff; padding: 8px 12px; }
.spec-meta dt { font-family: var(--font-caps); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; }
.spec-meta dd { margin: 2px 0 0; font-size: 15px; color: var(--text); }
.spec-label { font-family: var(--font-caps); font-size: 12px !important; font-weight: 700; letter-spacing: .12em; color: var(--accent) !important; margin: 16px 0 4px !important; text-transform: uppercase; }
.spec-ings { list-style: none; padding: 0 !important; margin: 0; }
.spec-ings li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.spec-ings li span:last-child { font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.spec-steps { margin: 0; padding-left: 20px; }
.spec-steps li { padding: 3px 0; }
@media (max-width: 640px) {
  .spec-illus { aspect-ratio: 1 / 1 !important; }
}
/* 經典調酒：深色背景的酒款照片，固定正方形放在卡片上方 */
.spec-dark { object-fit: cover; background: #0b0b0b; height: auto !important; min-height: 0 !important; aspect-ratio: 1 / 1; align-self: start; }
@media (max-width: 640px) { .spec-dark { aspect-ratio: 1 / 1 !important; } }
/* 經典調酒：同系列的淺色背景酒款照，固定正方形 */
.spec-square { object-fit: cover; background: #e9e4dc; height: auto !important; min-height: 0 !important; aspect-ratio: 1 / 1 !important; align-self: start; }

/* 葡萄品種：非芳香型、芳香型分成兩組（沿用網站的黑、灰、紅配色） */
.grape-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.grape-group { --g: var(--text); background: var(--bg-2); border-top: 3px solid var(--g); padding: 18px 18px 8px; }
.grape-aro { --g: var(--accent); }
.grape-head { margin-bottom: 8px; }
.grape-badge {
  display: inline-block; background: var(--g); color: #fff; font-weight: 600; font-size: 14px;
  letter-spacing: .06em; padding: 3px 12px; border-radius: 999px;
}
.grape-head p { margin: 8px 0 0 !important; font-size: 14px !important; color: var(--text-2) !important; }
.grape-list { list-style: none; padding: 0 !important; margin: 0; }
.grape-list li { display: flex; flex-direction: column; gap: 2px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px !important; }
.grape-list strong { font-size: 17px; color: var(--text); }
.grape-list span { color: var(--text-2); }
@media (max-width: 640px) {
  .grape-groups { grid-template-columns: 1fr; }
}

/* 品牌視窗「從葡萄園開始」：單張直式照片＋文字並排 */
.vine-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 26px; align-items: center; margin: 14px 0 22px; }
.vine-row .figure { margin: 0; }
.vine-row img { aspect-ratio: 4 / 5; object-fit: cover; }
.vine-text p { margin: 0 0 12px; }
@media (max-width: 640px) {
  .vine-row { grid-template-columns: 1fr; gap: 14px; }
}

/* 學堂頁：目錄與段落標題的編號 */
.toc a { display: flex; gap: 10px; align-items: baseline; }
.toc-num { font-family: var(--font-caps); font-size: 11px; font-weight: 700; color: var(--accent); min-width: 18px; }
.h-num {
  display: inline-block; margin-right: 12px; font-family: var(--font-caps); font-weight: 700;
  font-size: .62em; color: var(--accent); letter-spacing: .04em; vertical-align: .18em;
}
.photo-pair-wide img { aspect-ratio: 5 / 4; }

/* ---------- 學堂：手機版凍結段落選單 ---------- */
.toc-mobile { display: none; }
@media (max-width: 860px) {
  .toc-mobile { display: block; position: sticky; top: var(--toc-top, 56px); z-index: 50; background: var(--bg, #fff); border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px -12px rgba(0,0,0,.35); }
  .toc-mobile-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
  .toc-mobile-label { font-family: var(--font-caps); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); flex: none; }
  .toc-mobile-current { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toc-mobile-caret { flex: none; color: var(--text-2); transition: transform .25s ease; }
  .toc-mobile.open .toc-mobile-caret { transform: rotate(180deg); }
  .toc-mobile-list { border-top: 1px solid var(--line); padding: 6px 0 10px; max-height: 60vh; overflow-y: auto; }
  .toc-mobile-list a { display: flex; gap: 12px; align-items: baseline; padding: 11px 16px; color: var(--text-2); text-decoration: none; font-size: 15px; }
  .toc-mobile-list a.active { color: var(--text); font-weight: 600; background: rgba(208, 57, 31, .06); }
  .article section { scroll-margin-top: calc(var(--toc-top, 56px) + 60px); }
}

/* ---------- 標籤徽章（照片左上角） ---------- */
.card-media, .feature-thumb { position: relative; }
.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 60px); pointer-events: none; z-index: 2; }
.badge { background: var(--accent); color: #fff; font-family: var(--font-caps); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; line-height: 1.2; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
html[lang="zh-Hant"] .badge { letter-spacing: .04em; font-family: inherit; font-size: 12px; }
.feature-thumb .badges { top: 6px; left: 6px; gap: 4px; }
.feature-thumb .badge { font-size: 10px; padding: 3px 6px; }
.tag.tag-badge { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 「經典」標籤固定黑色 */
.badge.is-classic, .tag.tag-badge.is-classic { background: var(--navy, #121212); border-color: var(--navy, #121212); }
.check-pill[hidden] { display: none; }
/* 手機版：照片上的標籤縮小，長標籤不會蓋住整張照片 */
@media (max-width: 640px) {
  .badges { top: 6px; left: 6px; gap: 4px; max-width: calc(100% - 48px); }
  .badge, html[lang="zh-Hant"] .badge { font-size: 10px; padding: 2px 6px; letter-spacing: .02em; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) { .feature-thumb .badges { max-width: calc(100% - 12px); } .feature-thumb .badge { font-size: 9px; padding: 2px 5px; } }
