/*
  CSS by Spark Tsang
  sparktsang.github.io
  License: MIT
*/

/* ── 藝術字體 Logo 容器 ── */
h1.artistic-title {
	margin: 0 0 clamp(1.5rem, 3vh, 2rem) 0;
	display: flex;
	align-items: flex-start;
}

/* 控制藝術字的尺寸 */
h1.artistic-title img {
	display: block;
	width: 100%;
	max-width: 400px;
	height: auto;
	object-fit: contain;
	object-position: left center;
	filter: drop-shadow(0 0 10px rgba(255,255,255,0.05)); 
	transform: translateX(-17px); 
}

.exhibition-title {
  margin: 0;
  padding: 0 16px;
  text-align: center;
}

.exhibition-title img {
  display: block;
  margin: 0 auto;

  width: min(23vw, 900px);   /* 闊度：控制大細 */
  height: auto;				/* 高度：控制大細 */
  aspect-ratio: 2.64 / 1;      /* 拉伸後嘅闊高比：改呢個控制拉高/壓扁 */
  object-fit: fill;           /* 拉伸、不裁切 */
  max-width: none;
  max-height: none;
}

@media (max-width: 768px) {
  .exhibition-title img {
    width: 50vw;          /* 手機用多啲闊度 */
    aspect-ratio: 2.64 / 1; /* 比例保持一樣 → 唔會變形 */
  }
}

.exhibition-title-chi img {
  display: block;
  margin: 0 auto;

  width: min(18vw, 900px);
  height: auto;
  aspect-ratio: 2.2 / 1;
  object-fit: fill;
  max-width: none;
  max-height: none;
}

@media (max-width: 768px) {
  .exhibition-title-chi img {
    width: 40vw;
    aspect-ratio: 2.2 / 1;
  }
}

.index_text {
    font-size: 0.8em;
    list-style: none;
    padding-left: 0;
	color: rgba(150, 150, 150, 0.8);
}

.post-highlight-msg {
    padding: 1.5rem;
    background: rgba(66, 133, 244, 0.05);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    margin-bottom: 2.5rem;
    font-size: 0.95em;
    color: var(--muted);
    line-height: 1.6;
}

.post-highlight-msg p:last-child {
    margin-bottom: 0 !important;
}

/* ── 開源共創宣言區塊 (Curator/Builder Note) ── */
.lib_correct {
	margin: 6rem auto 4rem; /* 增加上方空間，與圖表拉開距離 */
	padding: 2.5rem 3rem;
	max-width: 800px; /* 限制寬度，讓閱讀視線更集中，不像頁尾版權宣告橫跨全螢幕 */
	
	/* 使用虛線邊框，強烈暗示「這是一個開放修改的區域 / Work in Progress」 */
	border: 1px dashed var(--card-border); 
	border-radius: var(--radius);
	
	/* 極其微弱的背景色，區分空間但不過度搶眼 */
	background-color: rgba(128, 128, 128, 0.03); 
	
	color: var(--muted);
	font-size: 0.9em;
	line-height: 1.8;
}

/* 標題設計：打破常規，採用標籤/Meta風格 */
.lib_correct h3 {
	margin-top: 0;
	margin-bottom: 1.5rem;
	font-size: 0.75em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; /* 等寬字體帶出 Hacker/Open-source 氛圍 */
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--text);
	display: inline-block;
	
	/* 左側加上一條細細的 Accent 線條，增加精緻感 */
	padding-left: 0.8rem;
	border-left: 3px solid var(--accent);
}

/* 讓段落之間有呼吸空間 */
.lib_correct p {
	margin-bottom: 1.2rem;
}
.lib_correct p:last-child {
	margin-bottom: 0;
}

/* 連結特效：強調「參與」與「行動」 */
.lib_correct a {
	color: var(--text);
	text-decoration: none;
	/* 用 Accent 顏色的點狀底線，比一般連結更有科技感與互動感 */
	border-bottom: 1px dotted var(--accent); 
	transition: all 0.3s ease;
}

.lib_correct a:hover {
	color: var(--accent);
	border-bottom: 1px solid var(--accent);
	background-color: rgba(66, 133, 244, 0.05); /* 輕微的 Highlight 效果 */
}

