/* ─────────────────────────────────────────────────────────────
   EMBA E118 · Class Activities — Kinfolk / 原研哉 風格
   純白 + 灰白 + 暖灰 + 純黑 4 色系統
   字型：Inter + Noto Sans TC + JetBrains Mono
   手機優先 + 大留白
   ───────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FFFFFF;
  --bg-alt: #F7F5F2;
  --bg-deep: #ECE9E3;
  --ink: #1A1A1A;
  --ink-mid: #4A4A4A;
  --ink-soft: #8A8580;
  --ink-faint: #B8B4AD;
  --rule: rgba(26, 26, 26, 0.08);
  --rule-soft: rgba(26, 26, 26, 0.04);

  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ──────────────────────────────────────────────────────────────
   Page wrapper
   ────────────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  background: var(--bg);
}

.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

/* ──────────────────────────────────────────────────────────────
   Masthead (主頁開頭)
   ────────────────────────────────────────────────────────────── */
.masthead {
  margin-bottom: 56px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.brand-row .dot {
  width: 3px;
  height: 3px;
  background: var(--ink-soft);
  border-radius: 50%;
}

.masthead h1 {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 38px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--ink);
}

.masthead h1 .hl {
  font-weight: 300;
  color: var(--ink-mid);
}

.lead {
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-mid);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 32px;
}

.masthead-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
}

.masthead-meta .key {
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.masthead-meta .val {
  color: var(--ink-mid);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
}

/* ──────────────────────────────────────────────────────────────
   Index list (主頁活動列表)
   ────────────────────────────────────────────────────────────── */
.index-block {
  margin-bottom: 56px;
}

.index-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
}

.index-list {
  list-style: none;
  padding: 0;
}

.index-row {
  display: grid;
  grid-template-columns: 28px 72px 1fr max-content;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
  color: var(--ink-mid);
  font-weight: 300;
  width: 100%;
  text-align: left;
  transition: opacity 0.15s;
}

.index-row:hover { opacity: 0.7; }

.index-row:last-child { border-bottom: none; }

.index-row .ix-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  align-self: start;
  padding-top: 4px;
}

.index-row .ix-thumb {
  width: 72px;
  height: 72px;
  background: var(--bg-alt);
  overflow: hidden;
  border: 1px solid var(--rule);
}

.index-row .ix-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.index-row .ix-thumb-ph {
  width: 100%;
  height: 100%;
}

.index-row .ix-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.index-row .ix-title {
  color: var(--ink);
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-row .ix-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.index-row .ix-meta .sep {
  color: var(--ink-faint);
}

.index-row .ix-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
  align-self: center;
}

/* ──────────────────────────────────────────────────────────────
   Featured cards (最新一場活動，主頁突出顯示)
   ────────────────────────────────────────────────────────────── */
.featured-block {
  margin-bottom: 64px;
}

.feat-card {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 32px;
  transition: opacity 0.15s;
}

.feat-card:hover { opacity: 0.85; }

.feat-card .feat-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.feat-card .feat-eyebrow .sep {
  width: 30px;
  height: 1px;
  background: var(--rule);
}

.feat-card h3 {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-weight: 200;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
  color: var(--ink);
}

.feat-card .feat-photo {
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.feat-card .feat-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feat-card .feat-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────────
   Photo placeholder (tints)
   ────────────────────────────────────────────────────────────── */
.ph {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  overflow: hidden;
}

.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  pointer-events: none;
}

