﻿body {
    font-family: "IBM Plex Sans Thai", sans-serif;
    font-weight:500;
   background:#fff;
}

.bg_orange {
    background: #ffa500;
}

.bg_gray {
    background: #E7E7E7;
}

.btn_main {
    background: #ffa500;
    color: #fff;
    font-weight: bold;
    padding: 5px 20px;
    border-radius:20px;
}

    .btn_main:hover {
        background: #ffa500;
        color: #000;
        padding: 5px 20px;
    }

/* ====================================================================
   ตารางสเปค + หมายเหตุ (paragraph template 35 / 37 / 38 / 36)
   js/main.js สานทุกคอลัมน์เป็น grid เดียว แถวจึงตรงกันเสมอ
   จำนวนคอลัมน์กำหนดโดย template (2-4) · แถวแรก = หัวตาราง (แก้ได้ในแอดมิน)
   ==================================================================== */

.spec-wrap {
    margin: 1.25rem 0 2rem;
}

.spec-table {
    display: grid;
    /* ค่าเริ่มต้นเผื่อ JS ไม่ทำงาน — ปกติ JS จะ set ทับตามจำนวนคอลัมน์จริง */
    grid-template-columns: minmax(140px, 30%) 1fr;
    background: #fff;
    border: 1px solid #f0e4d2;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .07);
}

