/* ============ Project detail page (work.html) — product-style layout ============ */
.wk-page { padding: 22px 0 10px; }
.wk-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.wk-top .crumbs { margin: 0; }
.crumbs #wkCrumb { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }

/* back button */
.wk-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 12px; border-radius: 999px; text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 6px 18px -12px rgba(11,19,48,.35); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.wk-back:hover { transform: translateX(-3px); border-color: var(--ink); box-shadow: 0 10px 24px -14px rgba(11,19,48,.45); }

/* thumbnails | stage | details */
.wk-layout {
  --sh: min(74vh, 700px);              /* stage height */
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: 88px minmax(0, 1fr) 340px;
  grid-template-areas: "thumbs stage info";
}

/* thumbnails: vertical strip */
.wk-thumbs {
  grid-area: thumbs; display: flex; flex-direction: column; gap: 10px;
  max-height: var(--sh); overflow-y: auto; scrollbar-width: none; padding: 2px;
}
.wk-thumbs::-webkit-scrollbar { display: none; }
.wk-th {
  flex: none; width: 80px; height: 80px; padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; cursor: pointer; background: var(--surface-2, #eef1f6); opacity: .62;
  transition: opacity .2s, border-color .2s, transform .2s;
}
.wk-th img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.wk-th:hover { opacity: 1; }
.wk-th.on { opacity: 1; border-color: var(--ink); }
.wk-th:focus-visible { outline: 3px solid var(--navy, #1F3A8A); outline-offset: 2px; }

/* stage: fixed box, photo keeps its own shape (no crop, no zoom) */
.wk-stage {
  grid-area: stage; position: relative; height: var(--sh);
  display: flex; align-items: center; justify-content: center;
  background: #f1f3f7; border-radius: 16px; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.wk-frame {
  position: relative; margin: 0; display: inline-block; line-height: 0;
  opacity: 0; transform: scale(.985); transition: opacity .35s, transform .35s;
}
.wk-frame.in { opacity: 1; transform: none; }
.wk-frame > #wkImg {
  display: block; max-width: 100%; max-height: var(--sh); width: auto; height: auto;
  object-fit: contain; pointer-events: none; cursor: default;
}
/* 2P watermark: grey, faded logo repeated across the whole photo */
.wk-wm {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url(../images/watermark-2p.png?v=1);   /* 2P logo + company name */
  background-repeat: space; background-position: center; background-size: 30% auto;
  filter: grayscale(1) contrast(.9); opacity: .24;
}
.wk-frame.portrait .wk-wm { background-size: 46% auto; }

.wk-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center; color: var(--ink);
  background: rgba(255,255,255,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px -12px rgba(11,19,48,.4); opacity: .85; transition: opacity .2s, background .2s;
}
.wk-nav:hover { opacity: 1; background: #fff; }
.wk-nav.prev { left: 14px; } .wk-nav.next { right: 14px; }
.wk-nav[hidden] { display: none; }
.wk-num {
  position: absolute; right: 14px; bottom: 12px; z-index: 2;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ink);
  background: rgba(255,255,255,.88); padding: 5px 10px; border-radius: 999px;
}

/* details panel */
.wk-info { grid-area: info; display: flex; flex-direction: column; gap: 0; padding-top: 2px; }
.wk-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wk-title { margin: 8px 0 6px; font-size: clamp(22px, 2vw, 28px); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.wk-client { margin: 0; font-size: 13px; color: var(--muted); }
.wk-client b { color: var(--ink); font-weight: 700; letter-spacing: .04em; }
.wk-client[hidden] { display: none; }
.wk-block { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.wk-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.wk-caption { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--ink); min-height: 2.9em; }
.wk-desc { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.wk-count { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.wk-cta, .wk-cta2 {
  display: block; text-align: center; text-decoration: none; font-weight: 700; letter-spacing: .04em;
  padding: 15px 18px; border-radius: 4px; transition: background .2s, color .2s, border-color .2s;
}
.wk-cta { margin-top: 22px; background: #0B1330; color: #fff; }
.wk-cta:hover { background: #1F3A8A; }
.wk-cta2 { margin-top: 10px; background: var(--surface-2, #eef1f6); color: var(--ink); font-weight: 600; }
.wk-cta2:hover { background: var(--line); }
.wk-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* more projects */
.wk-more { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.wk-card { min-height: 240px; text-decoration: none; transition: transform .3s; }
.wk-card:hover { transform: translateY(-4px); }
.wk-all { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* tablet: details below */
@media (max-width: 1100px) {
  .wk-layout { grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "thumbs stage" "info info"; }
  .wk-info { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .wk-info > .wk-kicker, .wk-info > .wk-title, .wk-info > .wk-client { grid-column: 1 / -1; }
  .wk-info > .wk-cta, .wk-info > .wk-cta2 { margin-top: 18px; }
  .wk-info > .wk-note { grid-column: 1 / -1; }
}
/* phone: photo, thumbnail row, details */
@media (max-width: 760px) {
  .wk-page { padding-top: 12px; }
  .wk-layout { --sh: min(62vh, 125vw); grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "thumbs" "info"; gap: 12px; }
  .wk-stage { border-radius: 12px; }
  .wk-thumbs { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; }
  .wk-th { width: 64px; height: 64px; border-radius: 8px; }
  .wk-nav, .wk-nav[hidden] { display: none; }   /* phones: no arrow buttons — swipe the photo or tap a thumbnail */
  .wk-info { display: flex; }
  .wk-info > .wk-cta { margin-top: 20px; } .wk-info > .wk-cta2 { margin-top: 10px; }
  .crumbs #wkCrumb { max-width: 18ch; }
  .wk-more { grid-template-columns: repeat(2, 1fr); }
  .wk-card { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) { .wk-frame, .wk-th, .wk-nav { transition: none; } }
