/* ============================================================
   ข้างกัน สตูดิโอ — Website
   สไตล์: Archive / Index (แนว BIG.dk)
   พื้นขาว · sans-serif สะอาด · metadata เป็น mono · กริดผลงานเป็นพระเอก
   ============================================================ */

:root {
  --ink:    #141414;   /* ตัวอักษรหลัก */
  --paper:  #ffffff;   /* พื้นหลัง */
  --muted:  #8a8a85;   /* ตัวอักษรรอง */
  --line:   #e6e5e0;   /* เส้น hairline */
  --hover:  #f5f4f0;   /* พื้นตอน hover */
  --accent: #3d4a38;   /* เขียวแบรนด์ (ใช้เป็น accent บางจุด) */

  --pad: clamp(24px, 4vw, 56px);
  --font-body: "IBM Plex Sans Thai", "Noto Sans Thai", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { font-weight: 600; line-height: 1.22; }

.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pad { padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- Notice bar ---------- */
.mock-bar { background: var(--ink); color: #cfcfc8; text-align: center; font-size: .72rem; letter-spacing: .05em; padding: 6px 16px; font-family: var(--font-mono); }

/* ---------- Top bar / header ---------- */
.header { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--ink); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 var(--pad); }
.brand { font-weight: 600; font-size: 1.18rem; letter-spacing: .01em; display: flex; align-items: baseline; gap: 9px; }
.brand small { font-family: var(--font-mono); font-weight: 400; font-size: .62rem; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.links { display: flex; gap: 44px; list-style: none; font-size: .88rem; letter-spacing: .04em; align-items: center; }
.links a { position: relative; padding: 4px 0; }
.links a:hover { color: var(--muted); }
.links a.active { border-bottom: 1px solid var(--ink); }
.menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-btn span { width: 22px; height: 1.5px; background: var(--ink); transition: .25s; }

/* ---------- Filter / category bar ---------- */
.filter { position: sticky; top: 60px; z-index: 35; background: var(--paper); border-bottom: 1px solid var(--line); }
.filter-in { display: flex; flex-wrap: wrap; align-items: center; padding: 0 var(--pad); font-family: var(--font-mono); font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; }
.filter a { padding: 13px 18px 13px 0; color: var(--muted); white-space: nowrap; }
.filter a.on, .filter a:hover { color: var(--ink); }
.filter .count { margin-left: auto; color: var(--muted); }

/* ---------- Intro line ---------- */
.intro { padding: 34px var(--pad) 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.intro h1 { font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 500; max-width: 780px; line-height: 1.3; }
.intro .meta { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }

/* ---------- Project grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: block; position: relative; }
.cell:nth-child(4n) { border-right: none; }
.cell:hover { background: var(--hover); }
.thumb { aspect-ratio: 1/1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.thumb .cam { font-size: .76rem; color: rgba(255,255,255,.72); position: relative; z-index: 1; }
.badge { position: absolute; left: 11px; top: 11px; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid rgba(255,255,255,.8); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: .6rem; color: #fff; z-index: 1; }
.info { padding: 13px 15px 17px; }
.info .yr { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); letter-spacing: .05em; }
.info h3 { font-size: .98rem; font-weight: 600; margin: 3px 0 2px; }
.info .loc { font-size: .84rem; color: var(--muted); }
.arrow { position: absolute; right: 14px; bottom: 15px; opacity: 0; transition: .2s; }
.cell:hover .arrow { opacity: 1; }

/* thumbnail tones (placeholder รูป) */
.t1 { background: linear-gradient(150deg,#7d8a6f,#3d4a38); }
.t2 { background: linear-gradient(150deg,#b6a07d,#8a7350); }
.t3 { background: linear-gradient(150deg,#9aa6ad,#5d6b72); }
.t4 { background: linear-gradient(150deg,#c2bcae,#8f897a); }
.t5 { background: linear-gradient(150deg,#a7b59a,#6b7860); }
.t6 { background: linear-gradient(150deg,#cbb9a0,#9a845f); }

/* ---------- Hover image cycle (การ์ดหน้าแรก) ---------- */
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease, transform 3s ease; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.72); font-size: .76rem; }
.shot.on { opacity: 1; }
.cell:hover .shot.on { transform: scale(1.04); }
.ticks { position: absolute; left: 11px; right: 11px; bottom: 11px; display: flex; gap: 4px; z-index: 2; opacity: 0; transition: opacity .2s; }
.cell:hover .ticks { opacity: 1; }
.ticks i { flex: 1; height: 2px; background: rgba(255,255,255,.4); }
.ticks i.on { background: #fff; }

/* ---------- Slideshow (หน้ารายละเอียดโครงการ) ---------- */
.slideshow { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #1a1a1a; border-bottom: 1px solid var(--line); }
.slideshow .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-size: .85rem; }
.slideshow .slide.on { opacity: 1; }
.ss-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: none; background: rgba(255,255,255,.85); cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: .2s; z-index: 2; }
.ss-nav:hover { background: #fff; }
.ss-nav.prev { left: 16px; } .ss-nav.next { right: 16px; }
.counter { position: absolute; left: 16px; bottom: 16px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; color: #fff; background: rgba(0,0,0,.4); padding: 5px 11px; z-index: 2; }
.dots { position: absolute; right: 16px; bottom: 18px; display: flex; gap: 7px; z-index: 2; }
.dots i { width: 8px; height: 8px; border: 1px solid #fff; border-radius: 50%; cursor: pointer; transition: .2s; }
.dots i.on { background: #fff; }

/* ---------- Project list (เรียงแนวตั้งคอลัมน์เดียว แบบ BIG.dk) ---------- */
.list { padding: 0 var(--pad); max-width: 1100px; margin: 0 auto; }
.item { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(20px, 3vw, 48px); align-items: center; padding: clamp(64px, 9vw, 112px) 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .meta { text-align: right; }
.item .ico { width: 52px; height: 52px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 0 18px auto; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em; }
.item h3 { font-size: clamp(1.1rem, 2vw, 1.55rem); font-weight: 500; }
.item .loc { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.item .yr { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; color: var(--muted); margin-top: 10px; }
.item .pic { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #ddd; }
.item:hover .arrow { opacity: 1; }
@media (max-width: 720px) {
  .item { grid-template-columns: 1fr; gap: 16px; padding: 32px 0; }
  .item .meta { text-align: left; order: 2; }
  .item .ico { margin: 0 0 12px 0; width: 44px; height: 44px; }
  .item .pic { order: 1; aspect-ratio: 16/11; }
}

/* ---------- Generic section / page ---------- */
.section { padding: 64px var(--pad); border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: none; }
.page-head { padding: 56px var(--pad) 44px; border-bottom: 1px solid var(--ink); }
.page-head .label { margin-bottom: 14px; display: block; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; max-width: 880px; }
.page-head p { color: var(--muted); max-width: 600px; margin-top: 16px; }
.maxw { max-width: 760px; }
.lead { font-size: 1.15rem; font-weight: 500; max-width: 760px; line-height: 1.5; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; }

/* ---------- Index list (รายการแบบ BIG: บริการ/ขั้นตอน) ---------- */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 70px 1fr 1.4fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row .num { font-family: var(--font-mono); color: var(--muted); font-size: .8rem; }
.row h3 { font-size: 1.2rem; }
.row p { color: var(--muted); font-size: .95rem; }
.row ul { color: var(--muted); font-size: .92rem; list-style: none; }
.row ul li { padding: 1px 0; }

/* ---------- Project detail — 3-column (BIG.dk style) ---------- */
.back { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 20px; }
.back:hover { color: var(--ink); }

.pj3 { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: clamp(24px, 3vw, 48px); padding: 48px var(--pad) 0; max-width: 1300px; margin: 0 auto; align-items: start; }

.pj-left { text-align: right; position: sticky; top: 80px; }
.pj-ico { width: 52px; height: 52px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em; margin: 0 0 16px auto; }
.pj-name { font-size: clamp(1rem, 1.6vw, 1.4rem); font-weight: 500; line-height: 1.3; }
.pj-loc { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.pj-specs { margin-top: 32px; border-top: 1px solid var(--line); }
.pjs { display: flex; flex-direction: column; align-items: flex-end; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 3px; }
.pjs span { font-size: .92rem; font-weight: 500; }
.pjs small { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.pj-hero { overflow: hidden; }
.pj-slides { position: relative; width: 100%; aspect-ratio: 5/4; overflow: hidden; cursor: pointer; }
.pj-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-size: .85rem; }
.pj-slide.on { opacity: 1; }
.pj-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; background: rgba(255,255,255,.85); cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: .2s; z-index: 3; opacity: 0; }
.pj-slides:hover .pj-nav { opacity: 1; }
.pj-nav:hover { background: #fff; }
.pj-prev { left: 14px; } .pj-next { right: 14px; }
.pj-counter { position: absolute; left: 14px; bottom: 14px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; color: #fff; background: rgba(0,0,0,.45); padding: 5px 10px; z-index: 2; }

.pj-right { padding-top: 4px; font-size: .92rem; line-height: 1.8; color: var(--ink); }

.pj-gallery { display: flex; gap: 0; margin-top: 48px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.pj-gallery::-webkit-scrollbar { display: none; }
.pj-gallery:active { cursor: grabbing; }
.pj-gallery .ph { flex: 0 0 33.333vw; aspect-ratio: 4/3; scroll-snap-align: start; }

.next { display: flex; justify-content: space-between; align-items: center; padding: 40px var(--pad); border-top: 1px solid var(--line); margin-top: 48px; }
.next .mono { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.next a { font-size: 1.2rem; font-weight: 500; }

@media (max-width: 900px) {
  .pj3 { grid-template-columns: 1fr; padding-top: 32px; }
  .pj-left { text-align: left; position: static; }
  .pj-ico { margin: 16px 0; }
  .pjs { align-items: flex-start; }
  .pj-specs { border-top: 1px solid var(--line); }
}

/* ---------- Placeholder block ---------- */
.ph { background: linear-gradient(150deg,#9aa6ad,#5d6b72); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.72); font-size: .8rem; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 56px var(--pad); }
.cinfo .row2 { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cinfo .row2 b { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid var(--line); font-family: var(--font-body); font-size: 1rem; background: transparent; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.btn { display: inline-block; padding: 14px 30px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--ink); cursor: pointer; transition: .2s; }
.btn:hover { background: var(--paper); color: var(--ink); }
.form-note { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); margin-top: 14px; letter-spacing: .03em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--ink); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 30px; padding: 44px var(--pad); }
.footer h4 { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.footer ul { list-style: none; }
.footer ul li { padding: 4px 0; font-size: .92rem; color: var(--muted); }
.footer ul li a:hover { color: var(--ink); }
.footer .brand { margin-bottom: 12px; }
.footer .tag { font-size: .92rem; color: var(--muted); max-width: 280px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px var(--pad); border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .cell:nth-child(3n) { border-right: none; }
  .proj-body { grid-template-columns: 1fr; gap: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .links { position: fixed; inset: 60px 0 auto 0; background: var(--paper); flex-direction: column; gap: 0; align-items: stretch; padding: 6px var(--pad) 18px; border-bottom: 1px solid var(--ink); transform: translateY(-160%); transition: transform .3s ease; }
  .header.open .links { transform: translateY(0); }
  .links li { border-bottom: 1px solid var(--line); }
  .links a { display: block; padding: 14px 0; }
  .menu-btn { display: flex; }
  .header.open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .header.open .menu-btn span:nth-child(2) { opacity: 0; }
  .header.open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .grid { grid-template-columns: repeat(2, 1fr); }
  .cell:nth-child(3n) { border-right: 1px solid var(--line); }
  .cell:nth-child(2n) { border-right: none; }
  .intro .meta { display: none; }
  .specs { grid-template-columns: 1fr 1fr; }
  .spec:nth-child(2n) { border-right: none; }
  .spec { border-bottom: 1px solid var(--line); }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .contact { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr; }
  .next a { font-size: 1.05rem; }
}
/* คงกริด 2 คอลัมน์ไว้บนมือถือ (สไตล์ archive) — ปรับขนาดตัวอักษรเล็กลงเล็กน้อย */
@media (max-width: 420px) {
  .info h3 { font-size: .9rem; }
  .info .loc { font-size: .78rem; }
  .badge { left: 8px; top: 8px; }
}

/* ---------- Real images inside placeholder elements ---------- */
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pj-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { position: relative; overflow: hidden; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