.ph-warm  { background: linear-gradient(170deg, #F5F0E8 0%, #E8DFD2 100%); }
.ph-cool  { background: linear-gradient(170deg, #F0F2F4 0%, #DCE0E5 100%); }
.ph-green { background: linear-gradient(170deg, #EEF1EB 0%, #D8DECD 100%); }
.ph-sand  { background: linear-gradient(170deg, #F6F1E8 0%, #EBE0CB 100%); }
.ph-ash   { background: linear-gradient(170deg, #F2F0EE 0%, #E0DCD7 100%); }
.ph-rose  { background: linear-gradient(170deg, #F5EFEC 0%, #E6D8D2 100%); }

.ph-mark {
  position: absolute;
  top: 24px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.ph-label {
  position: relative;
  font-family: 'Noto Sans TC', var(--font-sans);
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-mid);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}

.ph-sub {
  position: relative;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────────
   Footer (主頁)
   ────────────────────────────────────────────────────────────── */
footer.page-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

footer .foot-meta {
  margin-top: 18px;
}

footer .foot-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

footer .foot-meta {
  margin-top: 32px;
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ──────────────────────────────────────────────────────────────
   Detail overlay (詳情頁 — 全螢幕 modal)
   ────────────────────────────────────────────────────────────── */
.det-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.det-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.det-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-mid);
  text-transform: uppercase;
  transition: color 0.15s;
}

.det-back:hover { color: var(--ink); }

.det-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.det-action-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  transition: all 0.15s;
}

.det-action-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
}

.det-action-btn:disabled {
  color: var(--ink-faint);
  border-color: var(--rule);
  cursor: not-allowed;
}

.det-top-brand {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.det-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.det-hero {
  margin-bottom: 36px;
}

.det-hero-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.det-hero-meta .rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  align-self: center;
}

.det-hero h1 {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-weight: 200;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}

.det-hero .det-titleEn {
  font-family: var(--font-sans);
  font-weight: 200;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  letter-spacing: -0.005em;
}

.det-hero .det-loc {
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-mid);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

/* Cover photo */
.det-cover {
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.det-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.det-cover .ph { aspect-ratio: 3/2; }

/* Body */
.det-body {
  margin-bottom: 40px;
}

.det-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.det-summary {
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.95;
  color: var(--ink-mid);
  margin-bottom: 0;
}

.det-summary p {
  margin-bottom: 18px;
}

.det-summary p:last-child {
  margin-bottom: 0;
}

/* hero 詩感標題的著色 highlight (e.g. 「記住」) */
.masthead h1 .hl {
  color: var(--ink-mid);
  font-style: italic;
  font-weight: 200;
}

.det-highlights ul {
  list-style: none;
  padding: 0;
}

.det-highlights li {
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  font-weight: 300;
  padding: 12px 0;
  display: flex;
  gap: 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--rule-soft);
}

.det-highlights li::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  min-width: 24px;
}

.det-highlights li:last-child { border-bottom: none; }

/* Gallery */
.det-gallery {
  margin-top: 40px;
}

.det-gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.det-gallery-head .gh-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.det-gallery-head .gh-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.det-gallery-empty {
  padding: 48px 0;
  text-align: center;
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--rule);
}

.det-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gitem-wrap {
  position: relative;
}

.gitem {
  aspect-ratio: 1/1;
  background: var(--bg-alt);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: opacity 0.15s;
  display: block;
  width: 100%;
  padding: 0;
}

.gitem:hover { opacity: 0.85; }

.gitem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gitem .gnum {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  padding: 2px 6px;
  text-transform: uppercase;
}

.gitem .g-cover-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  background: var(--ink);
  color: var(--bg);
  padding: 3px 8px;
  text-transform: uppercase;
}

.gitem-download {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  z-index: 2;
  transition: all 0.15s;
}

.gitem-download:hover {
  background: var(--ink);
  color: var(--bg);
}

@media (min-width: 640px) {
  .det-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Detail navigation (prev / next) */
.det-nav {
  margin-top: 40px;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.det-nav button {
  flex: 1;
  padding: 20px 24px;
  border: 1px solid var(--rule);
  text-align: left;
  transition: all 0.15s;
  background: transparent;
}

.det-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.det-nav button:not(:disabled):hover {
  background: var(--bg-alt);
  border-color: var(--ink-soft);
}

.det-nav button .arrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.det-nav button .name {
  display: block;
  font-family: 'Noto Sans TC', var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--ink);
}

.det-nav button.right {
  text-align: right;
}

/* ──────────────────────────────────────────────────────────────
   Lightbox
   ────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.96);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.lb-close:hover { color: #FFF; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.lb-nav:hover:not(:disabled) { color: #FFF; }
.lb-nav:disabled { opacity: 0.2; cursor: not-allowed; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-stage {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-stage img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
}

.lb-meta {
  margin-top: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.lb-meta .lb-meta-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.lb-meta .lb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lb-meta a.lb-download {
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.15s;
  text-decoration: none;
}

.lb-meta a.lb-download:hover {
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.6);
}

.lb-cover-btn {
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.15s;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lb-cover-btn:hover:not(:disabled) {
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.6);
}

.lb-cover-btn.is-cover {
  color: #FFD66B;
  border-color: rgba(255, 214, 107, 0.4);
  cursor: default;
}

/* ──────────────────────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .page { padding: 56px 22px 100px; }
  .masthead { margin-bottom: 80px; }
  .masthead h1 {
    font-size: 30px;
    line-height: 1.4;
  }
  .lead { font-size: 14px; }
  .det-container { padding: 40px 22px 100px; }
  .det-hero h1 { font-size: 26px; line-height: 1.3; }
  .det-hero .det-titleEn { font-size: 16px; }
  .det-summary { font-size: 15px; }
  .det-nav { flex-direction: column; }
}
