/* 供料實績 詳細頁專用 — 只在 project_detail.html 載入（在 style.css、responsive.css 之後) */
/* ==========================================================
   供料實績 詳細頁 (project_detail.html)
   ========================================================== */
.pd-inner{width:calc(100% - 160px);max-width:1440px;margin:0 auto;}

/* --- 上方：資訊＋照片檢視器 --- */
.pd-hero{
  padding:168px 0 88px;
  background:#f2f6fa;
}
.pd-hero-grid{
  display:grid;
  grid-template-columns:minmax(0,5fr) minmax(0,7fr);
  grid-template-areas:"head viewer" "body viewer";
  grid-template-rows:auto 1fr;
  column-gap:64px;
  align-items:start;
}
.pd-head{grid-area:head;}
.pd-body{grid-area:body;}
.pd-viewer{grid-area:viewer;}

.pd-breadcrumb{padding-top:0;margin-bottom:32px;flex-wrap:wrap;}
.pd-badge{margin-bottom:18px;}
.pd-title{
  font-size:clamp(1.7rem, 2.4vw, 2.5rem);
  font-weight:700;
  line-height:1.4;
  color:var(--gray-deep);
  letter-spacing:.01em;
  margin:0;
  word-break:break-word;
}
.pd-company{
  display:flex;align-items:center;gap:12px;
  margin:16px 0 0;
  font-size:1.1rem;color:var(--gray);
}
.pd-company::before{content:"";width:28px;height:2px;background:var(--gold);flex:none;}
.pd-company a{color:var(--blue);text-decoration:underline;}