/* 手機版適配 */
@media (max-width: 768px) {
	.lib_correct {
		padding: 1.5rem;
		margin: 4rem 1rem 3rem;
	}
}

.watermark-caption {
	text-align: left;
	font-size: 0.75rem;
	color: var(--muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	letter-spacing: 0.05em;
	margin-bottom: 3rem;
	opacity: 0.7;
}

/* ── Artifacts 專屬圖片展示樣式 ── */
.image.main.artifact-display {
	text-align: center;
	margin: 2rem 0 4rem 0; /* 與上下文字拉開呼吸空間 */
}

.image.main.artifact-display img {
	width: 80%; /* 縮小寬度，避免假 UI 混淆 */
	max-width: 1000px;
	margin: 0 auto;
	display: block;
	border-radius: 12px; /* 微圓角，增加現代感與精緻度 */
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* 深刻的陰影，讓圖片「浮」起來 */
	border: 1px solid rgba(255, 255, 255, 0.05); /* 極細微的邊框，定義物件邊界 */
}

/* 手機版適配：在小螢幕上可以恢復 100% 寬度以保證清晰度 */
@media (max-width: 768px) {
	.image.main.artifact-display img {
		width: 100%;
		border-radius: 6px;
	}
}

.artifact-terminal-btn {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.85rem;
	letter-spacing: 0.15em;
	color: var(--accent); /* 使用你網站的亮色/點綴色 */
	background: transparent;
	padding: 1.2rem 2.5rem;
	border: 1px solid var(--accent);
	border-radius: 4px;
	text-decoration: none;
	text-transform: uppercase;
	transition: all 0.3s ease;
	box-shadow: 0 0 10px rgba(66, 133, 244, 0.1); /* 微微的霓虹發光感，可按你網站的主題色調整 RGB */
}

.artifact-terminal-btn:hover {
	background: var(--accent);
	color: var(--page-bg);
	box-shadow: 0 0 20px rgba(66, 133, 244, 0.4);
}

.blink-cursor {
	animation: blinker 1s linear infinite;
	margin-right: 5px;
}

@keyframes blinker {
	50% { opacity: 0; }
}

.library-nav-container {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-top: 8rem;
	padding-top: 3rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08); /* 柔和的頂部分隔線 */
}

.library-nav-side {
	flex: 1;
	max-width: 45%; /* 確保標題太長時不會互相碰撞 */
}
.text-right {
	text-align: right;
}

.library-nav-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* 平滑的物理慣性過渡 */
}

/* Meta 標籤：微小、等寬、淡色 */
.library-nav-link .nav-meta {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.75rem;
	color: var(--muted);
	letter-spacing: 0.15em;
	text-transform: uppercase;
	margin-bottom: 0.6rem;
	transition: color 0.3s ease;
}

/* 內容標題：放大、優雅、作為視覺重點 */
.library-nav-link .nav-title {
	font-size: 1.15rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--text);
	transition: color 0.3s ease;
}

/* 懸停微互動 (Hover Micro-interactions) */
.library-nav-link.prev:hover {
	transform: translateX(-6px); /* 向左微微滑動 */
}
.library-nav-link.next:hover {
	transform: translateX(6px);  /* 向右微微滑動 */
}
.library-nav-link:hover .nav-meta,
.library-nav-link:hover .nav-title {
	color: var(--accent); /* 字體發亮 */
}

/* 返回按鈕區域 */
.library-nav-back {
	text-align: center;
	margin-top: 4rem;
}
.library-nav-back .back-link {
	display: inline-block;
	font-family: var(--font-ui), sans-serif;
	font-size: 0.8rem;
	font-weight: bold;
	color: #888;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.8rem 1.5rem;
	border: 1px solid transparent;
	transition: all 0.3s ease;
}
.library-nav-back .back-link:hover {
	color: var(--text);
	border-bottom: 1px dotted var(--text);
}

/* 手機版適配 */
@media (max-width: 768px) {
	.library-nav-container {
		flex-direction: column;
		gap: 3rem;
	}
	.library-nav-side {
		max-width: 100%;
	}
	.text-right {
		text-align: left; /* 手機上統一靠左，閱讀視線更連貫 */
	}
}

