/* ===== 典雅美術館 ===== */
:root {
  color-scheme: only light;
  --bg: #f6f0e6;
  --paper: #fbf7f0;
  --wine: #7a1e24;
  --wine-dark: #5e151a;
  --ink: #2b2420;
  --muted: #7a6d62;
  --line: #e2d6c4;
  --gold: #b08a4f;
  --shadow: 0 2px 10px rgba(80, 50, 30, .08);
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --latin: "Cormorant Garamond", "Noto Serif TC", serif;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 15px;
  letter-spacing: .03em;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
svg { width: 1em; height: 1em; flex: none; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.section { padding: 44px 0; }
.center { text-align: center; margin-top: 36px; }
.en {
  font-family: var(--latin);
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--gold);
}

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .12em;
  padding: 10px 22px;
  border: 1px solid var(--wine);
  border-radius: 2px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-solid { background: var(--wine); color: #fff; }
.btn-solid:hover { background: var(--wine-dark); }
.btn-outline { background: var(--paper); color: var(--wine); padding-inline: 48px; }
.btn-outline:hover { background: var(--wine); color: #fff; }
.btn-lg { font-size: 16px; padding: 12px 32px; }
.btn-sm { font-size: 12px; padding: 4px 14px; }
.btn-block { width: 100%; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(251, 247, 240, .96);
  border-top: 4px solid var(--wine);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
/* 左 logo｜中 導覽列｜右 購票按鈕 */
.header-inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px; }

.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 22px; font-weight: 700; letter-spacing: .1em; }
.logo-en { font-family: var(--latin); font-size: 9px; letter-spacing: .14em; color: var(--muted); }

.logo { justify-self: start; }
.nav { display: flex; justify-content: center; gap: 44px; }
.nav a { position: relative; font-size: 14px; font-weight: 600; padding: 6px 0; }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--wine);
  transform: scaleX(0);
  transition: transform .25s;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--wine); }
.header-cta { justify-self: end; }

.menu-toggle { display: none; }

/* ===== 區塊標題 ===== */
.section-head { display: flex; align-items: flex-end; gap: 28px; margin-bottom: 28px; }
.section-head h2 { font-size: 28px; letter-spacing: .12em; white-space: nowrap; color: var(--wine); }
/* 英文小標 + 底線延伸到右側 */
.head-line {
  flex: 1;
  display: flex; align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gold);
}
.section-head .more {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--wine); white-space: nowrap;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(246, 240, 230, .97) 0%, rgba(246, 240, 230, .85) 30%, rgba(246, 240, 230, 0) 60%),
    var(--hero) center / cover no-repeat;
}
.hero-inner { position: relative; padding: 56px 0; }
.hero-kicker { font-size: 16px; color: var(--muted); letter-spacing: .2em; margin-bottom: 12px; }
.hero-title span { display: block; font-size: 60px; font-weight: 700; color: var(--wine); letter-spacing: .08em; line-height: 1.2; }
.hero-sub { font-size: 24px; font-weight: 600; letter-spacing: .15em; margin: 12px 0 24px; }
.hero-date { font-family: var(--latin); font-size: 30px; display: flex; align-items: center; gap: 16px; }
.hero-date i { display: inline-block; width: 48px; height: 1px; background: var(--ink); }
.hero-loc { display: flex; align-items: center; gap: 6px; color: var(--wine); font-weight: 600; margin: 8px 0 24px; }
.hero-quote {
  position: absolute;
  right: 0; bottom: 48px;
  color: #fff;
  font-size: 20px;
  letter-spacing: .2em;
  text-align: right;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

/* ===== 頁首 Banner ===== */
.page-banner {
  padding: 72px 0;
  background:
    linear-gradient(90deg, rgba(246, 240, 230, .97) 0%, rgba(246, 240, 230, .82) 40%, rgba(246, 240, 230, .1) 80%),
    var(--banner) center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.page-banner h1 { font-size: 44px; color: var(--wine); letter-spacing: .15em; margin: 4px 0 12px; }
.page-banner p { max-width: 420px; color: var(--muted); }

/* ===== 展覽介紹 ===== */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.about-text p + p { margin-top: 8px; }
.museum-card { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; }
.museum-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--shadow); }
.museum-card h3 { font-size: 20px; letter-spacing: .1em; }
.museum-card .en { display: block; font-size: 11px; margin-bottom: 8px; }
.museum-card p { font-size: 13px; color: var(--muted); }

