/* /brand 視覺識別頁。
   顏色只用 style.css :root 的 --ci-*（識別手冊 A-08、A-09 的色票），字級只用 tokens.json 的 7 級。
   這一頁只有白天（識別的顏色是印在紙上的顏色）；節奏照問卷 q604「開闊、放鬆、平靜、沉穩、包容、想像」：留白多、動得慢。 */

.ci {
  --bg: var(--ci-paper);
  --text: var(--ci-navy);
  --sub: var(--ci-sub);
  --line: var(--ci-line);
  --ink-btn: var(--ci-navy);
  --ink-btn-text: var(--ci-paper);
  background: var(--ci-paper);
  color: var(--ci-navy);
}
.ci :focus-visible { outline-color: var(--ci-sea); }
.ci .skip { background: var(--ci-navy); color: var(--ci-paper); }

/* 標題：jx.js 把 data-jx 的字換成 jf金萱 的外框（SVG），原文字留給螢幕閱讀器 */
.jx-svg { display: block; max-width: 100%; height: auto; fill: currentColor; overflow: visible; }
.jx-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 頁首 ---------- */
.ci-home img { height: 48px; width: auto; }   /* 橫式在螢幕上最小高 48 px（A-07） */

/* ---------- 首屏 ---------- */
.ci-hero {
  display: grid; gap: 2rem; align-items: center;
  padding-block: clamp(1.5rem, 5vw, 3rem) clamp(2rem, 6vw, 4rem);
}
.ci-hero h1 { font-size: clamp(2.6rem, 9vw, 3.6rem); font-weight: 900; line-height: 1.23; }
.ci-lead { margin-top: 1.2rem; max-width: 30em; text-wrap: pretty; font-size: 1.18rem; line-height: 1.85; color: var(--sub); }
.ci-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn-ci, .btn-ci-line { flex-direction: column; align-items: flex-start; gap: 0; border-radius: 12px; line-height: 1.4; }
.btn-ci { background: var(--ci-navy); color: var(--ci-paper); border-color: var(--ci-navy); }
.btn-ci-line { background: transparent; color: var(--ci-navy); border-color: var(--ci-navy); }
.btn-ci small, .btn-ci-line small { font-size: .8rem; font-weight: 400; opacity: .8; }
/* 手機上標誌動畫放在最前面（動畫為主），桌機放右邊 */
.ci-hero-mark { order: -1; margin: 0; justify-self: center; width: min(56vw, 260px); text-align: center; }
.ci-hero-mark svg { display: block; width: 100%; height: auto; }
.ci-pause { margin-top: .5rem; font-size: .8rem; color: var(--sub); text-decoration: underline; text-underline-offset: 3px; padding: .5rem; }
@media (min-width: 900px) {
  .ci-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(78vh, 760px); }
  .ci-hero-mark { order: 0; width: min(26vw, 300px); }
}

/* 方磚牆：首屏下面一整條，一格一格慢慢推換 */
.ci-wall { overflow: hidden; line-height: 0; }
.ci-wall svg { display: block; width: 100%; height: auto; }

/* ---------- 區塊 ---------- */
.ci-sec { padding-block: clamp(3rem, 9vw, 6.5rem); }
.ci-band { background: var(--surface); border-block: 1px solid var(--ci-line); }
.ci-band.is-navy { background: var(--ci-navy); color: var(--ci-paper); border: 0; --sub: var(--ci-paper); }
.ci-ref { font-size: .8rem; font-weight: 700; color: var(--sub); letter-spacing: .04em; }
.ci-sec h2 { margin-top: .5rem; font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 900; line-height: 1.23; }
.ci-h3 { margin-top: 2.5rem; font-size: 1.18rem; font-weight: 700; }
.ci-p { margin-top: 1rem; max-width: 36em; font-size: 1.18rem; line-height: 1.85; }
.ci-note { margin-top: 1rem; font-size: .92rem; color: var(--sub); }
.ci-notes { margin-top: 2rem; display: grid; gap: .25rem; font-size: .92rem; color: var(--sub); }

/* 規範表：上下兩條深藍粗線、中間淺灰線，跟手冊一樣 */
.ci-table { width: 100%; max-width: 760px; margin-top: 2rem; border-collapse: collapse; border-block: 2px solid currentColor; font-size: .92rem; }
.ci-table th, .ci-table td { padding: .75rem .5rem .75rem 0; text-align: left; vertical-align: top; border-top: 1px solid var(--ci-line); line-height: 1.7; }
.ci-table tr:first-child > * { border-top: 0; }
.ci-table th { width: 7.5em; font-weight: 500; color: var(--sub); }
.ci-table thead th { font-weight: 700; }
.ci-table-4 th { width: auto; }