/* หัวตาราง (แถวแรก) */
.spec-head {
    background: linear-gradient(180deg, #fff6e8 0%, #ffedd6 100%);
    color: #b45309;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .01em;
    padding: 14px 22px;
    border-bottom: 2px solid #ffa500;
    text-align: center;
}

/* ช่องข้อมูล — ชิดบน ชิดซ้าย มี space */
.spec-cell {
    padding: 14px 22px;
    color: #34495e;
    font-size: 1rem;
    line-height: 1.7;
    text-align: left;
    align-self: stretch;
    border-top: 1px solid #f5eee3;
    min-width: 0;
    overflow-wrap: anywhere;
}

.spec-cell-label {
    font-weight: 600;
    color: #2c3e50;
}

/* สลับสีแถว — nth-child ขึ้นกับจำนวนคอลัมน์ จึงต้องเขียนแยกต่อ data-cols
   (นับรวมหัวตาราง N ช่องที่นำหน้าอยู่) */
.spec-table[data-cols="1"] > .spec-cell:nth-child(2n+1) {
    background: #fffaf2;
}

.spec-table[data-cols="2"] > .spec-cell:nth-child(4n+1),
.spec-table[data-cols="2"] > .spec-cell:nth-child(4n+2) {
    background: #fffaf2;
}

.spec-table[data-cols="3"] > .spec-cell:nth-child(6n+1),
.spec-table[data-cols="3"] > .spec-cell:nth-child(6n+2),
.spec-table[data-cols="3"] > .spec-cell:nth-child(6n+3) {
    background: #fffaf2;
}

.spec-table[data-cols="4"] > .spec-cell:nth-child(8n+1),
.spec-table[data-cols="4"] > .spec-cell:nth-child(8n+2),
.spec-table[data-cols="4"] > .spec-cell:nth-child(8n+3),
.spec-table[data-cols="4"] > .spec-cell:nth-child(8n+4) {
    background: #fffaf2;
}

.spec-cell p:last-child,
.spec-cell ul:last-child,
.spec-cell ol:last-child,
.spec-head p:last-child {
    margin-bottom: 0;
}

/* ยังไม่ถูก JS สาน (ปิด JS) — ยังอ่านได้เป็นคอลัมน์ */
.spec-col {
    padding: 14px 22px;
    line-height: 1.7;
    color: #34495e;
    border-top: 1px solid #f5eee3;
}

/* ====== กล่องหมายเหตุ ====== */
.spec-note {
    background: #fffaf2;
    border: 1px solid #f0e4d2;
    border-left: 4px solid #ffa500;
    border-radius: 14px;
    padding: 16px 22px 14px;
    margin: 1.25rem 0 2rem;
}

.spec-note-head {
    color: #b45309;
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 6px;
}

.spec-note-body {
    color: #4a5568;
    font-size: .96rem;
    line-height: 1.75;
    text-align: left;
}

.spec-note-body p:last-child,
.spec-note-body ul:last-child,
.spec-note-body ol:last-child {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .spec-table {
        border-radius: 12px;
    }

    .spec-head {
        padding: 11px 13px;
        font-size: .86rem;
    }

    .spec-cell,
    .spec-col {
        padding: 11px 13px;
        font-size: .92rem;
    }
}

/* ==================================================================
   แกลเลอรีรูป (รูปใหญ่ + thumbnail + lightbox)
   ใช้ร่วมกันระหว่าง content.aspx และ our_work_detail.aspx
   ================================================================== */
/* ====== gallery (รูปใหญ่ + thumbnail) ====== */
.gallery-card { background: linear-gradient(180deg,#ffffff 0%,#fff3e0 100%); border-radius: 24px; box-shadow: 0 8px 22px rgba(0,0,0,.08); padding: 1.5rem 1.25rem 1.25rem; margin: 1.5rem auto 2.5rem; }

.gv-main { position: relative; border-radius: 18px; overflow: hidden; background: #0d0f14; display: flex; align-items: center; justify-content: center; }
.gv-main-img { width: 100%; max-height: 480px; object-fit: contain; display: block; cursor: zoom-in; transition: opacity .18s ease; }
.gv-main-img.is-fading { opacity: 0; }

.gv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff; font-size: 26px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; transition: background .2s, transform .2s; }
.gv-nav:hover { background: #ff6f00; }
.gv-prev { left: 12px; } .gv-next { right: 12px; }
.gv-main:hover .gv-nav { transform: translateY(-50%) scale(1.08); }

.gv-thumbs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; padding: 4px 2px 8px; scroll-behavior: smooth; scrollbar-width: thin; }
.gv-thumbs::-webkit-scrollbar { height: 6px; }
.gv-thumbs::-webkit-scrollbar-thumb { background: #ffcc80; border-radius: 3px; }
.gv-thumb { flex: 0 0 auto; width: 84px; height: 64px; border: 3px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; background: #f0f0f0; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.gv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-thumb:hover { transform: translateY(-2px); }
.gv-thumb.is-active { border-color: #ff6f00; box-shadow: 0 4px 10px rgba(255,111,0,.3); }

.gv-count { text-align: center; font-size: .85rem; color: #8a94a6; margin-top: 8px; }

/* lightbox (กดรูปใหญ่) */
.gv-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 3000; display: flex; align-items: center; justify-content: center; animation: gvFade .2s ease; }
.gv-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.gv-lb-close { position: absolute; top: 20px; right: 24px; width: 46px; height: 46px; border: none; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; }
.gv-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: none; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 30px; cursor: pointer; }
.gv-lb-close:hover, .gv-lb-nav:hover { background: #ff6f00; }
.gv-lb-prev { left: 24px; } .gv-lb-next { right: 24px; }
.gv-lb-cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: 1rem; padding: 0 1rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@keyframes gvFade { from { opacity: 0 } to { opacity: 1 } }

@media (max-width: 576px) {
    .gv-main-img { max-height: 320px; }
    .gv-thumb { width: 68px; height: 52px; }
    .gv-nav { width: 38px; height: 38px; font-size: 22px; }
}

/* ==================================================================
   ย่อหน้า (paragraph) — ช่องกริดที่ไม่ได้ใส่รูป/ข้อความ จะเหลือ <div> เปล่า
   ตัวแทนที่ placeholder คืนค่าว่างเมื่อไม่มีข้อมูล (ไม่เกิดรูปเสีย)
   แต่ div เปล่ายังกินคอลัมน์อยู่ ทำให้รูปที่ใส่ไม่เรียงชิดกัน → ซ่อนทิ้ง
   ================================================================== */
.df_pdlr > div:empty { display: none; }

/* รูปในย่อหน้าถูกใส่คลาส img-center มาตลอด (จาก ms_Tag_Template)
   แต่ไม่เคยมีนิยามส่วนกลาง — มีแค่ใน category.aspx รูปจึงชิดซ้ายในหน้าอื่น */
.img-center { display: block; margin-inline: auto; }
