/* ===== 2026 東興圳光藝節 — Style A「海報直送」共用設計系統 =====
   PROVENANCE: req — 依 DESIGN_DIRECTIONS.md §0/§1/§2 改版。
   本檔為第一階段：既有 class 名稱全數保留，改套新系統樣式；
   要刪除的視覺用 display:none 或空規則處理，避免其餘 8 頁在過渡期壞掉。 */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

@font-face {
  font-family: 'Gopher';
  src: url("../fonts/Gopher-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gopher';
  src: url("../fonts/Gopher-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gopher';
  src: url("../fonts/Gopher-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gopher';
  src: url("../fonts/Gopher-Heavy.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* 六個色彩 token（不得新增） */
  --c-pink:   #E10098;
  --c-yellow: #EDE939;
  --c-blue:   #004C97;
  --c-green:  #7ACC00;
  --c-black:  #141110;
  --c-silver: #D9D6D2;

  /* 允許的兩個衍生值 + 髮線 */
  --c-panel-solid: #1E1B19;
  --c-text-dim-solid: #A9A5A1;
  --c-hairline: rgba(217, 214, 210, .2);

  /* 尺度 token：字級 7 階（全站只用這七個） */
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.75rem;
  --fs-xl: 2.5rem;
  --fs-display: clamp(3rem, 9vw, 7rem);

  /* 間距 8px 倍數 */
  --sp-1: .5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-6: 3rem;
  --sp-8: 4rem;
  --sp-12: 6rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
  background: var(--c-black);
  color: var(--c-silver);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Gopher', 'Noto Sans TC', sans-serif; font-weight: 700; }

/* nav 高度常數：非佈局定位 px，供 hero 內文避開透明 nav 覆蓋區使用 */
:root { --nav-h: 76px; }

a { text-decoration: none; color: inherit; }

button { font-family: inherit; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--sp-3);
}

.section {
  padding: var(--sp-8) 0;
}

.section-title {
  position: relative;
  text-align: left;
  margin-bottom: var(--sp-6);
}

.section-title h2 {
  font-size: var(--fs-lg);
  color: var(--c-silver);
  letter-spacing: 2px;
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
}

.section-title p {
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-dim-solid);
  letter-spacing: .5px;
  max-width: 60ch;
}

/* ===== Navigation：透明底單列，捲動後轉黑實底 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--c-black); /* 實底：子頁頁首有高彩圖形，透明導覽列文字會看不清 */
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}

.navbar.scrolled {
  background: var(--c-black);
  border-bottom: 1px solid var(--c-hairline);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.navbar-logo {
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
  font-size: var(--fs-base);
  font-weight: 900;
  color: var(--c-silver);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  letter-spacing: 1px;
  white-space: nowrap;
}

.navbar-logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.navbar-logo img { height: 48px; width: auto; display: block; }

.navbar-menu {
  display: flex;
  list-style: none;
  gap: var(--sp-4);
}

.navbar-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-silver);
  transition: color .25s;
  position: relative;
  padding: 6px 2px;
}

.navbar-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--c-yellow);
  transition: width .3s, left .3s;
}

.navbar-menu a:hover { color: var(--c-yellow); }
.navbar-menu a:hover::after { width: 100%; left: 0; }
.navbar-menu a.active { color: var(--c-yellow); font-weight: 500; }
.navbar-menu a.active::after { width: 100%; left: 0; }

.menu-toggle {
  display: none;
  position: relative;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--c-silver);
  transition: top .25s, opacity .2s, transform .25s;
}
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 8px; }
.menu-toggle span:nth-child(3) { top: 16px; }

.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* ===== Page Hero (子頁頁首) ===== */
.page-hero {
  position: relative;
  height: clamp(240px, 38vh, 400px);
  padding-top: var(--nav-h);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: left;
  background: var(--c-black);
  overflow: hidden;
  border-bottom: 1px solid var(--c-hairline);
}

.page-hero-kv {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--kv-x, 50%) var(--kv-y, 50%);
  transform: scale(var(--kv-scale, 1.4));
  transform-origin: var(--kv-x, 50%) var(--kv-y, 50%);
  opacity: 0;
  animation: heroKvIn .5s ease-out forwards;
}

@keyframes heroKvIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 0 var(--sp-3) var(--sp-6);
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  opacity: 0;
  animation: heroContentIn .5s ease-out .35s forwards;
}

@keyframes heroContentIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-hero-plate {
  display: inline-block;
  background: var(--c-black);
  padding: var(--sp-2) var(--sp-3);
  transform: rotate(-4deg);
  transform-origin: left bottom;
}

.page-hero-content h1 {
  font-size: var(--fs-xl);
  font-weight: 900;
  color: var(--c-silver);
  margin-bottom: var(--sp-1);
  letter-spacing: 2px;
  line-height: 1.3;
}

.page-hero-content .subtitle {
  font-size: var(--fs-base);
  color: var(--c-silver);
  letter-spacing: 1px;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  .page-hero-kv, .page-hero-content { opacity: 1; animation: none; }
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-panel-solid);
  border-bottom: 1px solid var(--c-hairline);
  font-size: var(--fs-sm);
  color: var(--c-text-dim-solid);
}

