/* ========================================================== */
/* 👑 ดีไซน์สำหรับหน้าอ่านเนื้อหาข่าวสาร (News Detail Shared Styles) */
/* ========================================================== */

/* คุมโทนสีพื้นหลังดำและตัวหนังสือขาวของหน้าเว็บ */
body.nd-body-bg {
    background-color: #0b0b0b !important;
    color: #ffffff !important;
}

/* กล่องล็อกหน้าต่างให้อยู่กึ่งกลางจอและเว้นระยะจาก Navbar */
.nd-container {
    max-width: 900px !important;
    margin: 140px auto 60px auto !important; 
    padding: 0 20px !important;
}

/* การ์ดแผ่นหลังสีเทาเข้มหรูหราสำหรับโอบอุ้มเนื้อหา */
.nd-card {
    background: #161616 !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 16px !important;
    padding: 40px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* ปุ่มกดย้อนกลับสีทอง */
.nd-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #e6b800 !important; /* สีทองประจำแบรนด์คุณปุ๊การบัญชี */
    text-decoration: none !important;
    font-size: 0.95rem !important;
    margin-bottom: 25px !important;
    transition: 0.3s ease !important;
}

.nd-back-btn:hover {
    color: #ffffff !important;
    transform: translateX(-5px) !important; /* เอฟเฟกต์สไลด์ถอยหลังตอนเมาส์ชี้ */
}

/* ส่วนแสดงวันที่พิมพ์ข่าว */
.nd-date {
    color: #888888 !important;
    font-size: 0.9rem !important;
    margin-bottom: 15px !important;
}

/* หัวข้อข่าวสาร */
.nd-title {
    font-size: 2rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #ffffff !important;
    margin-bottom: 25px !important;
}

/* กล่องควบคุมขนาดรูปภาพข่าว (แก้ไขตัวสะกดที่พิมพ์ผิดเรียบร้อย) */
.nd-image-wrapper {
    width: 100% !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin-bottom: 30px !important;
    border: 1px solid #333333 !important; /* 🎯 แก้ไขคำสะกดผิดจาก border เป็น border */
}

/* บังคับตัวรูปภาพไม่ให้บวมทะลุเฟรมและสเกลตามหน้าจอ */
.nd-image-wrapper img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* ส่วนจัดการย่อหน้าเนื้อหาข่าวสารให้อ่านง่าย */
.nd-content {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #cccccc !important;
    font-weight: 300 !important;
    text-align: justify !important;
}

.nd-content p {
    font-size: 1.1rem !important;
    color: #f7d61a !important;
    text-align: justify !important;
}

/* ========================================================== */
/* 📱 Responsive รองรับการแสดงผลบนมือถือให้สวยงาม */
/* ========================================================== */
@media (max-width: 768px) {
    .nd-container { 
        margin-top: 100px !important; 
    }
    .nd-card { 
        padding: 20px !important; 
    }
    .nd-title { 
        font-size: 1.5rem !important; 
    }
}


/* 🎯 คุมกล่องรวมให้แบ่งพื้นที่ ซ้าย-ขวา */
.nd-custom-split-container {
    display: flex;
    flex-wrap: wrap;       /* รองรับหน้าจอมือถือ */
    gap: 30px;             /* ระยะห่างช่องไฟระหว่างฝั่งซ้ายและขวา */
    margin-top: 20px;
    align-items: flex-start;
}

/* 📝 คุมพื้นที่ฝั่งข้อความ (ซ้าย) */
.nd-text-side {
    flex: 1 1 500px;       /* ถ้าหน้าจอใหญ่จะกว้างอย่างน้อย 500px */
}

.nd-text-side .nd-content p {
    font-size: 16px;
    line-height: 1.8;
    color: #e0e0e0;        /* สีตัวอักษรให้อ่านง่ายขึ้นในธีมมืด */
}

/* 📸 คุมพื้นที่ฝั่งรูปภาพทั้ง 3 รูป (ขวา) */
.nd-image-side-grid {
    flex: 1 1 400px;       /* คุมขนาดฝั่งขวา */
    display: flex;
    flex-direction: column;/* สั่งให้รูปเรียงดิ่งลงมาในบล็อกฝั่งขวา */
    gap: 20px;             /* ระยะห่างระหว่างรูปภาพแต่ละรูป */
}

/* 🖼️ ปรับแต่งดีไซน์และคุมขนาดรูปภาพไม่ให้ล้น */
.nd-image-item img {
    width: 100%;           /* รูปขยายเต็มพื้นที่ฝั่งขวา */
    max-width: 480px;      /* คุมความกว้างสูงสุดไม่ให้ใหญ่เกินไป */
    height: auto;          /* สัดส่วนออโต้ รูปไม่เบี้ยวแน่นอน */
    border-radius: 12px;   /* ทำขอบมนให้สวยงามเข้ากับธีมเว็บ */
    border: 1px solid #333333; /* ใส่เส้นขอบมืด ๆ จาง ๆ */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* เพิ่มเงาหนุนให้รูปดูเด่นออกมา */
    display: block;
    margin: 0 auto;        /* จัดกึ่งกลางบล็อก */
}

/* 📱 โหมด Responsive สำหรับหน้าจอมือถือ */
@media (max-width: 768px) {
    .nd-custom-split-container {
        flex-direction: column; /* บนมือถือให้สลับข้อความอยู่บน รูปภาพอยู่ล่าง */
    }
    .nd-image-side-grid {
        width: 100%;
    }
    .nd-image-item img {
        max-width: 100%;    /* บนมือถือให้รูปขว้างเต็มจอพอดี */
    }
}

@media screen and (max-width: 768px) {
    /* จัดการหน้าทำบัญชีร้านทอง */
    .nd-container {
        padding: 25px 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .nd-title {
        font-size: 24px !important;
        text-align: center !important;
    }
    .nd-grid-services {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    .nd-service-card {
        width: 100% !important;
        height: auto !important; /* ปลดล็อกความสูง ไม่ให้ตัวหนังสือทะลุการ์ด */
        padding: 20px !important;
    }
    .nd-card-title, .nd-card-desc {
        height: auto !important; /* ปลดล็อกความสูงของข้อความภายใน */
    }
}

/* ==========================================================================
   🎯 FIX CONFLICT: แก้ไขบัคตัวหนังสือทะลุการ์ดในหน้า gold-accounting.php
   ========================================================================== */
@media screen and (max-width: 768px) {
    .nd-container {
        padding: 30px 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .nd-title {
        font-size: 24px !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }
    .nd-lead-text {
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: justify !important;
    }
    
    /* เปลี่ยน Grid คอมพิวเตอร์ ให้เป็นแนวตั้งเรียงเดี่ยวบนมือถือ */
    .nd-grid-services {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }
    
    /* ปลดล็อกความสูงตายตัวออกทั้งหมด ปล่อยให้ขยายตามตัวหนังสือจริงอัตโนมัติ */
    .nd-service-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important; /* ปลดล็อกกล่องดำ */
        min-height: 0 !important;
        max-height: none !important;
        padding: 25px 20px !important;
        box-sizing: border-box !important;
    }
    .nd-card-title {
        font-size: 18px !important;
        height: auto !important; /* ปลดล็อกหัวข้อ */
        margin: 15px 0 10px 0 !important;
    }
    .nd-card-desc {
        font-size: 14px !important;
        line-height: 1.6 !important;
        height: auto !important; /* ปลดล็อกคำอธิบาย */
    }
}