/* 關埔愛樂 對外網站
   版面：樂譜。首頁是一行五線譜，五條線各是一個聲部；歷年紀錄用排練記號（框起來的學年度）與節目單的點線排列
   產生頁面：node site-src/build.mjs（頁面內容在 site-src/pages，這個檔案直接編輯） */
:root {
  color-scheme: light;
  --paper: #ffffff;       /* 譜紙 */
  --ink: #1b2440;         /* 譜上的墨色 */
  --ink-2: #4f5873;       /* 次要文字 */
  --staff: #c3c9d6;       /* 譜線 */
  --brass: #8a6418;       /* 銅管金（文字用） */
  --brass-line: #b8892e;  /* 銅管金（線條、記號） */
  --wash: #f3f4f7;        /* 淡底 */
  --hall: #17213a;        /* 音樂廳深藍 */
  --on-hall: #f2eee4;
  --hall-gold: #e3c27f;   /* 深藍底上的金色（兩種模式都是深藍底） */
  --hall-dim: #a9afc2;    /* 深藍底上的小字 */
  --hall-line: #2a3550;   /* 深藍底上的分隔線 */
  --art: #1b2440;         /* 團T線稿的顏色 */
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --hand: "LXGW WenKai TC", "Kaiti TC", "DFKai-SB", serif;
  --measure: 38rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1628; --ink: #ebe7dc; --ink-2: #aab1c3; --staff: #2c3756; --brass: #dcb56a; --brass-line: #c99d4a;
    --wash: #162038; --hall: #0a1020; --on-hall: #f2eee4; --hall-gold: #e3c27f; --art: #dcb56a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1628; --ink: #ebe7dc; --ink-2: #aab1c3; --staff: #2c3756; --brass: #dcb56a; --brass-line: #c99d4a;
  --wash: #162038; --hall: #0a1020; --on-hall: #f2eee4; --hall-gold: #e3c27f; --art: #dcb56a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.8; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass-line); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 68rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--serif); text-wrap: balance; margin: 0; }
h2, .page-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 900; letter-spacing: 0.04em; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
.lede { color: var(--ink-2); max-width: var(--measure); }

/* 頁首 */
.top { border-bottom: 1px solid var(--staff); }
.top .wrap { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-block: 14px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.mark img { width: 44px; height: 44px; flex: none; }
.mark span { align-self: flex-end; padding-bottom: 6px; }
.mark b { font-family: var(--serif); font-weight: 900; font-size: 1.35rem; letter-spacing: 0.08em; }
.mark span { font-size: 0.85rem; color: var(--ink-2); }
.nav { display: flex; gap: 4px 18px; overflow-x: auto; scrollbar-width: none; font-size: 0.95rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; white-space: nowrap; padding-block: 6px; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brass-line); }
.nav a[aria-current="page"] { font-weight: 700; }
.login { font-size: 0.9rem; font-weight: 700; text-decoration: none; white-space: nowrap; padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 999px; }
.login:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .nav { order: 3; width: 100%; flex-wrap: wrap; overflow: visible; gap: 0 16px; } }
@media (max-width: 520px) { .mark span { display: none; } }