.breadcrumb ol {
  max-width: 1192px; /* 對齊 .container 內容左緣 */
  width: 100%;
  margin: 0 auto;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
}

.breadcrumb a { color: var(--c-yellow); transition: color .3s; }
.breadcrumb a:hover { color: var(--c-silver); }
.breadcrumb .sep { margin: 0 8px; color: var(--c-text-dim-solid); }

/* ===== Pill Filter Buttons ===== */
.pill-btn {
  padding: 9px 22px;
  border: 1px solid var(--c-hairline);
  border-radius: 0;
  background: var(--c-panel-solid);
  color: var(--c-text-dim-solid);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color .25s, color .25s, background .25s;
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
}

.pill-btn:hover { border-color: var(--c-yellow); color: var(--c-silver); }

.pill-btn[aria-pressed="true"] {
  background: var(--c-yellow);
  color: var(--c-black);
  border-color: var(--c-yellow);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--sp-2);
}

/* ===== Cards：無框無底，圖片為主 ===== */
.card {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  transition: none;
  display: block;
}

.card:hover { color: inherit; }
/* hover 選定：圖說變黃（全站一致，取代舊版上浮＋外光暈） */
.card:hover .card-caption,
.card:hover .card-body h3 { color: var(--c-yellow); }

.card-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--c-panel-solid);
}

.card-visual svg { width: 60%; height: 60%; }

.card-body { padding: var(--sp-2) 0; }

.card-body h3 {
  font-size: var(--fs-md);
  color: var(--c-silver);
  margin-bottom: 6px;
  letter-spacing: 1px;
  transition: color .25s;
}

.card-body .en {
  display: block;
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
  font-size: var(--fs-xs);
  color: var(--c-text-dim-solid);
  letter-spacing: 1px;
  margin-bottom: var(--sp-1);
}

.card-body .desc {
  font-size: var(--fs-sm);
  color: var(--c-text-dim-solid);
  line-height: 1.75;
}

/* ===== Real photo overlay on card/modal visuals ===== */
.card-visual, .modal-visual { position: relative; }
.card-visual img, .modal-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: var(--fs-xs);
  background: rgba(20, 17, 16, .6);
  color: var(--c-silver);
  padding: 2px 8px;
  border-radius: 0;
  z-index: 2;
  pointer-events: none;
}

/* 精選作品圖說：無框圖片左下疊字，例：「7｜水月銀灣」 */
.card-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  color: var(--c-silver);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .5px;
  padding: var(--sp-1) var(--sp-2);
  background: rgba(20, 17, 16, .72);
  transition: color .25s;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 0;
  font-size: var(--fs-xs);
  background: var(--c-panel-solid);
  color: var(--c-text-dim-solid);
  margin: 0 6px 6px 0;
}

.tag.tag-pink   { background: var(--c-pink);   color: var(--c-silver); }
.tag.tag-yellow { background: var(--c-yellow); color: var(--c-black); }
.tag.tag-blue   { background: var(--c-blue);   color: var(--c-silver); }
.tag.tag-green  { background: var(--c-green);  color: var(--c-black); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 34px;
  border-radius: 0;
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: 1px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s;
}

.btn-primary {
  background: var(--c-pink);
  color: var(--c-black);
}
.btn-primary:hover { background: var(--c-yellow); }

.btn-outline {
  background: transparent;
  color: var(--c-silver);
  border-color: var(--c-hairline);
}
.btn-outline:hover { border-color: var(--c-yellow); color: var(--c-yellow); }

.btn-toggle {
  background: transparent;
  color: var(--c-silver);
  border-color: var(--c-hairline);
}
.btn-toggle:hover { border-color: var(--c-yellow); color: var(--c-yellow); }
.btn-toggle[aria-pressed="true"] {
  background: var(--c-yellow);
  color: var(--c-black);
  border-color: var(--c-yellow);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}

.tab-btn {
  padding: 12px 26px;
  background: var(--c-panel-solid);
  border: 1px solid var(--c-hairline);
  color: var(--c-text-dim-solid);
  border-radius: 0;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
  transition: background .25s, border-color .25s, color .25s;
}

.tab-btn[aria-selected="true"] {
  background: var(--c-yellow);
  color: var(--c-black);
  border-color: var(--c-yellow);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ===== Accordion ===== */
.accordion-item {
  border: 1px solid var(--c-hairline);
  border-radius: 0;
  margin-bottom: var(--sp-1);
  overflow: hidden;
  background: var(--c-panel-solid);
}

.accordion-trigger {
  width: 100%;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: none;
  color: var(--c-silver);
  font-size: var(--fs-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-trigger .icon {
  transition: transform .3s;
  color: var(--c-yellow);
  flex-shrink: 0;
  margin-left: var(--sp-2);
}

.accordion-trigger[aria-expanded="true"] .icon { transform: rotate(45deg); }

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.accordion-panel-inner {
  padding: 0 var(--sp-3) var(--sp-3);
  color: var(--c-text-dim-solid);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 16, .85); /* --c-black + alpha */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--sp-3);
}

.modal-overlay.is-open { display: flex; }

body.modal-open { overflow: hidden; }

.modal-box {
  background: var(--c-panel-solid);
  border: 1px solid var(--c-hairline);
  border-radius: 0;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: rgba(217, 214, 210, .1);
  border: none;
  color: var(--c-silver);
  font-family: 'Noto Sans TC', sans-serif; /* Gopher 的 × 字形過小 */
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--c-pink); color: var(--c-black); }

