/* Kallery 官方網站
 *
 * 風格跟著 App 走：米白紙色底、深綠 #3D5746、白色圓角展示卡、膠囊按鈕。
 * 收藏品的意象取自 App 圖示（貼著相片角的收藏冊）與 App 裡的網點：
 *   .mount   —— 圖片像收藏冊裡的相片，四角貼著相片角
 *   .exhibit —— 功能說明做成展場的展品說明牌（No. 01…）
 *   .dots    —— 網點底紋，只當裝飾，文字一律放在實色底上
 *
 * App 固定淺色（preferredColorScheme(.light)），網站也只有淺色，沒有外觀切換、沒有任何 JavaScript。
 * 文字對比全部 ≥ 7:1（WCAG AAA），由 scripts/check-contrast.py 實際算，改顏色就重跑，不要憑感覺。
 */

:root {
  --paper: #F7F5EF;          /* App 的底色 */
  --paper-warm: #F7EEDB;     /* App 收藏輯預設底色 #F2E6CC 提亮，讓連結維持 7:1 */
  --card: #FFFFFF;
  --sage: #EAF1E8;           /* App 勾選時的淡綠 #DFE9DE 提亮，讓連結維持 7:1 */
  --ink: #1E2620;
  --ink-soft: #37403A;
  --ink-muted: #434B45;
  --green: #3D5746;          /* App 的主色（tint） */
  --green-deep: #33483B;     /* 淡綠、暖米卡片上的連結（主色在那兩種底上不到 7:1） */
  --on-green: #FFFFFF;
  --line: #E2DACA;
  --corner: #F4ECDB;         /* 相片角 */
  --corner-edge: #DDD1B8;
  --dot: #3D574624;          /* 網點：主色 14% */
  --shadow: 0 1px 2px #3C321E14, 0 14px 34px -14px #3C321E47;
  --radius: 20px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.75;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 720px; }

h1, h2, h3 { line-height: 1.3; color: var(--ink); }
h2 { font-size: 1.6rem; margin: 3.2rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
p, li { color: var(--ink-soft); }
strong { color: var(--ink); }

.serif { font-family: ui-serif, "New York", Georgia, "Times New Roman", serif; }
.meta { color: var(--ink-muted); font-size: .95rem; }

/* ── 頁首 ───────────────────────────────────────── */

header.site { padding: 18px 0 8px; }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: ui-serif, "New York", Georgia, serif;
  font-size: 1.45rem; font-weight: 600; letter-spacing: .01em;
}
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 1px 3px #3C321E26; }

/* 手機上導覽自己占一列、可以橫向捲：
 * 子項少了 flex:0 0 auto + nowrap 會被壓成一字一行；只加那兩個又會把整頁撐出水平捲軸，所以 nav 自己 overflow-x:auto。 */
nav.site {
  display: flex; gap: 6px; margin-left: auto;
  overflow-x: auto; max-width: 100%;
}
nav.site a {
  flex: 0 0 auto; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-size: .98rem;
}
nav.site a:hover { background: var(--card); }
nav.site a[aria-current="page"] { background: var(--green); color: var(--on-green); }

@media (max-width: 560px) {
  nav.site { margin-left: 0; width: 100%; }
}

/* ── 首頁主視覺 ─────────────────────────────────── */

