/* 全局：避免寬度溢出 */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }

.footer {
	background: #222;
}
.copyright {
    width: 100%;
    color: #fff;
    font-size: 13px;
    font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 0px;
    text-align: center;
}

.uh {
    padding: 50px 55px;
    width: 100%;
    display: flex;
    align-items: center; /* 垂直置中標題與選單 */
    flex-wrap: nowrap;
}

.name {
    font-family: Gotham;
    font-size: 30px;
    font-weight: 300;
    display: inline;
}

.title {
    font-family: BebasNeueRegular;
    font-style: normal; 
    font-size: 30px;
    font-weight: 200;
    display: inline-block;
    padding-left: 20px;
    letter-spacing: 4px;
    margin-right: auto; /* 推動右側選單靠右 */
}

.uh-menu {
    width: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 語系切換固定在標題列右側，不進摺疊選單 */
.locale-switch {
    margin-left: 12px;
    font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
    font-size: 16px;
    color: #666;
}
.locale-switch a { color: #666; text-decoration: none; }
.locale-switch .active { font-weight: bold; color: #222; }

.menu-item {
    font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
    font-size: 18px;
    color: #999999;
    display: inline-block;
    margin-left: 10px;
    margin-right: 10px;
    text-align: center;
}

.menu-item a {
    color: #999999;
    text-decoration: none;
}

.menu-item a:hover {
    color: #999999;
}

.item-selected {
    font-weight: bold;
    color: #222;
}

/* RWD：手機版漢堡選單 */
.menu-toggle {
    display: none;
    width: 36px;
    height: 28px;
    background: transparent;
    background-image: url('mobile_menu.png');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
}

.menu-items { display: flex; gap: 16px; }
.menu-items.open { display: block; }

@media (max-width: 640px) {
  .uh {
    padding: 20px 16px;
    position: relative;
    display: block; /* 手機版改回區塊，讓選單往下展開 */
  }
  .gallery, .bio, .history { padding: 20px 16px 60px 16px; }
  /* 專案頁：移除左右內距，讓圖片能達到視窗寬度的 45% */
  .history { padding-left: 0; padding-right: 0; }
  .publish-item { padding: 12px 0 40px 0; }
  .uh-menu {
    width: auto;
    display: block;
  }
  .locale-switch { position: absolute; top: 18px; right: 56px; }
  .menu-toggle {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
    width: 32px;
    height: 32px;
  }
  .menu-toggle[aria-expanded="true"] { background-image: url('mobile_menuclose.png'); }
  .menu-items {
    display: none;
    width: 100%;
    margin-top: 56px;
    gap: 0;
  }
  .menu-items.open { display: block; }
  .menu-item { display: block; margin: 8px 0; text-align: left; }
  .menu-item a { display: inline-block; padding: 6px 0; }

  /* 手機：圖片與標題並排（左圖右文），加上間距 */
  .publish-item { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0 28px 0; }
  .publish-cover { flex: 0 0 48%; max-width: 48%; margin: 0; padding: 0; height: clamp(180px, 44vw, 260px); overflow: hidden; }
  .publish-desc { flex: 1 1 52%; max-width: 52%; margin-right: 0; padding: 0; }
  .publish-image { width: 100%; max-width: 100%; height: 100%; display: block; object-fit: cover; }
  /* 手機版：隱藏描述段落，保留標題 */
  .publish-item p { display: none; }
  /* 手機：標題字級縮小 */
  .publish-title { font-size: 15px; line-height: 1.35; }

  /* Bio 區塊直向堆疊 */
  .portrait { width: 100%; display: block; }
  .portrait-image { max-width: 100%; }
  .description { width: 100%; display: block; float: none; padding: 12px 0 0 0; }
}

/* tablet: 641px–1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  /* 平板：縮小頁面左右內距；選單改用漢堡避免換行 */
  .uh { padding: 40px 24px; position: relative; display: block; }
  .uh-menu { width: auto; display: block; }
  .menu-toggle { display: block; position: absolute; top: 24px; right: 24px; width: 36px; height: 36px; }
  .locale-switch { position: absolute; top: 28px; right: 68px; }
  .menu-toggle[aria-expanded="true"] { background-image: url('mobile_menuclose.png'); }
  .menu-items { display: none; width: 100%; margin-top: 56px; gap: 0; }
  .menu-items.open { display: block; }
  .menu-item { display: block; margin: 8px 0; text-align: left; }
  .menu-item a { display: inline-block; padding: 6px 0; }

  .gallery, .bio, .history { padding: 32px 24px 90px 24px; }
  .publish-item { display: flex; align-items: flex-start; gap: 16px; }
  .publish-cover { flex: 0 0 50%; max-width: 50%; margin: 0; padding: 0; display: block; height: clamp(220px, 36vw, 360px); overflow: hidden; }
  .publish-image { width: 100%; height: 100%; display: block; max-width: 100%; object-fit: cover; }
  .publish-desc { flex: 1 1 50%; max-width: 50%; display: block; float: none; margin-right: 0; padding: 0; }
}

.gallery {
    width: 100%;
    padding: 55px 55px 115px 55px;
}

.slideshow {
    width: 90%;
    margin: 0 auto 30px; /* 水平置中容器 */
    position: relative;
    height: 60vh;
    max-height: 600px;
    min-height: 320px;
    overflow: hidden;
}

.sequence {
    width: 90%;
    margin: 0 auto; /* 底部點點置中 */
    text-align: center;
}

/* 首頁輪播（加入淡入淡出動畫） */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 固定高度、維持比例，必要時左右留白或上下留白 */
  object-position: center center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: center/60% no-repeat;
  background-color: rgba(0,0,0,0.45); /* 半透明遮罩，白底也清楚 */
  border-radius: 50%;
  opacity: 0.9;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
  transition: opacity 0.2s ease;
}
.slide-nav:hover { opacity: 1; }
.slide-nav:focus { outline: 2px solid rgba(255,255,255,0.9); outline-offset: 2px; }
.slide-nav.prev { left: 8px; background-image: url('mobile_slide_arrow.png'); transform: translateY(-50%); }
.slide-nav.next { right: 8px; background-image: url('mobile_slide_arrow.png'); transform: translateY(-50%) rotate(180deg); }
.sequence .dot { background: transparent; border: 0; padding: 0; margin: 0 4px; cursor: pointer; }
.sequence .dot img { width: 12px; height: 12px; display: inline-block; }

/* 視覺隱藏（無障礙用） */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .slideshow { width: 100%; height: 50vh; min-height: 240px; margin: 0 0 20px 0; }
  .sequence { width: 100%; margin: 0; }
}

