/* ============================================================
   EndoPedia — 法老專區
   讀本式展廳：紙張、墨線、少量金色標記。
   角色是頁面上的去背插圖，不是內容卡片。
   ============================================================ */

.pharaoh-root {
  --papyrus: #e8d5a8;
  --papyrus-deep: #d9c18a;
  --papyrus-light: #f2e7c8;
  --gold: #b88b2e;
  --gold-light: #e6c95c;
  --gold-dim: #765b00;
  --nile: #1d3e6e;
  --ink: #2b2824;
  --terracotta: #a8483d;
  --line-gold: rgba(151, 112, 29, 0.45);
  --paper-bg: #f4ecd8;
}

.pharaoh-page { position: relative; padding: 0.5rem 0 3.5rem; }
.pharaoh-page .breadcrumb { margin-bottom: 1.55rem; }
.pharaoh-heading { max-width: 68ch; position: relative; }
.ph-kicker {
  color: var(--gold-dim); font-size: 0.88rem; font-weight: 700;
  letter-spacing: 0.12em; line-height: 1.4;
}

/* 首頁：影像沿紙頁展開，不做圓角卡片 */
.pharaoh-cover {
  position: relative; margin: 0 0 1.75rem;
  border-top: 1px solid var(--line-gold);
  border-bottom: 1px solid var(--line-gold);
}
.pharaoh-cover img { display: block; width: 100%; height: auto; }
.pharaoh-title {
  margin: 0.45rem 0 0.65rem;
  color: var(--nile);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 700; letter-spacing: 0.04em; line-height: 1.3;
}
.pharaoh-subtitle {
  max-width: 62ch; margin: 0 0 2.1rem;
  color: #5d5548; font-size: 1.04rem; line-height: 1.9;
}

/* 首頁導覽短片：像讀本中的跨頁，不做卡片外框 */
.ph-video-feature {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin: 0 0 3.1rem;
  padding: 1.35rem 0 1.6rem;
  border-top: 2px solid var(--nile);
  border-bottom: 1px solid var(--line-gold);
}
.ph-video-copy { max-width: 31ch; }
.ph-video-copy h2 {
  margin: 0.35rem 0 0.7rem;
  color: var(--nile);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.4;
}
.ph-video-copy p { margin: 0 0 0.72rem; color: #403a31; line-height: 1.9; }
.ph-video-copy .ph-video-invite { color: var(--terracotta); font-size: 0.92rem; }
.ph-video-figure { min-width: 0; margin: 0; }
.ph-video-figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #171717;
  object-fit: contain;
}