/* 規格表 */
.pd-specs{margin:40px 0 0;border-top:2px solid var(--gray-deep);}
.pd-spec{
  display:grid;grid-template-columns:150px 1fr;gap:16px;
  padding:18px 0;border-bottom:1px solid #dfe5ec;
  align-items:baseline;
}
.pd-spec dt{font-size:1rem;font-weight:600;color:var(--gray-deep);}
.pd-spec dt span{display:block;margin-top:2px;font-size:.72rem;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:#9aa3ad;}
.pd-spec dd{margin:0;font-size:1.05rem;line-height:1.6;color:var(--ink);word-break:break-word;}
.pd-spec.is-key dd{font-size:2.1rem;font-weight:700;color:var(--gold);line-height:1.2;letter-spacing:.01em;}
.pd-spec.is-key dd em{font-style:normal;font-size:1rem;font-weight:600;margin-left:6px;color:var(--gray);}

/* 按鈕・分享 */
.pd-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px;margin-top:40px;}
.pd-back{font-size:1.05rem;padding:11px 30px 9px 22px;background:#fff;}
.pd-back:hover span{transform:translateX(-3px);}
.pd-share{position:relative;display:flex;align-items:center;gap:10px;}
.pd-share-label{font-size:.95rem;color:var(--gray);margin-right:4px;}
.pd-share-btn{
  width:40px;height:40px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:#fff;border:1px solid #d9e0e8;color:var(--gray-deep);
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.pd-share-btn:hover{background:var(--blue);border-color:var(--blue);color:#fff;}
.pd-toast{
  position:absolute;right:0;top:calc(100% + 10px);
  padding:7px 14px;border-radius:8px;background:var(--gray-deep);color:#fff;
  font-size:.85rem;white-space:nowrap;
  opacity:0;transform:translateY(-4px);pointer-events:none;transition:opacity .2s ease,transform .2s ease;
}
.pd-toast.is-visible{opacity:1;transform:none;}

/* 照片檢視器 */
.pd-stage{
  position:relative;border-radius:20px;overflow:hidden;
  aspect-ratio:3 / 2;background:#e6ecf2;
  box-shadow:0 24px 48px -24px rgba(10,32,56,.35);
}
.pd-stage-open{display:block;width:100%;height:100%;padding:0;cursor:zoom-in;}
.pd-stage-open img{width:100%;height:100%;object-fit:cover;display:block;}
.pd-stage-open img.is-in{animation:pdFade .45s ease;}
@keyframes pdFade{from{opacity:.25;transform:scale(1.015);}to{opacity:1;transform:none;}}
.pd-zoom-hint{
  position:absolute;left:18px;bottom:18px;
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 14px 6px;border-radius:999px;
  background:rgba(10,20,32,.6);color:#fff;font-size:.85rem;
  opacity:0;transition:opacity .25s ease;
}
.pd-stage:hover .pd-zoom-hint,
.pd-stage-open:focus-visible .pd-zoom-hint{opacity:1;}
.pd-nav{
  position:absolute;top:50%;transform:translateY(-50%);
  width:48px;height:48px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.92);color:var(--gray-deep);
  box-shadow:0 6px 18px rgba(0,0,0,.15);
  opacity:0;transition:opacity .25s ease,background .2s ease,color .2s ease;
}
.pd-nav svg{width:22px;height:22px;}
.pd-nav:hover{background:var(--blue);color:#fff;}
.pd-nav-prev{left:18px;}
.pd-nav-next{right:18px;}
.pd-stage:hover .pd-nav,.pd-nav:focus-visible{opacity:1;}
.pd-counter{
  position:absolute;right:18px;bottom:18px;
  padding:6px 14px 5px;border-radius:999px;
  background:rgba(255,255,255,.92);color:var(--gray);font-size:.85rem;letter-spacing:.06em;
  pointer-events:none;
}
.pd-counter b{color:var(--gray-deep);}
.pd-thumbs{
  display:flex;gap:12px;margin:16px 0 0;padding:0 0 4px;list-style:none;
  overflow-x:auto;scrollbar-width:thin;scroll-behavior:smooth;
}
.pd-thumbs li{flex:0 0 calc((100% - 48px) / 5);}
.pd-thumbs button{
  display:block;width:100%;aspect-ratio:3 / 2;padding:0;
  border-radius:10px;overflow:hidden;
  outline:2px solid transparent;outline-offset:-2px;
  opacity:.5;transition:opacity .2s ease,outline-color .2s ease;
}
.pd-thumbs button:hover{opacity:.85;}
.pd-thumbs button.is-active{opacity:1;outline-color:var(--blue);}
.pd-thumbs img{width:100%;height:100%;object-fit:cover;display:block;}
.pd-viewer.is-single .pd-nav,
.pd-viewer.is-single .pd-thumbs{display:none;}
.pd-viewer.is-empty .pd-stage{background:#f2f2f2;box-shadow:none;}
.pd-viewer.is-empty .pd-stage-open{cursor:default;display:flex;align-items:center;justify-content:center;}
.pd-viewer.is-empty .pd-stage-open img{width:52%;height:auto;object-fit:contain;opacity:.35;}
.pd-viewer.is-empty .pd-nav,
.pd-viewer.is-empty .pd-thumbs,
.pd-viewer.is-empty .pd-counter,
.pd-viewer.is-empty .pd-zoom-hint{display:none;}

/* --- 上一個／下一個專案 --- */
.pd-pager{background:#fff;border-bottom:1px solid var(--line);}
.pd-pager-grid{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:32px;}
.pd-pager-item{display:flex;align-items:center;gap:20px;padding:28px 0;min-width:0;}
.pd-pager-item.is-next{justify-content:flex-end;text-align:right;}
.pd-pager-thumb{flex:none;width:120px;aspect-ratio:3 / 2;border-radius:10px;overflow:hidden;background:#f2f2f2;}
.pd-pager-thumb img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .4s ease;}
.pd-pager-item.is-logo .pd-pager-thumb img{object-fit:contain;padding:12px;opacity:.4;box-sizing:border-box;}
.pd-pager-text{min-width:0;}
.pd-pager-text small{display:block;font-size:.85rem;color:#9aa3ad;letter-spacing:.06em;margin-bottom:6px;}
.pd-pager-text strong{
  font-size:1.08rem;font-weight:600;color:var(--gray-deep);line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  transition:color .2s ease;
}
.pd-pager-item:hover strong{color:var(--blue);}
.pd-pager-item:hover .pd-pager-thumb img{transform:scale(1.06);}
.pd-pager-all{
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#9aa3ad;border:1px solid var(--line);
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.pd-pager-all:hover{background:var(--blue);border-color:var(--blue);color:#fff;}

/* --- 相關實績 --- */
.pd-related{padding:88px 0 120px;}
.pd-related-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:36px;}
.pd-section-title{margin:0;font-size:1.9rem;font-weight:700;color:var(--gray-deep);}
.pd-section-title span{margin-left:12px;font-size:1rem;font-weight:400;color:#9aa3ad;letter-spacing:.04em;}
.pd-related-more{display:inline-flex;align-items:center;gap:4px;color:var(--blue);font-weight:600;white-space:nowrap;}
.pd-related-more:hover svg{transform:translateX(3px);}
.pd-related-more svg{transition:transform .2s ease;}

/* --- 燈箱 --- */
.pd-lightbox{
  position:fixed;inset:0;z-index:1000;
  display:flex;align-items:center;justify-content:center;
  background:rgba(8,14,22,.94);
  opacity:0;transition:opacity .25s ease;
}
.pd-lightbox[hidden]{display:none;}
.pd-lightbox.is-open{opacity:1;}
body.pd-lb-lock{overflow:hidden;}
.pd-lb-figure{margin:0;max-width:86vw;}
.pd-lb-figure img{display:block;max-width:86vw;max-height:80vh;width:auto;height:auto;margin:0 auto;border-radius:6px;object-fit:contain;}
.pd-lb-figure figcaption{display:flex;justify-content:space-between;gap:24px;margin-top:16px;color:#c9d2dc;font-size:.95rem;}
.pd-lb-close{position:absolute;top:24px;right:24px;width:48px;height:48px;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s ease;}
.pd-lb-close:hover{background:rgba(255,255,255,.12);}
.pd-lb-nav{
  position:absolute;top:50%;transform:translateY(-50%);
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.08);color:#fff;transition:background .2s ease;
}
.pd-lb-nav svg{width:26px;height:26px;}
.pd-lb-nav:hover{background:var(--blue);}
.pd-lb-prev{left:28px;}
.pd-lb-next{right:28px;}

/* --- 響應式 --- */
@media (hover:none){
  .pd-nav{opacity:1;}
  .pd-zoom-hint{opacity:1;}
}
@media (max-width:1560px){
  .pd-hero{padding-top:136px;}
}
@media (max-width:1200px){
  .pd-hero-grid{column-gap:40px;}
  .pd-spec{grid-template-columns:120px 1fr;}
}
@media (max-width:1024px){
  .pd-hero{padding-bottom:64px;}
  .pd-hero-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "viewer" "body";}
  .pd-viewer{margin-top:32px;}
  .pd-specs{margin-top:36px;}
}
@media (max-width:900px){
  .pd-inner{width:calc(100% - 56px);}
  .pd-related{padding:64px 0 88px;}
}
@media (max-width:600px){
  .pd-inner{width:calc(100% - 32px);}
  .pd-hero{padding-top:112px;padding-bottom:48px;}
  .pd-breadcrumb{margin-bottom:22px;}
  .pd-company{font-size:1rem;}
  .pd-stage{border-radius:14px;}
  .pd-nav{width:40px;height:40px;}
  .pd-nav-prev{left:10px;}
  .pd-nav-next{right:10px;}
  .pd-counter{right:10px;bottom:10px;}
  .pd-zoom-hint{left:10px;bottom:10px;}
  .pd-thumbs{gap:8px;}
  .pd-thumbs li{flex-basis:calc((100% - 24px) / 4);}
  .pd-spec{grid-template-columns:100px 1fr;gap:12px;padding:15px 0;}
  .pd-spec.is-key dd{font-size:1.7rem;}
  .pd-actions{flex-direction:column-reverse;align-items:stretch;}
  .pd-back{justify-content:center;}
  .pd-share{justify-content:center;}
  .pd-toast{right:50%;transform:translate(50%,-4px);}
  .pd-toast.is-visible{transform:translate(50%,0);}
  .pd-pager-grid{gap:12px;}
  .pd-pager-thumb{display:none;}
  .pd-pager-item{padding:20px 0;}
  .pd-pager-text strong{font-size:.95rem;}
  .pd-pager-all{width:44px;height:44px;}
  .pd-section-title{font-size:1.45rem;}
  .pd-section-title span{display:block;margin:4px 0 0;font-size:.85rem;}
  .pd-lb-nav{top:auto;bottom:24px;transform:none;width:48px;height:48px;}
  .pd-lb-prev{left:calc(50% - 60px);}
  .pd-lb-next{right:calc(50% - 60px);}
  .pd-lb-figure img{max-width:94vw;max-height:70vh;}
  .pd-lb-figure{max-width:94vw;}
  .pd-lb-figure figcaption{font-size:.85rem;}
}

/* --- 縮圖：小尺寸＋置中，只有選取的照片橫向加寬（參考: seamarqhotel.com) --- */
.pd-thumbs{gap:8px;margin-top:20px;padding:2px 0 6px;}
.pd-thumbs li{flex:0 0 auto;}
.pd-thumbs li:first-child{margin-left:auto;}   /* 放得下就置中，放不下則從左側開始橫向捲動 */
.pd-thumbs li:last-child{margin-right:auto;}
.pd-thumbs button{
  width:56px;height:56px;aspect-ratio:auto;
  border-radius:4px;opacity:.6;
  transition:width .35s ease,opacity .2s ease,outline-color .2s ease;
}
.pd-thumbs button.is-active{width:148px;opacity:1;outline-color:transparent;}
@media (max-width:600px){
  .pd-thumbs{gap:6px;}
  .pd-thumbs li{flex-basis:auto;}
  .pd-thumbs button{width:44px;height:44px;}
  .pd-thumbs button.is-active{width:104px;}
}

/* --- 移除照片檢視器圓角（大圖＋縮圖) --- */
.pd-stage,
.pd-thumbs button{border-radius:0;}
@media (max-width:600px){ .pd-stage{border-radius:0;} }

/* --- 背景色 --- */
.pd-hero{background:#f0faff;}
.pd-related{background:#f6f6f6;}