/* 首頁：一行五線譜 */
.hero { padding-block: clamp(36px, 7vw, 84px) clamp(40px, 6vw, 72px); }
.marking { font-family: var(--hand); color: var(--brass); font-size: 1.05rem; margin: 0 0 10px clamp(64px, 9vw, 104px); }
.system { position: relative; display: grid; grid-template-columns: clamp(52px, 8vw, 92px) 1fr; }
.system::before { /* 左邊連接五個聲部的譜表括線 */
  content: ""; position: absolute; left: calc(clamp(52px, 8vw, 92px) - 7px); top: 0.9em; bottom: 0.9em; width: 4px; background: var(--brass-line); border-radius: 2px;
}
.part { display: contents; }
.part span { font-family: var(--hand); font-size: clamp(0.85rem, 0.75rem + 0.4vw, 1.05rem); color: var(--ink-2); line-height: 1; padding-block: clamp(14px, 2.1vw, 26px); padding-right: 16px; text-align: right; }
.part i { align-self: center; height: 1.5px; background: var(--staff); transform-origin: left; animation: draw 0.9s cubic-bezier(.2,.7,.2,1) both; }
.part:nth-child(2) i { animation-delay: 0.06s; } .part:nth-child(3) i { animation-delay: 0.12s; }
.part:nth-child(4) i { animation-delay: 0.18s; } .part:nth-child(5) i { animation-delay: 0.24s; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.system h1 {
  position: absolute; left: calc(clamp(52px, 8vw, 92px) + clamp(10px, 3vw, 40px)); top: 50%; transform: translateY(-54%);
  font-size: clamp(3.2rem, 1.6rem + 8vw, 8.4rem); font-weight: 900; letter-spacing: 0.06em; line-height: 1; color: var(--ink);
}
.hero-row { margin: clamp(28px, 4vw, 44px) 0 0 clamp(64px, 9vw, 104px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-text { display: grid; gap: 18px; max-width: var(--measure); }
.art { width: 100%; max-width: 100%; aspect-ratio: 1400 / 1042; background: var(--art);
  -webkit-mask: url("art-mask.webp") center / contain no-repeat; mask: url("art-mask.webp") center / contain no-repeat; }
@media (max-width: 900px) { .hero-row { grid-template-columns: 1fr; } .art { max-width: 560px; } }
.hero-text .who { font-family: var(--serif); font-weight: 600; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); letter-spacing: 0.06em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1.5px solid var(--ink); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn:hover { border-color: var(--brass-line); }
@media (max-width: 520px) { .marking, .hero-row { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .part i { animation: none; } }

/* 區塊 */
main { flex: 1; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--paper); padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 8px; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); }
section.block { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.hero + .block { border-top: 1px solid var(--staff); }
.head { display: grid; gap: 10px; margin-bottom: clamp(24px, 4vw, 40px); }

/* 首頁：最近的紀錄 */
.recent { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 8px 24px; }
.recent .head { grid-column: 1 / -1; margin-bottom: 4px; }
.recent .prog, .recent .more { grid-column: 2; }
.more { justify-self: start; margin-top: 14px; font-weight: 700; text-decoration-color: var(--brass-line); text-underline-offset: 5px; }
@media (max-width: 600px) { .recent { grid-template-columns: 1fr; } .recent .prog, .recent .more, .recent .rm { grid-column: 1; } }

/* 關於 */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); }
.about p + p { margin-top: 1em; }
.facts { margin: 0; display: grid; gap: 18px; align-content: start; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-family: var(--hand); color: var(--brass); font-size: 1rem; }
.facts dd { margin: 0; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* 歷年紀錄：排練記號＋節目單 */
.years { display: grid; gap: clamp(32px, 5vw, 52px); }
.year { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 8px 24px; }
.rm { justify-self: start; align-self: start; font-family: var(--serif); font-weight: 900; font-size: 1.6rem; line-height: 1; padding: 8px 9px 7px; border: 2.5px solid var(--ink); font-variant-numeric: tabular-nums; }
.year h3 { grid-column: 2; align-self: center; }
.year h3 small { font-family: var(--sans); font-weight: 400; font-size: 0.85rem; color: var(--ink-2); margin-left: 8px; }
.prog { grid-column: 2; list-style: none; margin: 0; padding: 0; display: grid; }
.prog li { display: flex; align-items: baseline; gap: 10px; padding-block: 9px; border-bottom: 1px solid var(--wash); }
.prog .t { min-width: 0; }
.prog .t em { font-style: normal; display: block; font-size: 0.88rem; color: var(--ink-2); }
.prog .dots { flex: 1; min-width: 24px; border-bottom: 1.5px dotted var(--staff); transform: translateY(-5px); }
.prog .who { white-space: nowrap; color: var(--ink-2); font-size: 0.95rem; }
.award { display: inline-block; font-family: var(--serif); font-weight: 900; color: var(--brass); border: 1.5px solid var(--brass-line); border-radius: 4px; padding: 0 6px; margin-left: 8px; font-size: 0.85rem; line-height: 1.6; }
@media (max-width: 600px) {
  .year { grid-template-columns: 1fr; }
  .year h3, .prog { grid-column: 1; }
  .prog li { flex-wrap: wrap; gap: 0 10px; }
  .prog .dots { display: none; }
  .prog .who { white-space: normal; width: 100%; font-size: 0.88rem; }
}

/* 交流 */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); background: var(--hall); color: var(--on-hall); border-radius: 18px; padding: clamp(24px, 4vw, 44px); }
.feature h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 900; }
.feature .place { font-family: var(--hand); color: var(--hall-gold); font-size: 1.05rem; margin-bottom: 8px; }
.feature ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: start; }
.feature li { padding-left: 18px; position: relative; }
.feature li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 8px; height: 8px; border-radius: 50%; background: var(--hall-gold); }
.ties { margin-top: clamp(28px, 4vw, 40px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ties div { display: grid; gap: 6px; align-content: start; }
.ties .place { font-family: var(--hand); color: var(--brass); }
@media (max-width: 760px) { .feature, .ties { grid-template-columns: 1fr; } }

/* 照片與影音 */
.video { margin: 0; display: grid; gap: 10px; max-width: 860px; }
.video-frame { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--hall); }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video figcaption { font-weight: 500; }
.videos { margin-top: clamp(20px, 3vw, 28px); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* 加入我們 */
.join { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); }
.join .facts dd small { display: block; color: var(--ink-2); font-size: 0.88rem; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; padding-bottom: 8px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--staff); vertical-align: top; }
th { font-weight: 500; color: var(--ink-2); white-space: nowrap; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody th[scope="rowgroup"] { font-family: var(--hand); color: var(--brass); font-size: 1rem; padding-top: 16px; }
.note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-2); }
@media (max-width: 760px) { .join { grid-template-columns: 1fr; } }

