@charset "UTF-8";
/* ==========================================================================
   ZZAX STUDIO — page-work.css  v1  (13 ก.ย. 2569)
   เฉพาะ portfolio.html และ project-<id>.html เท่านั้น
   โหลดต่อจาก styles.css — ใช้โทเค็น var(--…) ของไฟล์กลางล้วน ไม่มีสีตายตัว
   ห้ามใส่คอมโพเนนต์ที่ใช้หลายหน้าไว้ที่นี่ (ของแบบนั้นอยู่ styles.css)

   สารบัญ
     1. WORK INDEX      แผงสัดส่วนหมวดงานใน hero ของ portfolio
     2. PROBLEM GROUPS  การ์ด "เลือกตามปัญหาของคุณ"
     3. PAGE NAV        แถบ anchor แบบ sticky ในหน้าโปรเจกต์
     4. PROJECT HERO    เฟรมอุปกรณ์ + แผงสำรองตอนไม่มีภาพ
     5. FEATURE GRID    ฟีเจอร์ 6 ข้อ 3×2
     6. GALLERY         แกลเลอรีภาพหน้าจอ
     7. TAG ROW
     8. MEDIA QUERIES
   ========================================================================== */

/* ============================ 1. WORK INDEX ============================== */
.work-index { gap: var(--sp-4); }
.work-index__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.work-index__list { display: grid; gap: var(--sp-3); }
.work-index__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-3);
}
.work-index__name {
  font-size: var(--fs-14);
  color: var(--fg);
  min-width: 0;
}
.work-index__num {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.work-index__meter {
  grid-column: 1 / -1;
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.work-index__meter > i {
  display: block;
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  background: var(--accent);
  border-radius: inherit;
  transform-origin: left center;
}
html.js .work-index__meter > i { animation: work-meter 700ms var(--ease) both; }
@keyframes work-meter { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================ 2. PROBLEM GROUPS ========================== */
.pgroup { gap: var(--sp-4); }
.pgroup__shot {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}
.pgroup__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pgroup h3 { font-size: var(--fs-22); }
.pgroup > p { font-size: var(--fs-14); margin: 0; }
.pgroup__list { display: grid; gap: var(--sp-2); margin-top: auto; }
.pgroup__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: var(--fs-14);
  line-height: 1.4;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pgroup__list a:hover,
.pgroup__list a:focus-visible { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pgroup__list .mono { flex: none; font-size: 10px; }

/* ============================ 3. PAGE NAV (sticky) ======================= */
.pnav {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: var(--ink-900);
  border-top: 1px solid var(--ink-600);
  border-bottom: 1px solid var(--ink-600);
}
.pnav__list {
  display: flex;
  gap: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.pnav__list::-webkit-scrollbar { display: none; }
.pnav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mid);
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pnav a:hover,
.pnav a:focus-visible { color: var(--signal); border-bottom-color: var(--signal); text-decoration: none; }
.has-pnav > section[id] { scroll-margin-top: calc(var(--header-h) + 52px); }

/* ============================ 4. PROJECT HERO ============================ */
.phero__media { position: relative; }
.phero__back { justify-self: start; }

/* กริดการ์ด "โปรเจกต์ใกล้เคียง" — 3 ใบ (styles.css ตั้งไว้ 4 คอลัมน์) */
.portfolio-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* แถบ proof ที่มีตัวเลขเดียว (styles.css มี --2 / --3 อยู่แล้ว) */
.stats--1 { grid-template-columns: minmax(0, 1fr); }

/* แผงสำรองเมื่อโปรเจกต์ยังไม่มีภาพหน้าจอและไม่มีโลโก้ — เป็นกราฟิก ไม่ใช่ภาพปลอม */
.screen-stub {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5);
  text-align: center;
  background:
    radial-gradient(120% 100% at 50% 0%, var(--ink-700), var(--ink-900) 72%);
}
.screen-stub::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--ink-600) 1px, transparent 1px),
    linear-gradient(to bottom, var(--ink-600) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .28;
}
.screen-stub > * { position: relative; }
.screen-stub__mark {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-hi);
}
.screen-stub__logo {
  width: min(52%, 240px);
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-600);
}
.screen-stub__sub {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal);
}

/* ============================ 5. FEATURE GRID ============================ */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.feat {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  padding: var(--sp-5);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.feat:hover { transform: translateY(-2px); border-color: var(--accent); }
.feat__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--fg-mid);
}
.feat p { margin: 0; font-size: var(--fs-14); line-height: 1.65; }

/* ============================ 6. GALLERY ================================= */
.gallery { display: grid; gap: var(--gap); }
.gallery__rest {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.gallery__phones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.gallery__phone { width: clamp(180px, 22vw, 240px); }
.gallery__phone figcaption {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--fg-mid);
  text-align: center;
}

/* ============================ 7. TAG ROW ================================= */
.tagrow { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ============================ 8. MEDIA QUERIES =========================== */
@media (max-width: 960px) {
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .pnav { display: none; }
  .has-pnav > section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
  .gallery__rest { grid-template-columns: minmax(0, 1fr); }
  .portfolio-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .feat-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery__phone { width: min(220px, 62%); }
  .portfolio-grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html.js .work-index__meter > i { animation: none; }
  .feat:hover { transform: none; }
}