.trailer-wrap { padding-bottom: 72px; }
.trailer { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: #222; cursor: pointer; }
.trailer video { width: 100%; height: 100%; object-fit: cover; }
.trailer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .1) 60%); }
.trailer .play {
  position: absolute; z-index: 1;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 84px; height: 84px;
  display: grid; place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 40px;
  background: rgba(0, 0, 0, .25);
  transition: transform .25s;
}
.trailer:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.trailer-caption { position: absolute; z-index: 1; left: 6%; bottom: 14%; color: #fff; }
.trailer-caption h3 { font-size: 24px; letter-spacing: .15em; }
.trailer-caption p { letter-spacing: .12em; }

/* ===== 卡片 ===== */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: none; border: 0; box-shadow: none; }
.card-img { overflow: hidden; }
.card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 14px 0 0; }
.card-body h3 { font-size: 18px; letter-spacing: .1em; margin-bottom: 4px; }
.card-body p { font-size: 13px; color: var(--muted); }

.news-card .card-img img { aspect-ratio: 16 / 10; }
.news-card time { font-family: var(--latin); font-size: 13px; color: var(--muted); }

.edu-card { display: grid; grid-template-columns: 120px 1fr; }
.edu-card img { width: 100%; height: 100%; object-fit: cover; }
.edu-card .card-body { padding: 0 0 0 16px; }
.edu-card .btn { margin-top: 10px; }

/* ===== 參觀資訊 ===== */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.visit-info dl { margin: 0 0 20px; }
.info-row { display: grid; grid-template-columns: 140px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-row dt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.info-row dt svg { color: var(--wine); font-size: 18px; }
.info-row dd { margin: 0; font-family: var(--latin), var(--serif); font-size: 17px; }

.accordion { background: var(--paper); border: 1px solid var(--line); padding: 4px 24px; }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion details:last-child { border-bottom: 0; }
.accordion summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0;
  font-weight: 600;
  cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--wine); font-size: 20px; font-weight: 400; transition: transform .2s; }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details p { padding-bottom: 18px; font-size: 14px; color: var(--muted); }