/* 導覽跨頁：場景與人物疊在同一條閱讀線上 */
.ph-guide-spread {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  gap: 2.25rem; align-items: center;
  margin: 0 0 3.25rem; padding: 1.1rem 0 1.45rem;
  border-top: 1px solid var(--line-gold);
  border-bottom: 1px solid var(--line-gold);
}
.ph-guide-scene { min-width: 0; margin: 0; }
.ph-guide-scene img {
  display: block; width: 100%; height: auto;
  border: 0; border-radius: 0;
}
.ph-guide-copy { position: relative; z-index: 2; padding: 0.5rem clamp(9rem, 13vw, 11rem) 0.6rem 0; }
.ph-guide-copy h2 {
  margin: 0 0 0.55rem; color: var(--nile);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: 1.55rem; line-height: 1.45;
}
.ph-guide-copy p { margin: 0; color: #403a31; line-height: 1.9; }
.ph-guide-character {
  position: absolute; right: 0; bottom: -1.45rem; z-index: 3;
  display: block; width: clamp(175px, 15vw, 215px); height: auto;
  pointer-events: none; filter: drop-shadow(0 8px 5px rgba(55, 42, 22, 0.13));
}
.ph-fig-caption { margin-top: 0.45rem; color: #756a58; font-size: 0.82rem; line-height: 1.55; }

/* 章節：一條有節奏的書目線 */
.ph-chapters { margin: 0 0 3.15rem; border-top: 2px solid var(--nile); border-bottom: 1px solid var(--line-gold); }
.ph-chapters-header {
  padding: 0.9rem 0 0.75rem; color: var(--nile);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.05em;
}
.ph-chapter-link {
  display: grid; grid-template-columns: 5.4rem minmax(0, 1fr) auto;
  gap: 0.85rem; align-items: baseline; padding: 0.95rem 0;
  border-top: 1px solid rgba(151, 112, 29, 0.23);
  color: var(--ink); text-decoration: none;
  transition: padding-left 160ms ease, color 160ms ease;
}
.ph-chapter-link:hover { padding-left: 0.35rem; color: var(--nile); text-decoration: none; }
.ph-chapter-num { min-width: 0; color: var(--gold-dim); font-family: Georgia, serif; font-size: 0.92rem; }
.ph-chapter-name { display: grid; gap: 0.14rem; }
.ph-chapter-name strong { color: inherit; font-size: 1.05rem; font-weight: 600; }
.ph-chapter-name small { color: #756a58; font-size: 0.78rem; line-height: 1.4; }
.ph-chapter-arrow { color: var(--terracotta); font-size: 1.1rem; }

/* 延伸閱讀：純文字書目，沒有外框容器 */
.ph-reading-links { margin: 0 0 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line-gold); }
.ph-reading-links h2 {
  margin: 0.25rem 0 0.65rem; color: var(--nile);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif; font-size: 1.5rem;
}
.ph-reading-links ul {
  display: flex; flex-wrap: wrap; gap: 0.2rem 1.35rem;
  margin: 0; padding: 0; list-style: none;
}
.ph-reading-links li { font-size: 0.86rem; line-height: 1.7; }
.ph-reading-links li::before { content: "·"; margin-right: 0.45rem; color: var(--terracotta); }

/* 文章頁首與人物邊註 */
.ph-article { position: relative; max-width: var(--content-max); }
.ph-article-header { position: relative; margin-bottom: 1.2rem; padding: 0 8.5rem 1.15rem 0; border-bottom: 2px solid var(--nile); }
.ph-article .ph-kicker { margin-bottom: 0.1rem; }
.ph-period-label { margin: 0 0 0.7rem; }
.ph-intro {
  max-width: 67ch; margin: 1rem 0 0; color: #4a443a;
  font-size: 1.08rem; line-height: 1.92;
}
.ph-article-character {
  position: absolute; right: 0; top: -1.1rem;
  width: clamp(136px, 12vw, 168px); height: auto;
  pointer-events: none; filter: drop-shadow(0 7px 4px rgba(55, 42, 22, 0.12));
}

/* 圖像：像展廳圖版，不像商品卡 */
.ph-frieze { margin: 1.9rem 0 2.1rem; border-top: 1px solid var(--line-gold); border-bottom: 1px solid var(--line-gold); }
.ph-frieze img { display: block; width: 100%; height: auto; }
.ph-context-fig { margin: 2rem 0 2.25rem; }
.ph-context-fig img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }

.ph-article h2.ph-section-title {
  margin: 2.45rem 0 0.85rem; padding: 0 0 0.35rem 0.78rem;
  border-bottom: 0; border-left: 3px solid var(--gold);
  color: var(--nile); font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: 1.65rem; line-height: 1.45;
}
.ph-article p { margin: 0 0 1.08rem; color: #3d382f; line-height: 1.97; }

/* 文物圖版：只有上下分隔線 */
.ph-object {
  display: grid; grid-template-columns: minmax(210px, 0.84fr) minmax(0, 1.16fr);
  gap: 1.6rem; align-items: start; margin: 2.4rem 0;
  padding: 1.25rem 0; border-top: 1px solid var(--line-gold); border-bottom: 1px solid var(--line-gold);
}
.ph-object-fig { min-width: 0; padding: 0; }
.ph-object-fig img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.ph-object-body { min-width: 0; padding: 0.1rem 0; }
.ph-object-name { margin: 0 0 0.25rem; color: var(--nile); font-family: "Noto Serif TC", Georgia, serif; font-size: 1.18rem; font-weight: 700; }
.ph-object-meta { margin-bottom: 0.55rem; color: var(--gold-dim); font-size: 0.86rem; letter-spacing: 0.02em; }
.ph-object-body p { margin: 0 0 0.65rem; color: #4a443a; font-size: 0.98rem; line-height: 1.85; }
.ph-object-credit { margin-top: 0.7rem; padding-top: 0.55rem; border-top: 1px solid rgba(151, 112, 29, 0.25); color: #8a7f6a; font-size: 0.78rem; line-height: 1.55; overflow-wrap: anywhere; }
.ph-object-source { margin: 0.55rem 0 0.35rem; color: #766b59; font-size: 0.76rem; line-height: 1.5; }
.ph-object-source summary { cursor: pointer; color: #6b5e49; }
.ph-object-source > div { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; padding-top: 0.25rem; }
.ph-object-source a { color: #205887; }
.ph-object-source-note { color: #82523a; }

/* 考古學家手記：人物落在正文邊緣 */
.ph-historian {
  display: flex; gap: 1rem; align-items: flex-end;
  margin: 2.4rem 0; padding: 1rem 0 0.7rem;
  border-top: 1px solid var(--line-gold); border-bottom: 1px solid var(--line-gold);
}
.ph-historian-avatar { display: block; width: 132px; height: auto; flex: 0 0 132px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 5px 3px rgba(55, 42, 22, 0.12)); }
.ph-historian-body { position: relative; margin: 0; padding: 0 0.2rem 0.2rem; color: #4a443a; font-family: "Noto Serif TC", "Songti TC", Georgia, serif; font-size: 1rem; line-height: 1.85; }
.ph-historian-body p { margin: 0 0 0.85rem; }
.ph-historian-body p:last-child { margin-bottom: 0; }
.ph-historian-body::before { content: "「"; margin-right: 0.1rem; color: var(--terracotta); font-size: 1.55em; line-height: 0; vertical-align: -0.25em; }

/* 章與章之間的閱讀線 */
.ph-chapter-nav {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem;
  margin: 3rem 0 0; padding: 1.25rem 0 0.9rem;
  border-top: 2px solid var(--nile); border-bottom: 1px solid var(--line-gold);
}
.ph-chapter-nav-link { display: grid; gap: 0.25rem; color: var(--ink); text-decoration: none; }
.ph-chapter-nav-link:hover { color: var(--nile); text-decoration: none; }
.ph-chapter-nav-link:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.ph-chapter-nav-link span { color: var(--terracotta); font-size: 0.8rem; letter-spacing: 0.06em; }
.ph-chapter-nav-link strong { color: var(--nile); font-family: "Noto Serif TC", Georgia, serif; font-size: 1.05rem; }
.ph-chapter-nav-link em { color: #756a58; font-size: 0.82rem; font-style: normal; line-height: 1.55; }
.ph-chapter-nav-next { text-align: right; }

/* 入口在母站也沿用同一套讀本語氣 */
.pharaoh-entry { display: block; margin: 0 0 2.7rem; border-bottom: 2px solid var(--brand-accent); color: inherit; }
.pharaoh-entry:hover { text-decoration: none; }
.pharaoh-entry img { display: block; width: 100%; height: auto; }
.pharaoh-entry-body { padding: 1rem 0 1.2rem; border-top: 1px solid var(--brand-accent); background: transparent; }
.pharaoh-entry-body .ph-kicker { color: var(--brand-accent); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.12em; }
.pharaoh-entry-body h3 { margin: 0.3rem 0 0.35rem; color: var(--nile); font-size: 1.5rem; }
.pharaoh-entry-body p { margin: 0; color: #5a5246; font-size: 1rem; line-height: 1.7; }

@media (max-width: 900px) {
  .pharaoh-title { font-size: 1.9rem; }
  .ph-video-feature { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2.8rem; }
  .ph-myth-video { grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem; }
  .ph-myth-video-figure video { max-height: none; }
  .ph-video-copy { max-width: 55ch; }
  .ph-guide-spread { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2.8rem; }
  .ph-guide-copy { padding: 0.2rem 6.6rem 1rem 0; }
  .ph-guide-scene img { aspect-ratio: 3 / 2; object-fit: cover; }
  .ph-guide-character { right: 0; bottom: -1.45rem; width: 124px; }
  .ph-chapter-link { grid-template-columns: 4.4rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.85rem 0; }
  .ph-chapter-name strong { font-size: 1rem; }
  .ph-reading-links ul { display: block; }
  .ph-reading-links li { margin-bottom: 0.35rem; }
  .ph-article-header { padding-right: 6.2rem; }
  .ph-article-character { right: 0; top: -0.6rem; width: 108px; }
  .ph-object { grid-template-columns: 1fr; gap: 0.95rem; }
  .ph-object-fig img { max-height: 48vh; width: auto; max-width: 100%; margin: 0 auto; }
  .ph-chapter-nav { grid-template-columns: 1fr; gap: 1rem; }
  .ph-chapter-nav-next { text-align: left; }
  .ph-historian { gap: 0.75rem; }
  .ph-historian-avatar { width: 112px; flex-basis: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .ph-chapter-link { transition: none; }
}

/* ── 神話故事集入口卡（法老導覽首頁）── */
.ph-myths-entry {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin: 1.6rem 0 0;
  padding: 1.2rem 1.4rem;
  background: linear-gradient(135deg, #f6ecd2, var(--papyrus));
  border: 1px solid var(--gold);
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(201, 162, 39, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}
.ph-myths-entry:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201, 162, 39, 0.25); }
.ph-myths-entry-tag {
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--gold-dim); text-transform: uppercase;
}
.ph-myths-entry strong { font-family: "Noto Serif TC", Georgia, serif; color: var(--nile); font-size: 1.3rem; }
.ph-myths-entry small { color: #6a5f4d; font-size: 0.95rem; line-height: 1.6; }
.ph-myths-entry .ph-chapter-arrow { position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--gold-dim); font-size: 1.3rem; }

/* ── 神話單篇主圖 ── */
.ph-myth-fig { margin: 0 0 1.6rem; }
.ph-myth-fig img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--line-gold);
  box-shadow: 0 6px 24px rgba(29, 62, 110, 0.15);
}

/* 神話頁影片採編輯式跨欄，不使用卡片堆疊，讓影片成為正文的一個段落。 */
.ph-myth-video {
  display: grid;
  grid-template-columns: minmax(12rem, .72fr) minmax(0, 1.28fr);
  gap: clamp(1.3rem, 4vw, 3.8rem);
  align-items: end;
  margin: 2.4rem 0 3rem;
  padding: 1.5rem 0 1.8rem;
  border-top: 1px solid rgba(154, 117, 45, .44);
  border-bottom: 1px solid rgba(154, 117, 45, .28);
}
.ph-myth-video-copy { align-self: center; }
.ph-myth-video-copy h2 {
  margin: .25rem 0 .7rem;
  color: var(--nile);
  font-family: "Noto Serif TC", Georgia, serif;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  letter-spacing: .04em;
}
.ph-myth-video-copy p { margin: 0; color: #675d4e; line-height: 1.9; }
.ph-myth-video-figure { margin: 0; }
.ph-myth-video-figure video {
  display: block;
  width: 100%;
  max-height: min(58vw, 32rem);
  background: #171713;
  border: 1px solid rgba(42, 54, 43, .36);
}
.ph-myth-video-figure .ph-fig-caption { margin-top: .55rem; }
@media (max-width: 900px) {
  .ph-myth-video { grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem; }
  .ph-myth-video-figure video { max-height: none; }
}

/* ── 全寬圖（神話索引頁飾帶等）── */
.ph-wide-fig { margin: 0 0 1.75rem; }
.ph-wide-fig img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line-gold); }

/* ── 人物與地名速查（常駐顯示）── */
.ph-glossary {
  margin: 2rem 0 0;
  padding: 1.1rem 1.3rem;
  background: #f6f0e0;
  border: 1px solid var(--line-gold);
  border-radius: 12px;
}
.ph-glossary h2 {
  font-family: "Noto Serif TC", Georgia, serif;
  font-size: 1.05rem; color: var(--nile);
  margin: 0 0 0.7rem; letter-spacing: 0.05em;
}
.ph-glossary ul { list-style: none; margin: 0; padding: 0; }
.ph-glossary li {
  display: flex; gap: 0.7rem; align-items: baseline;
  padding: 0.4rem 0; border-bottom: 1px dashed rgba(201, 162, 39, 0.35);
  font-size: 0.98rem; line-height: 1.6;
}
.ph-glossary li:last-child { border-bottom: none; }
.ph-glossary li strong { color: var(--terracotta); white-space: nowrap; flex-shrink: 0; }
.ph-glossary li span { color: #4a4234; }
@media (max-width: 600px) {
  .ph-glossary li { flex-direction: column; gap: 0.15rem; }
  .ph-glossary li strong { white-space: normal; }
}