/* ---------- 標誌：四塊磚 ---------- */
.ci-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2.5rem; max-width: 760px; }
.ci-tiles li { font-size: .92rem; font-weight: 700; }
.ci-tiles svg, .ci-theme-tiles svg, .ci-roles svg { display: block; width: 100%; height: auto; margin-bottom: .75rem; outline: 1px solid var(--ci-line); }
.ci-tiles b { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: .5rem; border: 2px solid currentColor; border-radius: 50%; font-family: var(--en); font-size: .8rem; }
@media (min-width: 700px) { .ci-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ci-forms { display: grid; gap: 1.5rem; margin-top: 3rem; }
.ci-forms figure { margin: 0; }
.ci-form-box { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 10%; background: var(--surface); border: 1px solid var(--ci-line); }
.ci-form-box.is-navy { background: var(--ci-navy); border-color: var(--ci-navy); }
.ci-form-box img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.ci-forms figcaption { margin-top: .5rem; font-size: .92rem; color: var(--sub); }
@media (min-width: 700px) { .ci-forms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- 子識別：點選預覽 ---------- */
.ci-picker { display: grid; gap: 1.5rem; margin-top: 2rem; align-items: start; }
/* 手機上標誌在選項上面：縮小一點，點磚的時候標誌還在畫面裡 */
.ci-picker-mark { margin: 0; justify-self: center; width: min(50vw, 300px); }
.ci-picker-mark svg { display: block; width: 100%; height: auto; }
.ci-hint { margin: 0 0 1.5rem; font-size: .92rem; color: var(--sub); }
.ci-hint-drag { display: none; }
.ci-choice { margin: 0 0 1.5rem; padding: 0; border: 0; }
.ci-choice legend { font-size: .92rem; font-weight: 700; color: var(--sub); margin-bottom: .75rem; }
/* 選項就是磚：主題選主題磚，參與方式選上了那個顏色的浪磚。滑過去時磚會把自己的動法演一次（brand.js） */
.ci-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; max-width: 420px; }
.ci-opt { display: block; text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ci-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ci-opt svg { display: block; width: 100%; height: auto; aspect-ratio: 1; outline: 1px solid var(--ci-line); transition: transform .25s var(--ease); }
.ci-opt span { display: block; margin-top: .5rem; font-size: .8rem; font-weight: 700; line-height: 1.4; color: var(--sub); }
.ci-opt:hover svg { transform: translateY(-4px); }
.ci-opt input:checked ~ svg { outline: 3px solid var(--ci-navy); outline-offset: 3px; }
.ci-opt input:checked ~ span { color: var(--ci-navy); }
.ci-opt input:focus-visible ~ svg { outline: 3px solid var(--ci-sea); outline-offset: 3px; }
/* 拖拉：只在有滑鼠的裝置。拖著的磚跟著游標走，標誌畫虛線框表示可以放 */
@media (hover: hover) and (pointer: fine) {
  .ci-hint-drag { display: inline; }
  .ci-hint-tap { display: none; }
  .ci-opt svg { cursor: grab; }
}
.ci-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; outline: 1px solid var(--ci-line); }
.ci-picker-mark svg { outline: 2px dashed transparent; outline-offset: 10px; transition: outline-color .2s; }
.ci-picker-mark.is-drop svg { outline-color: var(--ci-line); }
.ci-picker-mark.is-over svg { outline-color: var(--ci-navy); }
.is-dragging, .is-dragging * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.ci-rule-name { font-size: 1.18rem; font-weight: 700; }
.ci-rule-name span { display: block; margin-top: .25rem; font-size: .92rem; font-weight: 400; color: var(--sub); }
@media (min-width: 900px) {
  .ci-picker { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 4rem; margin-top: 2.5rem; }
  .ci-picker-mark { width: 100%; }
}

/* ---------- 主題磚、身分圖示 ---------- */
.ci-theme { display: grid; gap: 2rem; margin-top: 2.5rem; align-items: start; }
.ci-grid12 { margin: 0; max-width: 420px; }
.ci-grid12 svg { display: block; width: 100%; height: auto; }
.ci-theme-tiles, .ci-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 520px; font-size: .92rem; font-weight: 700; }
.ci-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; max-width: 760px; margin-top: 2.5rem; font-weight: 400; color: var(--sub); }
.ci-roles b { display: block; font-size: 1.18rem; color: var(--ci-navy); }
@media (min-width: 700px) { .ci-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .ci-theme { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 4rem; } }