.modal-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-panel-solid);
}
.modal-visual svg { width: 40%; height: 40%; }

.modal-body { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
.modal-body h3 { font-size: var(--fs-lg); color: var(--c-silver); margin-bottom: 4px; }
.modal-body .en { display: block; font-family: 'Gopher', 'Noto Sans TC', sans-serif; color: var(--c-text-dim-solid); margin-bottom: var(--sp-2); letter-spacing: 1px; }
.modal-body p { color: var(--c-text-dim-solid); font-size: var(--fs-base); margin-bottom: var(--sp-2); }
.modal-body .modal-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-2); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--c-panel-solid);
  border: 1px solid var(--c-green);
  color: var(--c-silver);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0;
  font-size: var(--fs-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 3000;
}

.toast.is-visible {
  opacity: 1;
}

/* ===== Search input ===== */
.search-field {
  position: relative;
  max-width: 360px;
  margin: 0 0 var(--sp-4);
}

.search-field input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: 0;
  border: 1px solid var(--c-hairline);
  background: var(--c-panel-solid);
  color: var(--c-silver);
  font-size: var(--fs-sm);
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
}

.search-field input:focus-visible { outline: 2px solid var(--c-yellow); outline-offset: 2px; }

.search-field svg {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  color: var(--c-text-dim-solid);
}

/* 篩選／搜尋空狀態 */
.empty-state {
  text-align: left;
  color: var(--c-silver);
  font-size: var(--fs-sm);
  padding: var(--sp-4) 0;
}

/* ===== Grid helpers ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }

/* ===== Footer ===== */
.footer {
  background: var(--c-black);
  color: var(--c-text-dim-solid);
  padding: var(--sp-8) 0 var(--sp-3);
  border-top: 1px solid var(--c-hairline);
}

.footer-content {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-4);
}

.footer h4 {
  color: var(--c-silver);
  font-size: var(--fs-base);
  margin-bottom: var(--sp-2);
  letter-spacing: 1px;
  font-family: 'Gopher', 'Noto Sans TC', sans-serif;
}

.footer p { font-size: var(--fs-sm); line-height: 2; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: var(--sp-1); }
.footer-links a { font-size: var(--fs-sm); color: var(--c-text-dim-solid); transition: color .3s; }
.footer-links a:hover { color: var(--c-pink); }

.footer-social { display: flex; gap: var(--sp-1); margin-top: var(--sp-1); }

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: rgba(217, 214, 210, .08);
  transition: background .3s;
}
.footer-social a:hover { background: var(--c-pink); }
.footer-social svg { width: 18px; height: 18px; fill: var(--c-silver); }

.footer-orgs {
  text-align: left;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--c-hairline);
  border-bottom: 1px solid var(--c-hairline);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-dim-solid);
  line-height: 2;
}
.footer-orgs span { color: var(--c-text-dim-solid); margin: 0 8px; opacity: .6; }

.footer-bottom {
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--c-text-dim-solid);
}
.footer-bottom .disclaimer {
  margin-top: 6px;
  color: var(--c-text-dim-solid);
  opacity: .8;
  font-size: var(--fs-xs);
}

/* ===== Screen Reader Only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Focus visibility ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-yellow);
  outline-offset: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .footer-content { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .navbar-menu {
    display: none;
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    overflow-y: auto;
    background: var(--c-black);
    flex-direction: column;
    align-items: center;
    padding: var(--sp-4) 0;
    gap: var(--sp-3);
    border-bottom: 1px solid var(--c-hairline);
  }
  .navbar-menu.is-open { display: flex; }
  .menu-toggle { display: block; }
  .page-hero-content h1 { font-size: var(--fs-lg); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .page-hero-content h1 { font-size: var(--fs-md); letter-spacing: 1px; }
  .page-hero-content .subtitle { font-size: var(--fs-sm); letter-spacing: .5px; }
  .footer-content { grid-template-columns: 1fr; gap: var(--sp-4); }
  .section { padding: var(--sp-6) 0; }
}

@media (max-width: 375px) {
  .page-hero-content h1 { font-size: var(--fs-base); letter-spacing: 1px; }
  .section-title h2 { font-size: var(--fs-md); }
  .container { padding: 0 var(--sp-2); }
  .footer-orgs { font-size: var(--fs-xs); }
  .navbar-logo { font-size: var(--fs-sm); }
  .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}
