/* ============================================
   Portfolio 套版 — Figma node 29:640
   左側客戶／作品資訊 + 右側筆電瀏覽器展示區
   ============================================ */

.content-page--portfolio {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
  --portfolio-header-width: 520px;
  --portfolio-desc-width: 470px;
}

/* --- 左側標題區 — 對齊內頁 guideline，左欄略縮比例 --- */

.portfolio-page__header {
  position: absolute;
  left: 100px;
  top: 200px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: var(--portfolio-header-width);
  z-index: 2;
}

.portfolio-page__titles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.portfolio-page__client {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 3px;
  color: #333;
  white-space: nowrap;
}

.portfolio-page__project {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 3px;
  color: #333;
  white-space: nowrap;
}

.portfolio-page__line {
  width: 60px;
  height: 0;
  margin: 0;
  border: none;
  border-top: 7px solid var(--cover-red, #e22d2a);
}

.portfolio-page__desc {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portfolio-page__intro {
  margin: 0;
  max-width: var(--portfolio-desc-width);
  font-family: 'Noto Sans TC', sans-serif;
  font-size: var(--content-subtitle-size, 24px);
  font-weight: var(--content-subtitle-weight, 400);
  line-height: var(--content-subtitle-lh, 1.5);
  letter-spacing: var(--content-subtitle-spacing, 0.5px);
  color: var(--content-subtitle-color, #333333);
}

.portfolio-page__contrib-label {
  margin: 18px 0 0;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: var(--cover-red, #e22d2a);
}

.portfolio-page__contrib-list {
  margin: 0;
  padding: 0 0 0 22px;
  list-style: disc;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.4px;
  color: rgba(51, 51, 51, 0.65);
}

.portfolio-page__contrib-list li + li {
  margin-top: 4px;
}

.portfolio-page__contrib-list li::marker {
  color: rgba(51, 51, 51, 0.45);
}

.portfolio-page__carousel {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  bottom: 0;
}

.portfolio-page__screenshot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* 正隆截圖頂部常帶 1–2px 亮邊，再多裁一點 */
[data-portfolio="chenlung"] .portfolio-page__carousel {
  top: -3px;
}

.portfolio-page__carousel:not(.is-playing) .portfolio-page__screenshot:first-child,
.portfolio-page__carousel.is-playing .portfolio-page__screenshot.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-page__screenshot {
    transition: none;
  }
}

/* portfolio 投影片：裝置區立即顯示，向右偏移 50px */
.slide--portfolio .mockup-page__device {
  left: 541px;
  top: 140px;
  transform: scale(0.95);
  transform-origin: top left;
}

.slide--portfolio .mockup-page__device,
.slide--portfolio .mockup-page__device[data-animate] {
  opacity: 1 !important;
}

/* veloh 以 1710×978 重新擷取，貼合瀏覽器內容比例；cover 消除次像素留邊。 */
[data-portfolio="veloh"] .portfolio-page__carousel { top: 0; }
[data-portfolio="veloh"] .portfolio-page__screenshot {
  object-fit: cover;
  object-position: center;
  background: #f7f7f7;
}

/* 自有產品使用完整畫面展示，避免裁切 PDF 原始介面或虛構網址。 */
.portfolio-product { position: absolute; left: 660px; top: 200px; width: 1160px; height: 650px; margin: 0; }
.portfolio-product .portfolio-page__carousel { inset: 0; border-radius: 24px; overflow: hidden; background: #f3f3f3; box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.portfolio-product .portfolio-page__screenshot { object-fit: contain; object-position: center; }
[data-portfolio="bvs"] .portfolio-product .portfolio-page__carousel { background: #101116; }
.portfolio-product figcaption { position: absolute; top: calc(100% + 20px); width: 100%; font-size: 22px; line-height: 32px; color: #595959; text-align: center; }
[data-portfolio="bvs"] .portfolio-page__project, [data-portfolio="twinco"] .portfolio-page__project { white-space: normal; }

/* 自有產品與其他案例使用相同電腦框，完整顯示介面。 */
[data-portfolio="bvs"] .portfolio-page__carousel,
[data-portfolio="twinco"] .portfolio-page__carousel { top: 0; }
[data-portfolio="bvs"] .portfolio-page__screenshot,
[data-portfolio="twinco"] .portfolio-page__screenshot { object-fit: contain; object-position: center; }
[data-portfolio="bvs"] .portfolio-page__carousel { background: #101116; }
[data-portfolio="twinco"] .portfolio-page__carousel { background: #fff; }

/* uMeal 原始 APP 設計以雙手機展示；長頁可在裝置內捲動，保留原圖比例與色彩。 */
.portfolio-phones { position: absolute; left: 770px; top: 120px; display: flex; align-items: flex-start; gap: 72px; }
.portfolio-phone { width: 365px; padding: 10px; background: #161616; border: 2px solid #5b5b5b; border-radius: 49px; box-shadow: 0 22px 45px rgba(0,0,0,.18), inset 0 0 0 2px #303030; }
.portfolio-phone:nth-child(2) { margin-top: 45px; }
.portfolio-phone__viewport { width: 341px; height: 738px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; border-radius: 37px; background: #f2f2f7; }
.portfolio-phone__viewport::-webkit-scrollbar { display: none; }
.portfolio-phone__viewport img { display: block; width: 100%; height: auto; }

/* 雙手機各自三張原稿，每兩秒同步切換。 */
.portfolio-phone__viewport.portfolio-page__carousel { position: relative; inset: auto; overflow: hidden; }
.portfolio-phone__viewport .portfolio-page__screenshot { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* LINE 原稿含畫框外的橫向訊息卡；僅顯示手機範圍，保留原稿原色。 */
.portfolio-phone__viewport img[src*="umeal-line-chat"] { width: 350.09px; height: auto; max-width: none; left: -4.55px; top: -0.91px; }
.portfolio-phone__viewport img[src*="umeal-line-result"] { width: 790.21px; height: auto; max-width: none; left: -4.55px; top: -0.91px; }

/* 長對話：原始設計分為固定頁首、可捲動內容、固定輸入框，避免長圖裁掉操作區。 */
.phone-chat-layout { background: #f7f7f9; pointer-events: none; }
.phone-chat-layout.is-active { pointer-events: auto; }
.phone-chat-layout__header { position: absolute; inset: 0 0 auto; height: 100px; overflow: hidden; }
.phone-chat-layout__scroll { position: absolute; inset: 100px 0 133px; overflow-y: auto; scrollbar-width: none; }
.phone-chat-layout__scroll::-webkit-scrollbar { display: none; }
.phone-chat-layout__messages { height: 755.66px; overflow: hidden; }
.phone-chat-layout__messages img { margin-top: -100px; }
.phone-chat-layout__input { position: absolute; inset: auto 0 0; height: 133px; overflow: hidden; }
.portfolio-phone__viewport .phone-chat-layout img { width: 341px; height: auto; display: block; }
.phone-chat-layout__input img { position: absolute; bottom: 0; }

/* LINE 長對話保留原生頁首與底部輸入列，中段獨立捲動。 */
.phone-chat-layout--line { background: #8dadd6; }
.phone-chat-layout--line .phone-chat-layout__header { height: 91.84px; }
.phone-chat-layout--line .phone-chat-layout__scroll { inset: 91.84px 0 77.29px; overflow-x: hidden; }
.phone-chat-layout--line .phone-chat-layout__messages { height: 766.57px; }
.portfolio-phone__viewport .phone-chat-layout--line img { width: 790.21px; max-width: none; height: auto; left: -4.55px; top: auto; }
.phone-chat-layout--line .phone-chat-layout__header img { position: absolute; top: -.91px; }
.phone-chat-layout--line .phone-chat-layout__messages img { position: relative; margin-top: -91.84px; }
.phone-chat-layout--line .phone-chat-layout__input { height: 77.29px; background: white; }
.phone-chat-layout--line .phone-chat-layout__input img { top: auto; bottom: 0; }