/* 聯絡 */
.contact { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.contact div { display: grid; gap: 2px; min-width: 0; }
.contact dt { font-family: var(--hand); color: var(--brass); }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.contact a { text-decoration-color: var(--brass-line); text-underline-offset: 4px; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .contact { grid-template-columns: 1fr; } }

/* English */
.en { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(20px, 5vw, 56px); }
.en .page-title { letter-spacing: 0.01em; }
.en .body { display: grid; gap: 1em; max-width: var(--measure); font-family: var(--serif); line-height: 1.75; }
@media (max-width: 760px) { .en { grid-template-columns: 1fr; } }

/* 頁尾 */
footer { background: var(--hall); color: var(--on-hall); }
footer .wrap { padding-block: 32px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; font-size: 0.9rem; }
footer .wm { width: 170px; max-width: 100%; aspect-ratio: 900 / 638; flex: none; background: var(--hall-gold);
  -webkit-mask: url("wordmark-mask.webp") center / contain no-repeat; mask: url("wordmark-mask.webp") center / contain no-repeat; }
footer .meta { display: grid; gap: 6px; margin-left: auto; text-align: right; }
@media (max-width: 600px) { footer .meta { margin-left: 0; text-align: left; } }
footer .wrap.legal { padding-block: 0 22px; display: block; }
footer .legal div { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 14px; border-top: 1px solid var(--hall-line); font-size: 0.78rem; line-height: 1.6; color: var(--hall-dim); }
footer .legal strong { font-weight: 700; color: var(--on-hall); }
footer a { color: var(--on-hall); }

/* 找不到頁面 */
.lost { display: grid; gap: 18px; justify-items: start; }
