/* ===== Reset & Base ===== */
:root {
  color-scheme: light;
}

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

body {
  font-family: 'Playfair Display', serif;
  font-weight: 500; 
  background: #fff;
  overflow-x: hidden;
}

/* ===== Option C: Artistic Cursor Zones (隱形導航區) ===== */
.cursor-zone {
  position: absolute; /* 由 fixed 改為 absolute，隨 Main 區域移動 */
  top: 0;
  height: 92vh;       /* 限制高度只在 Main 區域，避免遮擋下方的 Grid */
  width: 20vw;
  z-index: 10;
  cursor: auto;       /* 預設無箭嘴 */
}

/* ✅ 明確指定位置 */
.cursor-zone.left {
  left: 0;
}

.cursor-zone.right {
  right: 0;
}

/* SVG Cursor 設定 (Gradient Fade + Soft Shadow) - FIXED VERSION
   已修正：Base64 壓縮為單行，防止瀏覽器讀取失敗。
   已調整：Fallback 改為 'default'，避免出現系統 resize 箭咀。 */

/* 左邊 (<) - 漸層由右(尾)至左(尖) */
.cursor-zone.left.show-cursor {
  cursor: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MCIgaGVpZ2h0PSI5MCIgdmlld0JveD0iMCAwIDI0IDI0Ij48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImdsZWZ0IiB4MT0iMTAwJSIgeTE9IjAlIiB4Mj0iMCUiIHkyPSIwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMC4wIiAvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMC4zIiAvPjwvbGluZWFyR3JhZGllbnQ+PGZpbHRlciBpZD0iZmxmdCI+PGZlRHJvcFNoYWRvdyBkeD0iMCIgZHk9IjAiIHN0ZERldmlhdGlvbj0iMS41IiBmbG9vZC1jb2xvcj0icmdiYSgwLDAsMCwwLjIpIiAvPjwvZmlsdG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2h0KTsiIC8+PC9zdmc+") 45 45, default;
}

/* ===== Main Section (The Stage) ===== */
#main {
  height: 92vh;
  width: 100vw;
  position: relative;
  overflow: hidden; 
  background-color: #fff;
}

/* ===== Slide Scene ===== */
.slide-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* 確保有高度顯示底色 */
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform; 
}

/* Background quote text */
.slide-scene .bg-text {
  position: absolute;
  top: 40px;
  left: 40px;
  font-size: 600%; 
  font-weight: 500; 
  color: var(--localTextColor, rgba(0,0,0,0.1)); 
  opacity: 0.2; 
  text-align: left;
  z-index: 1;
  pointer-events: none;
  max-width: 80%;
  line-height: 1;
}

/* Poster Wrapper */
.slide-scene .poster-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.main-poster {
  max-height: 80vh;
  width: auto;
  max-width: 90vw;
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  /* cursor: zoom-in; <-- 已移除，避免變成放大鏡 */
  transition: transform 0.3s ease;
}

.main-poster:hover {
  transform: scale(1.01);
}

/* ===== Animation Classes (Scene Movement) ===== */
.scene-out-left {
  animation: sceneOutLeft 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.scene-in-right {
  animation: sceneInRight 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.scene-out-right {
  animation: sceneOutRight 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.scene-in-left {
  animation: sceneInLeft 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes sceneOutLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
@keyframes sceneInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes sceneOutRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}
@keyframes sceneInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ===== Tag Menu (Desktop) ===== */
#tagArea {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20; 
}

#tagButton {
  font-size: 300%;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0,0,0,0.5); 
  transition: color 0.2s ease;
}

#tagButton:hover { color: #fff; }

#tagMenu {
  position: absolute;
  top: 50px;
  right: 0;
  background: transparent;
  display: none;
  flex-direction: column;
  text-align: right;
  z-index: 19;
}

#tagMenu a {
  color: rgba(255,255,255,0.6);
  font-size: 150%;
  text-decoration: none;
  padding: 5px 0;
  display: block;
  transition: color 0.2s ease;
}

#tagMenu a:hover { color: #fff; }

@media (hover: hover) {
  #tagArea:hover #tagMenu,
  #tagMenu:hover { display: flex; }
}

/* ===== Grid Gallery ===== */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100vw;
  padding: 0;
  background: #fff;
}

.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.grid-item:hover {
  z-index: 10;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.grid-item img {
  width: 100%;
  display: block;
  height: auto;
}

/* ===== Footer (Desktop) ===== */
#mainFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 20px 50px;
  display: flex;
  justify-content: space-between; 
  align-items: center;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #333;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

#mainFooter.visible { transform: translateY(0); }

.footer-logo {
  width: 150px;
  height: auto;
  max-width: 100%;
  display: block;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  text-align: right;
}

.footer-right a {
  text-decoration: none;
  color: #333;
  transition: opacity 0.2s;
  font-weight: bold;
}

.footer-right a:hover { opacity: 0.6; }

.separator { display: none; }

.copyright { color: #888; font-size: 0.9em; }

/* ===== Mobile Layout ===== */
@media (max-width: 600px) {
  #main { height: 75vh; }
  
  .slide-scene .bg-text {
    font-size: 300%;
    top: 15px;
    left: 15px;
    max-width: 90%;
  }

  .main-poster { max-height: 65vh; }

  /* Mobile: 隱藏游標感應區 */
  .cursor-zone { display: none; }

  #tagButton {
    font-size: 200%;
    position: fixed;
    top: 20px; right: 20px;
    z-index: 1000; 
  }

  #grid { grid-template-columns: repeat(3, 1fr); }

  #tagMenu {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 20px; 
    padding-left: 40px; 
    gap: 15px;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    z-index: 900;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  }
  #tagMenu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  #tagMenu a {
    color: #fff !important;
    font-size: 200%;
    font-weight: bold;
    text-align: left; 
    padding: 5px 0;
    width: 100%; 
  }

  /* Footer Mobile */
  #mainFooter {
    flex-direction: row; 
    justify-content: space-between;
    padding: 15px 20px;
    gap: 10px;
    background-color: #ffffff !important;
    color: #333333 !important;
    backdrop-filter: none;
  }
  #mainFooter .footer-right a { color: #333333 !important; }
  .footer-logo { width: 90px; }
  .footer-right { font-size: 10px; gap: 2px; }
}