/* ===== Footer ===== */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 28px 0 20px; }
.footer-inner { display: flex; align-items: center; gap: 40px; }
.footer-links { display: flex; gap: 0; font-size: 13px; }
.footer-links a + a::before { content: "|"; margin: 0 10px; color: var(--line); }
.footer-links a:hover { color: var(--wine); }
.footer-org { margin-left: auto; display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.copyright { text-align: center; font-family: var(--latin); font-size: 12px; color: var(--muted); margin-top: 16px; }

.float-ticket {
  position: fixed; z-index: 40;
  right: 28px; bottom: 28px;
  width: 72px; height: 72px;
  border: 0; border-radius: 50%;
  background: var(--wine); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 11px;
  box-shadow: 0 4px 14px rgba(94, 21, 26, .35);
  cursor: pointer;
}
.float-ticket svg { font-size: 22px; }
.mobile-ticket-bar { display: none; }

.load-error { max-width: 640px; margin: 80px auto; padding: 24px; background: var(--paper); border: 1px solid var(--wine); line-height: 2; }
.load-error code { background: var(--bg); padding: 2px 6px; }

/* ===== 燈箱（大圖 / PDF） ===== */
main img { cursor: zoom-in; }
.viewer-open { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 64px 24px 24px;
  background: rgba(24, 16, 12, .92);
  animation: viewer-in .2s ease;
}
.viewer[hidden] { display: none; }
@keyframes viewer-in { from { opacity: 0; } }
.viewer-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-close {
  position: absolute; top: 14px; right: 18px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(0, 0, 0, .3);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.viewer-close:hover { background: var(--wine); border-color: var(--wine); }

.viewer-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.viewer-figure img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); cursor: default; }
.viewer-figure figcaption { margin-top: 14px; color: #f0e6d6; letter-spacing: .15em; }

.viewer-pdf { width: min(960px, 100%); height: 100%; display: flex; flex-direction: column; gap: 10px; }
.viewer-pdf iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-newtab { align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; color: #f0e6d6; font-size: 13px; }
.viewer-newtab:hover { color: #fff; text-decoration: underline; }

@media (max-width: 768px) {
  .viewer { padding: 60px 12px 16px; }
  .viewer-close { top: 10px; right: 12px; }
}

/* 資料載入前保留高度，避免 footer 跳動 */
main:empty { min-height: 60vh; }

/* ===== 平板 ===== */
@media (max-width: 1024px) {
  .header-inner { gap: 20px; }
  .nav { gap: 22px; }
  .hero-title span { font-size: 48px; }
  .edu-card { grid-template-columns: 1fr; }
  .edu-card img { aspect-ratio: 4 / 3; }
  .edu-card .card-body { padding: 14px 0 0; }
}

/* ===== 手機 ===== */
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  body { font-size: 14px; padding-bottom: 72px; }
  .container { width: calc(100% - 32px); }
  .section { padding: 40px 0; }

  .header-inner { display: flex; }
  .header-cta { display: none; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    margin-left: auto;
    width: 40px; height: 40px;
    background: none; border: 0; padding: 8px; cursor: pointer;
  }
  .menu-toggle span { height: 2px; background: var(--ink); transition: transform .25s, opacity .25s; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 14px 24px; border-top: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav a.active { background: var(--bg); }

  .section-head { gap: 12px; margin-bottom: 20px; }
  .section-head h2 { font-size: 22px; }
  .section-head .en { font-size: 10px; }

  .hero { min-height: 0; background:
    linear-gradient(90deg, rgba(246, 240, 230, .96) 0%, rgba(246, 240, 230, .8) 45%, rgba(246, 240, 230, 0) 85%),
    var(--hero) 70% center / cover no-repeat; }
  .hero-inner { padding: 32px 0 40px; }
  .hero-kicker { font-size: 12px; }
  .hero-title span { font-size: 34px; }
  .hero-sub { font-size: 15px; margin: 6px 0 14px; }
  .hero-date { font-size: 20px; gap: 10px; }
  .hero-date i { width: 28px; }
  .hero-loc { font-size: 12px; margin: 4px 0 16px; }
  .hero .btn-lg { font-size: 13px; padding: 8px 20px; }
  .hero-quote { font-size: 13px; bottom: 20px; }

  .page-banner { padding: 40px 0; background:
    linear-gradient(90deg, rgba(246, 240, 230, .97) 0%, rgba(246, 240, 230, .9) 60%, rgba(246, 240, 230, .5) 100%),
    var(--banner) center / cover no-repeat; }
  .section-head:has(.more) .en { display: none; }
  .page-banner h1 { font-size: 30px; }

  .about { grid-template-columns: 1fr; gap: 24px; }
  .museum-card { grid-template-columns: 120px 1fr; gap: 14px; background: var(--paper); border: 1px solid var(--line); padding: 10px; }
  .museum-card h3 { font-size: 16px; }
  .museum-card p { font-size: 12px; }

  .trailer-wrap { padding-bottom: 40px; }
  .trailer { aspect-ratio: 16 / 9; }
  .trailer .play { width: 56px; height: 56px; font-size: 26px; }
  .trailer-caption h3 { font-size: 18px; }
  .trailer-caption p { font-size: 12px; }

  /* 卡片改為左圖右文列表 */
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .card-list .card { display: grid; grid-template-columns: 120px 1fr; }
  .card-list .card-img img { height: 100%; aspect-ratio: auto; min-height: 90px; }
  .card-list .card-body { padding: 0 0 0 14px; }
  .card-body h3 { font-size: 15px; }
  .card-body p { font-size: 12px; }
  .edu-card { grid-template-columns: 120px 1fr; }
  .edu-card img { aspect-ratio: auto; }
  .edu-card .card-body { padding: 0 0 0 14px; }
  .btn-outline { width: 100%; padding-inline: 16px; }
  .btn-outline.btn-sm { width: auto; }

  .visit-grid { grid-template-columns: 1fr; gap: 20px; }
  .info-row { grid-template-columns: 110px 1fr; }
  .info-row dd { font-size: 15px; }
  .accordion { padding: 0 16px; }
  .accordion summary { padding: 14px 0; font-size: 14px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-org { margin-left: 0; flex-direction: column; gap: 0; }

  .float-ticket { display: none; }
  .mobile-ticket-bar {
    display: block;
    position: fixed; z-index: 40;
    left: 0; right: 0; bottom: 0;
    padding: 10px 16px;
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .mobile-ticket-bar .btn { width: 100%; padding: 12px; font-size: 15px; }
}