.image {
    max-width: 100%;
    height: auto;
}

.bio {
    width: 100%;
    padding: 55px 55px 115px 55px;
}

.portrait {
    width: 30%;
    display: inline;
}

.portrait-image {
    max-width: 35%;
}

.description {
    width: 55%;
    display: inline;
    float: right;
    padding: 0 50px 15px 20px;
}

.about {
    font-family: BebasNeueRegular;
    font-style: normal; 
    font-size: 38px;
    font-weight: 300;
    letter-spacing: 2.5px;
    color: #000;
    padding-bottom: 15px;
}

.description p {
    font-family: Arial, Helvetica, sans-serif;
    color: #202020;
    font-size: 13px;
    letter-spacing: 2px;
    line-height: 26px;
    padding: 0px 0 45px 0;
}

.history {
    width: 100%;
    padding: 55px 55px 115px 55px;
}

.publish {
    padding: 0 0 0 0;
}

.publish-item {
    width: 100%;
    padding: 15px 5px 115px 5px;
}

.publish-cover {
    width: 35%;
    display: inline;
}

.publish-image { width: 100%; height: auto; display: block; }

.publish-desc {
    width: 55%;
    display: inline;
    float: right;
    padding: 0 40px 0 35px;
    margin-right: 80px;
}

.publish-title {
    font-family: Gotham;
    font-size: 24px;
    font-weight: 300;
    color: #000;
}

.publish-meta {
    margin: 6px 0 10px;
    font-size: 14px;
    color: #555;
}
.publish-meta-time, .publish-meta-location { display: inline-block; }

.publish-item p {
    font-family: Gotham;
    font-size: 15px;
    font-weight: 300;
    color: #000;

}

.exhibition {
    padding-top: 50px;
}

/* 放在檔尾以確保優先度：修正 641–1024px 時文字區域右側 padding / margin 過大 */
@media (min-width: 641px) and (max-width: 1024px) {
  .publish-desc { padding: 0; margin-right: 0; float: none; display: block; }
  .publish-item { padding: 16px 0 2px 0; }
}

/* desktop: 1025px 以上維持左圖右文的兩欄佈局 */
@media (min-width: 1025px) {
  .publish-item { display: flex; align-items: flex-start; gap: 20px; }
  .publish-cover { flex: 0 0 58%; max-width: 58%; margin: 0; padding: 0; display: block; }
  .publish-desc { flex: 1 1 42%; max-width: 42%; margin-right: 0; padding: 0 0 0 35px; float: none; display: block; }
  .publish-image { width: 100%; height: auto; display: block; object-fit: cover; }
}

/* 超小螢幕（<400px）：上下堆疊（上圖下文） */
@media (max-width: 400px) {
  .publish-item { display: block; gap: 0; padding: 12px 0 20px 0; }
  .publish-cover { width: 100%; max-width: 100%; height: auto; margin: 0; padding: 0; }
  .publish-image { width: 100%; height: auto; display: block; object-fit: cover; }
  .publish-desc { width: 100%; max-width: 100%; margin: 8px 0 0 0; padding: 0; float: none; }
}

/* 小於等於 645px：改為上下排列（上圖下文），顯示描述文字 */
@media (max-width: 645px) {
  .publish-item { display: block; gap: 0; padding: 12px 0 20px 0; }
  .publish-cover { width: 100%; max-width: 100%; height: auto; margin: 0; padding: 0; }
  .publish-image { width: 100%; max-width: 100%; height: auto; display: block; object-fit: cover; }
  .publish-desc { width: 100%; max-width: 100%; margin-right: 0; padding: 8px 0 0 0; float: none; }
  .publish-item p { display: block; }
}