/* ===== 全息閱讀室 (Curator's Manifesto Modal) ===== */
.curator-modal {
	position: fixed;
	inset: 0;
	display: flex;
	overflow-y: auto; 
	align-items: flex-start;
	background: rgba(5, 7, 12, 0.92);
	backdrop-filter: blur(15px);
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* 當網址包含 #manifesto 時，自動顯示 */
.curator-modal:target {
	opacity: 1;
	visibility: visible;
}

body:has(.curator-modal:target) { /* modal 開時停用背景捲軸，避免兩軸並存 */
	overflow: hidden;
}

/* 閱讀室內部容器 */
.curator-modal-box {
	/* 盒子永遠舖滿全熒幕 */
	width: 100%;
	min-height: 100%;
	box-sizing: border-box;

	/* 內容喺盒內置中 */
	display: flex;
	flex-direction: column;
	justify-content: center;

	background: rgba(15, 18, 25, 0.85);
	border: 1px solid rgba(var(--popupbox-color), 0.15);
	border-radius: 4px;
	box-shadow: 0 25px 60px rgba(0,0,0,0.9);
	padding: 3rem 5rem;
	color: #94a3b8;
	font-family: "Literata", serif;
	font-size: 0.96rem;
	line-height: 1.8;
	text-align: left;
}

.curator-modal-box h3 {
	font-family: "Cormorant Garamond", serif;
}

/* 交叉掣 */
.curator-close {
	position: fixed;
	top: 2rem;
	right: 2rem;
	color: rgba(var(--popupbox-color), 0.5);
	font-family: 'Share Tech Mono', monospace;
	font-size: 2.5rem;
	text-decoration: none;
	line-height: 1;
	transition: color 0.3s ease;
}
.curator-close:hover {
	color: #fff;
}

/* 首頁 [ Read the Curator's Note ] 嘅按鈕設計 */
.curator-link {
	font-family: inherit; 
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	
	/* 顏色同上面一樣，或者極微弱地亮 5% 作為潛意識引導 */
	color: #a5b4c6; 
	text-decoration: none;
	
	/* 極度隱若嘅底線，代替突兀嘅顏色對比 */
	border-bottom: 1px solid rgba(165, 180, 198, 0.4); 
	padding-bottom: 2px;
	transition: all 0.5s ease;
}

.curator-link:hover {
	color: #ffffff;
	border-bottom-color: rgba(255, 255, 255, 0.6);
	text-shadow: 0 0 20px rgba(255, 255, 255, 0.4); 
	cursor: pointer;
}

/* 手機版微調 */
@media (max-width: 800px) {
	.curator-modal-box { padding: 3rem 2rem; font-size: 1rem; }
	.curator-close { top: 1rem; right: 1.5rem; }
}

/* ── Life 專屬：文學手稿翻頁 CSS ── */
.life-nav-container {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-top: 10rem; /* 保持大量留白，讓讀者有沉思空間 */
	padding-top: 3rem;
	border-top: 1px solid rgba(255, 255, 255, 0.04); /* 比 Library 更微弱的分隔線，若有若無 */
}

.life-nav-side {
	flex: 1;
	max-width: 48%; /* 防止長標題碰撞 */
}
.text-right {
	text-align: right;
}

.life-nav-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	opacity: 0.65; /* 初始狀態帶有褪色感 */
	transition: opacity 0.5s ease; /* 緩慢的電影級淡入 */
}
.life-nav-link:hover {
	opacity: 1;
}

/* Meta 標籤：時間的流逝 */
.life-nav-link .nav-meta {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.65rem;
	color: var(--muted);
	letter-spacing: 0.25em; /* 極寬的字距，營造空靈感 */
	text-transform: uppercase;
	margin-bottom: 0.8rem;
}

/* 內容標題：人的故事 */
.life-nav-link .nav-title {
	font-size: 1.1rem;
	font-weight: normal;
	font-style: italic; /* 斜體增強文學感與自述感 */
	line-height: 1.5;
	color: var(--text);
	transition: color 0.5s ease, transform 0.5s ease; /* 慢速位移 */
}