/* ---------- 顏色 ---------- */
.ci-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; margin-top: 1rem; }
.ci-swatches li { display: flex; flex-direction: column; font-size: .8rem; color: var(--sub); line-height: 1.6; }
.ci-swatches i { display: block; aspect-ratio: 4 / 3; margin-bottom: .5rem; background: var(--sw); border: 1px solid var(--ci-line); }
.ci-swatches b { font-size: .92rem; color: var(--ci-navy); }
.ci-swatches.is-small i { aspect-ratio: 3 / 2; }
@media (min-width: 700px) {
  .ci-swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ci-swatches.is-small { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .ci-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ci-swatches.is-small { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
.c-navy { --sw: var(--ci-navy); } .c-paper { --sw: var(--ci-paper); } .c-sea { --sw: var(--ci-sea); }
.c-sand { --sw: var(--ci-sand); } .c-coral { --sw: var(--ci-coral); } .c-mint { --sw: var(--ci-mint); }
.c-team { --sw: var(--ci-team); } .c-learn { --sw: var(--ci-learn); } .c-serve { --sw: var(--ci-serve); }
.c-farm { --sw: var(--ci-farm); } .c-slow { --sw: var(--ci-slow); } .c-pink { --sw: var(--ci-pink); }
.c-lilac { --sw: var(--ci-lilac); } .c-clay { --sw: var(--ci-clay); }

/* ---------- 字體 ---------- */
.ci-type { display: grid; gap: 2rem; margin-top: 2rem; align-items: start; }
.ci-specimen { padding: 2rem; background: var(--surface); border: 1px solid var(--ci-line); }
.ci-specimen-big { font-size: clamp(2.6rem, 9vw, 3.6rem); font-weight: 700; line-height: 1.23; }
.ci-specimen-name { margin-top: 1rem; font-size: .92rem; color: var(--sub); }
.ci-type .ci-table { margin-top: 0; }
@media (min-width: 900px) { .ci-type { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }

/* ---------- 應用 ---------- */
.ci-gallery { display: grid; gap: 1.5rem; margin-top: 2rem; }
.ci-gallery figure { margin: 0; }
.ci-gallery img { width: 100%; height: auto; border: 1px solid var(--ci-line); }
.ci-gallery figcaption { margin-top: .5rem; font-size: .92rem; color: var(--sub); line-height: 1.7; }
@media (min-width: 900px) {
  .ci-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  .ci-gallery .is-wide { grid-column: 1 / -1; }
  .ci-gallery .is-tall img { max-height: 560px; width: auto; }
}

/* ---------- 動態 ---------- */
.ci-video { margin: 2rem 0 0; }
.ci-video video { display: block; width: 100%; height: auto; background: var(--ci-navy); }
.ci-video figcaption { margin-top: .5rem; font-size: .92rem; color: var(--sub); }

/* ---------- 與青年署並列（A-24）：中心橫式在左、青年署在右，中間一塊磚的距離加一條細線 ---------- */
.ci-lockup { --h: 48px; display: flex; align-items: center; justify-content: center; gap: calc(var(--h) / 4); }
.ci-lockup img { height: var(--h); width: auto; }
.ci-lockup img + i + img { height: auto; width: calc(var(--h) * 2); }
.ci-lockup i { width: 1px; height: calc(var(--h) * .7); background: var(--ci-line); }
.ci-lockup-big { --h: clamp(56px, 12vw, 96px); justify-content: flex-start; margin-top: 2.5rem; }
.ci-foot { padding-block: 3rem; }
.ci-foot .foot-links { margin-top: 1.5rem; }

/* ---------- 下載 ---------- */
.ci-dl { display: grid; gap: 1rem; margin-top: 2rem; max-width: 760px; }
.ci-dl a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding: 1rem 1.5rem; border: 1.5px solid var(--ci-navy); border-radius: 12px; transition: background .3s, color .3s; }
.ci-dl a:hover { background: var(--ci-navy); color: var(--ci-paper); }
.ci-dl b { font-size: 1.18rem; }
.ci-dl span { font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  .ci-opt svg, .ci-picker-mark svg, .ci-dl a { transition: none; }
}