.hero {
  display: grid; gap: 32px; align-items: center;
  padding: 28px 0 12px;
}
@media (min-width: 820px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 48px; padding-top: 48px; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--green); font-weight: 600; font-size: .98rem; letter-spacing: .06em;
  margin: 0 0 12px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 12px;
  background-image: radial-gradient(var(--green) 1.6px, transparent 2px);
  background-size: 7px 6px;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.3rem);
  line-height: 1.22; letter-spacing: .01em;
  margin: 0 0 18px;
}
.lede { font-size: 1.18rem; color: var(--ink-soft); margin: 0 0 26px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.button {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  background: var(--green); color: var(--on-green);
  font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 16px -8px #3D5746AA;
}
.button:hover { background: var(--green-deep); text-decoration: none; }

/* 主視覺右邊：網點底紋上擺一張「貼在收藏冊裡」的房間照片 */
.stage { position: relative; padding: 22px 8% 26px; }
.stage::before {
  content: ""; position: absolute; inset: 0 0 0 12%;
  border-radius: 40px;
  background-color: var(--sage);
  background-image: radial-gradient(var(--dot) 2px, transparent 2.4px);
  background-size: 14px 14px;
}
.stage .mount { position: relative; max-width: 340px; margin: 0 auto; transform: rotate(-1.6deg); }

/* ── 相片：白框＋四個相片角 ───────────────────── */

.mount {
  background: var(--card);
  padding: 12px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative;
}
.mount img { border-radius: 6px; width: 100%; }
.mount::before, .mount::after {
  content: ""; position: absolute; width: 34px; height: 34px;
  background: var(--corner);
  border: 1px solid var(--corner-edge);
  box-shadow: 0 1px 2px #3C321E1F;
}
.mount::before { top: 4px; left: 4px; clip-path: polygon(0 0, 100% 0, 0 100%); border-radius: 6px 0 0 0; }
.mount::after { right: 4px; bottom: 4px; clip-path: polygon(100% 0, 100% 100%, 0 100%); border-radius: 0 0 6px 0; }

/* 展品說明牌：照片底下那張小卡 */
.caption {
  margin: 12px 4px 0; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  font-size: .95rem; line-height: 1.5;
}
.caption .no { display: block; color: var(--ink-muted); font-size: .85rem; letter-spacing: .08em; }
.caption strong { display: block; font-size: 1rem; }
.stage .caption { position: relative; max-width: 240px; margin: -18px 0 0 auto; transform: rotate(1.2deg); box-shadow: var(--shadow); }

/* ── 展品說明（功能） ─────────────────────────── */

.section-head { max-width: 640px; }
.section-head p { margin-top: 0; }

.exhibits {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  margin-top: 20px;
}
.exhibit {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px;
  position: relative;
}
.exhibit .no {
  font-family: ui-serif, "New York", Georgia, serif;
  color: var(--green); font-size: .95rem; letter-spacing: .12em;
  display: flex; align-items: center; gap: 10px;
}
.exhibit .no::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.exhibit h3 { margin: .5rem 0 .35rem; font-size: 1.2rem; }
.exhibit p { margin: 0; }

/* ── 展間一角（圖片牆） ───────────────────────── */

.gallery {
  display: grid; gap: 28px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}
@media (min-width: 820px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gallery figure { margin: 0; }
.gallery figure:nth-child(odd) .mount { transform: rotate(-1deg); }
.gallery figure:nth-child(even) .mount { transform: rotate(1deg); }
.gallery .mount { padding: 8px; display: block; }
.gallery .mount img { aspect-ratio: 4 / 7; object-fit: cover; }  /* 房間與特寫的原圖比例不同，統一裁成同一個比例才排得整齊 */
.gallery .mount::before, .gallery .mount::after { width: 24px; height: 24px; }

/* ── 卡片 ─────────────────────────────────────── */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin: 20px 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.sage { background: var(--sage); border-color: transparent; }
.card.warm { background: var(--paper-warm); border-color: transparent; }
.card.sage a:not(.button), .card.warm a:not(.button) { color: var(--green-deep); }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; }
.get img { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.get .text { flex: 1 1 260px; }
.get h2 { margin: 0 0 .3rem; }
.get p { margin: 0 0 .9rem; }

.email { font-size: 1.2rem; font-weight: 600; }

/* ── 常見問題 ─────────────────────────────────── */

details.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin: 10px 0; padding: 0 18px;
}
details.faq summary {
  cursor: pointer; list-style: none;
  padding: 14px 28px 14px 0; position: relative;
  font-weight: 600; color: var(--ink);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  color: var(--green); font-size: 1.4rem; font-weight: 400;
}
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 0 0 16px; }

/* ── 法律文件 ─────────────────────────────────── */

.doc h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); margin: 28px 0 4px; }
.doc h2 { font-size: 1.3rem; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.doc .lede { font-size: 1.08rem; }

.table-scroll { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
th { background: var(--sage); color: var(--ink); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ── 頁尾 ─────────────────────────────────────── */

footer.site { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); }
footer.site p { margin: 4px 0; color: var(--ink-muted); font-size: .95rem; }
footer.site .brand { font-size: 1.15rem; }
footer.site .brand img { width: 28px; height: 28px; border-radius: 7px; }

/* 內嵌模式（?embed=1，App 內建瀏覽器用，見 embed.js）：藏掉站台導覽與頁尾，只留內文 */
html.embed header.site,
html.embed footer.site { display: none; }
html.embed main.wrap { padding-bottom: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .button, nav.site a { transition: background-color .15s ease; }
}