/* 懸停微互動 (慢速呼吸感) */
.life-nav-link.prev:hover .nav-title {
	transform: translateX(-4px); 
	color: var(--accent); /* 如果不想用藍色，可以改為 #fff 純白 */
}
.life-nav-link.next:hover .nav-title {
	transform: translateX(4px);  
	color: var(--accent);
}

/* ── Library 同架典藏（單欄書目版本：無截斷、自適應長短描述） ── */
.lib-related-section {
	margin-top: 5rem;
	padding-top: 3.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lib-related-header {
	margin-bottom: 2.25rem;
}

.lib-related-meta {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--text);
	padding-left: 0.8rem;
	border-left: 3px solid var(--accent);
	margin-bottom: 0.6rem;
}

.lib-related-subtitle {
	margin: 0;
	font-size: 0.9rem;
	color: var(--muted);
}

/* 電腦版與手機版統一單欄由上至下排列 */
.lib-related-grid {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.lib-related-card {
	display: flex;
	align-items: center; /* 短描述時垂直置中，避免右下角顯得空洞 */
	gap: 1.75rem;
	padding: 1.65rem 2rem; /* 充裕內距，長描述時亦不覺迫狹 */
	border: 1px solid var(--card-border);
	border-bottom: 1px solid var(--card-border); /* 覆蓋 Forty 主題預設點狀底線 */
	border-radius: 10px;
	background: rgba(128, 128, 128, 0.03);
	text-decoration: none;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.3s ease;
}

.lib-related-card:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
	border-bottom-color: var(--accent);
	background: rgba(66, 133, 244, 0.05);
}

.lib-related-card__cover {
	flex: 0 0 76px;
	width: 76px;
}

.lib-related-card__cover img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.lib-related-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.lib-related-card__title {
	margin: 0 0 0.5rem 0;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--text);
	transition: color 0.25s ease;
}

.lib-related-card:hover .lib-related-card__title {
	color: var(--accent);
}

/* 取消省略號截斷，完整呈現所有 description */
.lib-related-card__desc {
	display: block;
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.65;
	color: var(--muted);
}

/* ── 手機版：擴闊上下空間，並將簡介釋放為全寬 ── */
@media (max-width: 768px) {
	.lib-related-grid {
		gap: 1.75rem; /* 擴闊每本書之間的上下距離 */
	}

	.lib-related-card {
		display: grid;
		grid-template-columns: 1fr;
		row-gap: 0.65rem;
		padding: 1.65rem 1.35rem; /* 加大卡片內部上下呼吸空間 */
	}

	.lib-related-card:has(.lib-related-card__cover) {
		grid-template-columns: 56px 1fr;
		column-gap: 1.1rem;
		row-gap: 1.1rem; /* 標題列與下方簡介之間的空間 */
		align-items: center;
	}

	/* 讓 title 與 desc 釋放出來參與外層 grid 排版，無須改動 HTML */
	.lib-related-card__body {
		display: contents;
	}

	.lib-related-card:has(.lib-related-card__cover) .lib-related-card__cover {
		grid-column: 1;
		grid-row: 1;
		width: 56px;
	}

	.lib-related-card:has(.lib-related-card__cover) .lib-related-card__title {
		grid-column: 2;
		grid-row: 1;
		margin: 0; /* 確保標題與封面完美垂直置中 */
		font-size: 1rem;
	}

	.lib-related-card:has(.lib-related-card__cover) .lib-related-card__desc {
		grid-column: 1 / -1; /* 簡介霸晒整張卡片全寬，中英文都能完整顯示 */
		grid-row: 2;
		font-size: 0.88rem;
		line-height: 1.65;
	}
}

/* 返回按鈕區域 */
.life-nav-back {
	text-align: center;
	margin-top: 6rem;
}

/* 手機版適配 */
@media (max-width: 768px) {
	.life-nav-container {
		flex-direction: column;
		gap: 3.5rem;
	}
	.life-nav-side {
		max-width: 100%;
	}
	.text-right {
		text-align: left; /* 手機上統一靠左，像書本目錄 */
	}
}

/* 頁底特別導航掣 */
.simulation-nav {
    text-align: center;
    margin-top: 10rem;
    padding: 0 1.5rem;
}

.simulation-nav__description {
    max-width: 34rem;
    margin: 1.1rem auto 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.78em;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.015em;
    text-transform: none;
}