/* ==========================================================================
   📌 RESET & OVERRIDE SPACING (แก้ปัญหาระยะเว้นโหว่ช่วงหัวข้อหลัก)
   ========================================================================== */
.nd-card {
    padding-top: 15px !important;
}

.nd-title {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.gold-tax-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.gold-tax-content h3:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   📌 SEMINAR SLIDER SYSTEM (ฉบับปรับปรุงเพื่อเปิดอ่านคู่มือแนวตั้งเล่มใหญ่)
   ========================================================================== */

/* 1. กล่องครอบสไลด์เดอร์ทั้งหมด */
.slider-container {
    position: relative;
    max-width: 100% !important; /* 🎯 เปลี่ยนจาก 800px เป็น 100% เพื่อให้กว้างเต็มหน้าจอ */
    margin: 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}
.slider-window {
    position: relative;
    width: 100%;
    height: auto !important;     /* 🎯 เปลี่ยนจากคงที่ 500px/600px เป็น auto เพื่อให้ความสูงยืดตามรูปจริง */
    min-height: 450px;           /* กำหนดความสูงขั้นต่ำไว้เผื่อตอนรูปยังไม่โหลด */
    overflow: hidden;
    border-radius: 8px;
    background-color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* 3. ตัวจัดการรูปภาพในสไลเดอร์ (สั่งให้รูปขยายเต็มหน้าต่าง) */
.slider-slides img {
    width: 100% !important;      /* 🎯 บังคับให้รูปกว้างเต็ม 100% ของหน้าต่าง */
    height: auto !important;     /* 🎯 ให้ความสูงคำนวณออโต้ สัดส่วนรูปจะไม่เบี้ยวไม่เพี้ยน */
    display: block;
    /* object-fit: contain;         ป้องกันไม่ให้รูปโดนครอปตัดเนื้อหา */
}

/* 2. กรอบหน้าต่างแสดงรูปภาพ (ปรับจาก 16:9 เป็นอัตราส่วนเอกสารแนวตั้ง) */
.slider-wrapper {
    width: 100%;
    /* 🚀 เปลี่ยนสัดส่วนจาก 16/9 เป็น 3 / 4 เพื่อให้รูปเอกสารแนวตั้งขยายเด่นเต็มตา */
    aspect-ratio: 9 / 14;        
    background-color: #111111;    
    border-radius: 12px;          
    overflow: hidden;             
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(241, 196, 15, 0.2); 
}

.slider-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    object-position: center; 
    transition: opacity 0.25s ease-in-out; 
}

/* 4. ปุ่มลูกศร ซ้าย-ขวา (Slider Buttons) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);  
    background: rgba(0, 0, 0, 0.7); 
    color: #ffffff;               
    border: 1px solid #f1c40f;    
    width: 45px;
    height: 45px;
    border-radius: 50%;           
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    z-index: 10;                  
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: #f1c40f;          
    color: #000000;               
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); 
}

/* จัดตำแหน่งปุ่มให้ออกมานอกตัวเอกสารเล็กน้อย */
.prev-btn { 
    left: -15px; 
}
.next-btn { 
    right: -15px; 
}

/* 5. จุดกลมๆ ด้านล่าง (Pagination Dots) */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    flex-wrap: wrap;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.dot {
    width: 8px;
    height: 8px;
    background: #444444;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #f1c40f;          
    transform: scale(1.2);        
}

/* ==========================================================================
   📌 TAX CALCULATION & IMAGE BOXES (ส่วนตารางรูปภาพภาษีทองรูปพรรณ)
   ========================================================================== */

/* การจัดแต่งส่วนกล่องคำนวณภาษีและตาราง (Tax Calculation & Table) */
.tax-calc-box { 
    background: rgba(255, 255, 255, 0.05); 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px dashed rgba(241, 196, 15, 0.3); 
    margin-top: 20px; 
}

.tax-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 15px 0; 
    background: rgba(0, 0, 0, 0.2); 
}

.tax-table th, .tax-table td { 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 12px; 
    text-align: center; 
}

.tax-table th { 
    background-color: rgba(241, 196, 15, 0.2); 
    color: #f1c40f; 
}

/* การจัดแต่งส่วนพื้นที่แสดงรูปภาพอ้างอิง (Gold Image Gallery) */
.gold-img-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-top: 30px; 
}

.gold-img-box { 
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 10px; 
    border-radius: 8px; 
    text-align: center; 
}

.gold-img-box img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 6px; 
    border: 1px solid rgba(241, 196, 15, 0.2); 
}

.gold-img-box p { 
    margin-top: 8px; 
    font-size: 0.9rem; 
    color: #f1c40f; 
}

/* ==========================================================================
   📱 RESPONSIVE DESIGN (ปรับแต่งหน้าจอมือถือ)
   ========================================================================== */
@media (max-width: 768px) {
    .slider-wrapper {
        aspect-ratio: 1 / 1.4; /* บนมือถือปรับให้แคบยาวสไตล์จอมือถือโชว์เอกสารเต็มแผ่น */
    }
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.85);
    }
    /* ดึงปุ่มกลับเข้ามาเกาะบนขอบรูปเพื่อไม่ให้หลุดขอบจอมือถือ */
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
    
    .gold-img-container { 
        grid-template-columns: 1fr; 
    } 
}

.album-year-title {
    font-size: 1.3rem;
    color: #f1c40f; 
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #f1c40f; 
    font-weight: 500;
}

.seminar-album-section {
    margin-bottom: 30px;
}

/* ==========================================================================
   📌 RESET & OVERRIDE SPACING (แก้ปัญหาระยะเว้นโหว่ช่วงหัวข้อหลัก)
   ========================================================================== */
.nd-card {
    padding-top: 15px !important;
}

.nd-title {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.gold-tax-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.gold-tax-content h3:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   📌 TEXT & HEADINGS (หัวข้อและเนื้อหาข้อความ)
   ========================================================================== */
.tax-section-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tax-text-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.style-no-space {
    margin-bottom: 5px;
}

/* กล่องข้อความไฮไลท์เงื่อนไข (Blockquote) */
.tax-info-blockquote {
    border-left: 4px solid #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.tax-info-blockquote strong {
    color: #38bdf8;
    display: inline-block;
    margin-bottom: 5px;
}

/* ==========================================================================
   📌 TAX CALCULATION & TABLE (ตารางเปรียบเทียบและกล่องสรุป)
   ========================================================================== */
.tax-calc-box { 
    background: rgba(255, 255, 255, 0.02); 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px dashed rgba(255, 255, 255, 0.15); 
    margin-top: 15px; 
}

.formula-title {
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
    margin-bottom: 8px;
}

.formula-display-box {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 12px 15px;
    border-radius: 6px;
    color: #e2e8f0;
    font-style: italic;
}

.tax-divider-line {
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.example-title {
    font-size: 0.95rem;
    color: #cbd5e1;
    display: block;
    margin-bottom: 10px;
}

/* สไตล์ตาราง (Tax Table) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tax-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: rgba(0, 0, 0, 0.2); 
    min-width: 500px; /* ป้องกันตารางบีบตัวจนอ่านไม่รู้เรื่องบนมือถือ */
}

.tax-table th, .tax-table td { 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    padding: 12px; 
    text-align: center; 
    vertical-align: middle;
    font-size: 0.95rem;
}

.tax-table th { 
    background-color: rgba(56, 189, 248, 0.15); 
    color: #38bdf8; 
    font-weight: 600;
}

/* สีข้อความสถานะในตาราง */
.tax-table .highlight-green {
    color: #4ade80;
}

.tax-table td[style*="color: #ff6b6b"] {
    color: #f87171 !important; /* ปรับเฉดสีแดงให้อ่านง่ายบนพื้นหลังมืด */
}

/* ==========================================================================
   📌 IMAGE GALLERY (ส่วนพื้นที่แสดงรูปภาพเอกสารอ้างอิง)
   ========================================================================== */
.gold-img-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-top: 20px; 
}

.gold-img-box { 
    background: rgba(255, 255, 255, 0.02); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    padding: 12px; 
    border-radius: 8px; 
    display: flex;
    flex-direction: column;
}

.img-wrapper {
    width: 100%;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gold-img-box img { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gold-img-box:hover img {
    transform: scale(1.03);
}

.img-caption { 
    margin-top: 10px; 
    font-size: 0.85rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0;
}

.dot-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* ==========================================================================
   📱 RESPONSIVE DESIGN (ปรับแต่งหน้าจอมือถือ)
   ========================================================================== */
@media (max-width: 768px) {
    .gold-img-container { 
        grid-template-columns: 1fr; 
        gap: 15px;
    } 

    .tax-section-heading {
        font-size: 1.15rem;
    }

    .tax-table th, .tax-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   📌 LAYOUT & CENTER ALIGNMENT
   ========================================================================== */
.nd-card.main-content-center {
    max-width: 850px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.text-center {
    text-align: center !important;
}

.nd-title {
    text-align: center !important;
    margin-bottom: 25px !important;
}

.gold-tax-content .section-title {
    color: #f1c40f;
    font-size: 1.25rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* กล่องควบคุมการจัดวางกึ่งกลางหน้าจอ */
.center-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 25px 0;
}

/* ==========================================================================
   📌 BLOCKQUOTE (กรอบสีเหลืองทองที่ครอบรูปภาพ)
   ========================================================================== */
.tax-info-blockquote {
    background: rgba(241, 196, 15, 0.04) !important;
    border: 1px solid rgba(241, 196, 15, 0.4) !important;
    border-left: 5px solid #f1c40f !important;
    padding: 20px !important;
    border-radius: 8px;
    width: 100%;
    max-width: 750px; /* คุมขนาดกล่องให้อยู่ตรงกลางสมดุล */
    margin: 0 auto !important;
    box-sizing: border-box;
    display: block !important;
    float: none !important;
}

.blockquote-header {
    margin-bottom: 20px;
    font-size: 1rem;
    color: #ffffff;
}

/* กล่องจัดเรียงรูปภาพภายในกรอบ */
.inner-image-container {
    display: grid;
    grid-template-columns: 0fr 3fr center; /* แบ่งซ้ายขวาเท่ากันข้างในกรอบ */
    gap: 10px;
    margin-top: 15px;
}

.inner-img-box {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 4 / 3; /* ปรับรูปภาพให้สูงเท่ากันโดยอัตโนมัติ */
}

.inner-img-box img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; ตัดภาพไม่ให้ยืดหรือเบี้ยว */
}

/* ==========================================================================
   📌 TABLES & FORMULAS
   ========================================================================== */
.tax-calc-box { 
    background: rgba(255, 255, 255, 0.03); 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px dashed rgba(241, 196, 15, 0.2); 
    margin: 20px auto !important;
    max-width: 750px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.tax-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 10px 0; 
    background: rgba(0, 0, 0, 0.2); 
}

.tax-table th, .tax-table td { 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    padding: 12px; 
    text-align: center; 
}

.tax-table th { 
    background-color: rgba(241, 196, 15, 0.1); 
    color: #f1c40f; 
}

/* Responsive ปรับการแสดงผลสำหรับสมาร์ทโฟน */
@media (max-width: 768px) {
    .inner-image-container {
        grid-template-columns: 1fr; /* ในมือถือจะสลับรูปภาพเรียงต่อกันเป็นแนวตั้งอัตโนมัติ */
    }
    .tax-table th, .tax-table td { 
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   📌 IMAGE GALLERY (แก้ไขให้เรียง 3 รูปแถวเดียวกัน และอิงตามสัดส่วนรูปจริง)
   ========================================================================== */

/* 1. กล่องแม่: เปลี่ยนจาก Grid เป็น Flex เพื่อให้จัดรูปให้อยู่ตรงกลางได้ง่าย */
.gold-img-container { 
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;  /* จัดให้กล่องทั้งหมดอยู่กึ่งกลางหน้าจอ */
    gap: 15px !important;                 /* เว้นระยะห่างระหว่างกล่องรูปภาพ */
    margin-top: 20px !important; 
    width: 100% !important;
}

/* 2. กล่องลูก (กรอบรูปแต่ละใบ): คำนวณให้แบ่งเป็น 3 กล่องพอดีใน 1 แถว */
.gold-img-box { 
    background: rgba(255, 255, 255, 0.02) !important; 
    border: 1px solid rgba(255, 255, 255, 0.08) !important; 
    padding: 12px !important; 
    border-radius: 8px !important; 
    display: flex !important;
    flex-direction: column !important;
    
    /* 🎯 ไฮไลท์จุดสำคัญ: แบ่งพื้นที่ให้แสดง 3 อันในแถวเดียวกันพอดี */
    width: calc(33.333% - 10px) !important; 
    min-width: 240px !important; /* ป้องกันกล่องบีบตัวเล็กเกินไปในหน้าจอที่แคบลง */
    box-sizing: border-box !important;
}

/* 3. หน้าต่างครอบรูป: ลบ aspect-ratio เพื่อปล่อยให้ความสูงยืดตามรูปทรงจริง */
.img-wrapper {
    width: 100% !important;
    background: #111111 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    
    /* 🎯 ไฮไลท์จุดสำคัญ: เปลี่ยนจาก 4/3 เป็น auto เพื่อให้อิงจากรูปจริง ไม่โดนตัดขอบ */
    aspect-ratio: auto !important; 
    
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 4. ตัวรูปภาพด้านใน */
.gold-img-box img { 
    width: 100% !important;
    height: auto !important;         /* ปล่อยให้ความสูงคำนวณตามอัตราส่วนจริง ภาพไม่เบี้ยว */
    max-height: 280px !important;    /* คุมความสูงสูงสุดไม่ให้รูปยาวเกินไปจนดูไม่สวย */
    object-fit: contain !important;  /* แสดงรายละเอียดรูปครบถ้วน ไม่โดนครอปตัดทิ้ง */
}

/* 5. ตัวหนังสืออธิบายใต้ภาพ */
.img-caption { 
    margin-top: 10px !important; 
    font-size: 0.85rem !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
    text-align: center !important;
}

/* ==========================================================================
   📱 RESPONSIVE DESIGN (ระบบสลับการเรียงตัวอัจฉริยะบนมือถือ)
   ========================================================================== */
@media (max-width: 992px) {
    .gold-img-box { 
        width: calc(50% - 10px) !important; /* หน้าจอแท็บเล็ต เรียงแถวละ 2 รูป */
    } 
}

@media (max-width: 576px) {
    .gold-img-box { 
        width: 100% !important;             /* หน้าจอมือถือ เรียงเดี่ยวแนวตั้งตรงกลาง */
        max-width: 320px !important;        /* จำกัดความกว้างบนมือถือให้พอดีสายตา */
    } 
}

/* ==========================================================================
   ส่วนที่เพิ่มเข้ามาใหม่สำหรับ ข้อมูลราคาสมาคมทองคำและการคำนวณภาษี
   ========================================================================== */

.gold-association-box {
    background-color: #1e1e24;
    border-left: 4px solid #f1c40f;
    padding: 18px 20px;
    margin: 25px 0;
    border-radius: 6px;
    color: #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gold-association-box strong {
    color: #f1c40f;
    font-size: 1.05rem;
}

.gold-association-steps {
    margin-top: 10px;
    padding-left: 0;
    list-style: none;
    line-height: 1.7;
}

.gold-association-steps li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.gold-association-steps i.step-arrow {
    font-size: 11px;
    margin: 0 10px;
    color: #a1a1aa;
}

.gold-link-btn {
    display: inline-block;
    background-color: #f1c40f;
    color: #111111;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(241, 196, 15, 0.15);
}

.gold-link-btn:hover {
    background-color: #dfb308;
    color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(241, 196, 15, 0.25);
}

.gold-link-btn i {
    margin-right: 6px;
}

/* ==========================================================================
   CSS สำหรับกล่องประเด็นถาม-ตอบ VAT กรอบพระ และตารางคำนวณยอด
   ========================================================================== */

.faq-vat-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin: 20px 0 30px 0;
    overflow: hidden;
}

.faq-vat-question {
    background-color: #1e293b;
    padding: 15px 20px;
    color: #f1c40f;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-vat-answer {
    padding: 20px;
    color: #e5e7eb;
    line-height: 1.7;
}

.faq-vat-answer .ans-title {
    font-size: 1.1rem;
}

.vat-rule-list {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.vat-rule-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.vat-rule-list li i {
    margin-right: 10px;
    margin-top: 5px;
    font-size: 14px;
}

.text-gold { color: #f1c40f !important; }
.text-red { color: #ef4444 !important; }

.example-calc-title {
    display: block;
    margin-top: 20px;
    color: #38bdf8;
}

.txt-sm-grey {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 2px;
    margin-bottom: 15px;
}

/* การจัดวางกล่องคำนวณแบบ Grid เปรียบเทียบสองฝั่ง */
.vat-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .vat-compare-grid {
        grid-template-columns: 1fr;
    }
}

.vat-calc-card {
    background: #15151a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 15px;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-blue { background-color: #1e3a8a; color: #60a5fa; }
.badge-green { background-color: #064e3b; color: #34d399; }

.calc-table-mini {
    width: 100%;
    margin-top: 25px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.calc-table-mini td {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.text-right { text-align: right; }

.row-highlight {
    color: #38bdf8;
    font-weight: 500;
}

.row-total {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #fff;
}
.row-total td { border-bottom: none; padding-top: 10px; }

/* ==========================================================================
   ส่วนต่อขยายไฟล์ CSS: ตารางสูตรคำนวณและกล่องแกลเลอรีรูปขนาดกะทัดรัด (Thumbnail)
   ========================================================================== */

/* คอนเทนเนอร์กล่องคำถาม-คำตอบ */
.faq-vat-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin: 15px 0 25px 0;
    overflow: hidden;
}

.faq-vat-question {
    background-color: #1a2333;
    padding: 14px 18px;
    color: #f1c40f;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-vat-answer {
    padding: 18px;
    color: #e5e7eb;
    line-height: 1.6;
}

.faq-vat-answer .ans-title {
    font-size: 1.05rem;
}

/* รายการกฎการเรียกเก็บ VAT */
.vat-rule-list {
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

.vat-rule-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.vat-rule-list li i {
    margin-right: 10px;
    margin-top: 5px;
    font-size: 14px;
}

.text-gold { color: #f1c40f !important; }
.text-red { color: #f87171 !important; }

.example-calc-title {
    display: block;
    margin-top: 15px;
    color: #38bdf8;
    font-size: 0.95rem;
}

.txt-sm-grey {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 2px;
    margin-bottom: 12px;
}

/* ชุดตารางคำนวณแบบแยก 2 ฝั่ง (Grid Layout) */
.vat-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.vat-calc-card {
    background: #131317;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 12px;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.badge-blue { background-color: #1e3a8a; color: #60a5fa; }
.badge-green { background-color: #064e3b; color: #34d399; }

.calc-table-mini {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.calc-table-mini td {
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

.text-right { text-align: right; }
.row-highlight { color: #38bdf8; }
.row-total {
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #ffffff;
}

/* ==========================================================================
   โซนจัดการแกลเลอรีรูปภาพย่อส่วนลง (Thumbnail View) ไม่ให้พองใหญ่ดึงสายตา
   ========================================================================== */
.gold-img-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.gold-thumbnail-box {
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.gold-thumbnail-box .img-aspect-wrapper {
    width: 100%;
    height: 120px; /* คุมระนาบความสูงภาพให้เท่ากันกะทัดรัด */
    overflow: hidden;
    border-radius: 4px;
    background-color: #222;
}

.gold-thumbnail-box .img-aspect-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ตัดครอปจัดระเบียบภาพอัตโนมัติ */
    transition: transform 0.2s ease;
}

.gold-thumbnail-box:hover .img-aspect-wrapper img {
    transform: scale(1.03);
}

.img-caption-txt {
    font-size: 0.78rem;
    margin-top: 8px;
    line-height: 1.4;
    color: #9ca3af;
    text-align: left;
}

.dot-status {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
}
.red-dot { background-color: #f87171; }
.green-dot { background-color: #4ade80; }
.blue-dot { background-color: #38bdf8; }

/* Responsive สำหรับโทรศัพท์มือถือ */
@media (max-width: 768px) {
    .vat-compare-grid,
    .gold-img-grid-container {
        grid-template-columns: 1fr;
    }
    .gold-thumbnail-box .img-aspect-wrapper {
        height: 160px; /* ยืดระยะภาพให้รับกับหน้าจอสมาร์ทโฟนแนวดิ่ง */
    }
}

/* ==========================================================================
   CSS สำหรับหน้าภาษอัญมณี: จัดข้อความนำหน้า และกรอบรูปภาพ Grid แถวเดียวตามบรีฟ
   ========================================================================== */

/* กล่องไฮไลต์ขั้นตอนด้านบนสุด */
.tax-step-highlight-box {
    background-color: #1a2332;
    border-radius: 8px;
    padding: 15px 20px;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* หัวข้อสีทอง */
.tax-sub-title-gold {
    color: #f1c40f !important;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ข้อความอธิบายสีขาวนวล */
.tax-desc-text-white {
    color: #e5e7eb;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* กล่องใหญ่ครอบภาพรวมดีไซน์แบบมีเส้นขอบทอง */
.gold-border-gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    border: 1px solid #f1c40f; /* เส้นขอบทองล้อมรอบกลุ่มรูปภาพตามดีไซน์ */
    border-radius: 8px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

/* บล็อกแสดงรูปรายชิ้น */
.gold-gallery-item {
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ตัวกรอบล้อมรูปภาพเดี่ยว */
.gold-gallery-item .img-frame {
    width: 100%;
    height: 140px; /* คุมความสูงไม่ให้ภาพใหญ่เทอะทะเกินไป */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    overflow: hidden;
    background-color: #111;
}

.gold-gallery-item .img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ปรับภาพให้อยู่กึ่งกลางสัดส่วนพอดี */
}

/* คำอธิบายใต้รูปภาพ */
.gold-gallery-item .img-meta-desc {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 10px;
    line-height: 1.4;
}

/* รองรับการแสดงผลบนหน้าจอมือถือให้แสดงผลสลับลงมาเป็นแนวตั้งอัตโนมัติ */
@media (max-width: 768px) {
    .gold-border-gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    .gold-gallery-item .img-frame {
        height: 180px;
    }
}

/* ==========================================================================
   CSS ชุดแต่งหน้า: จัดข้อความนำก่อน และจัดกรอบรูปภาพ Grid ล้อมขอบทองแบบสากล
   ========================================================================== */

/* กล่องข้อความสไตล์โมเดิร์นคลีน */
.tax-step-highlight-box {
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #f1c40f;
    border-radius: 4px;
    padding: 18px 22px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* คอนเทนเนอร์รูปภาพล้อมเส้นกรอบเหลืองทองแถวเดียวกระชับพื้นที่ */
.gold-border-gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    border: 1px solid #f1c40f;
    border-radius: 8px;
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.15);
    margin-top: 20px;
    margin-bottom: 20px;
}

.gold-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* กรอบรูปชิ้นเดี่ยว */
.gold-gallery-item .img-frame {
    width: 100%;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    background-color: #151518;
}

.gold-gallery-item .img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease-in-out;
}

.gold-gallery-item:hover .img-frame img {
    transform: scale(1.02);
}

/* ข้อความใต้ภาพอ้างอิง */
.gold-gallery-item .img-meta-desc {
    font-size: 0.85rem;
    color: #a1a1aa;
    margin-top: 12px;
    line-height: 1.5;
}

/* Responsive สำหรับขนาดหน้าจอสมาร์ทโฟน */
@media (max-width: 768px) {
    .gold-border-gallery-container {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 16px;
    }
    .gold-gallery-item .img-frame {
        height: 190px;
    }
}

/* ==========================================================================
   CSS จัดระเบียบรูปภาพขั้นกลางหัวข้อ แบบเรียงทีละข้อความเดี่ยว
   ========================================================================== */

/* คอนเทนเนอร์คุมระยะห่างกล่องรูปภาพเดี่ยว */
.gold-single-img-container {
    max-width: 700px; /* คุมความกว้างไม่ให้รูปใหญ่บวมล้นจอคอม */
    margin: 0 auto 35px auto; /* จัดกึ่งกลางหน้าจอ และเว้นระยะห่างด้านล่างก่อนขึ้นข้อถัดไป */
    padding: 0 10px;
}

/* กรอบรูปภาพชิ้นเดี่ยวสไตล์เรียบหรู */
.gold-single-img-container .gold-gallery-item .img-frame {
    width: 100%;
    height: auto;
    min-height: 250px;
    max-height: 450px; /* ล็อคความสูงสูงสุดไม่ให้ยาวกินหน้าเพจ */
    border: 1px solid rgba(241, 196, 15, 0.4); /* เส้นขอบทองบางๆ สไตล์คลีน */
    border-radius: 8px;
    overflow: hidden;
    background-color: #121214;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.gold-single-img-container .gold-gallery-item .img-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* โชว์รายละเอียดรูปภาพได้ครบทั้งใบ ไม่โดนครอปหัวท้าย */
    display: block;
}

/* ปรับระยะห่างกล่องข้อความให้ลงตัว */
.tax-step-highlight-box {
    margin-bottom: 15px !important; /* บีบระยะห่างระหว่างข้อความกับรูปให้กระชับขึ้น */
}

/* ปรับแต่งส่วน Mobile Responsive */
@media (max-width: 768px) {
    .gold-single-img-container {
        margin-bottom: 25px;
    }
    .gold-single-img-container .gold-gallery-item .img-frame {
        min-height: 180px;
    }
}

@media screen and (max-width: 768px) {
    /* จัดการหน้าเนื้อหาบทความและคู่มือภาษีทั้งหมด */
    .tax-container, article, .content-wrapper {
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }
    
    /* ปรับขนาดตัวหนังสือหัวข้อเรื่องให้อ่านง่ายพอดีจอมือถือ */
    h1.tax-title, .gold-tax-header h1 {
        font-size: 22px !important;
        line-height: 1.4 !important;
    }
    
    /* หากในบทความมีตาราง (Table) ป้องกันตารางดันจนจอมือถือเบี้ยวล้น */
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important; /* ขึ้นสกรอลล์เฉพาะตัวตารางถ้ากว้างเกินไป */
        white-space: nowrap;
    }
}

/* ==========================================================================
   📖 MOBILE ARTICLES: จัดการหน้าคู่มือภาษีร้านทองทั้งหมด (tax1 - tax8)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* ปรับระยะขอบบทความไม่ให้ชิดขอบจอ */
    .tax-container, article, .content-wrapper, .gold-tax-container {
        width: 100% !important;
        padding: 20px 15px !important;
        box-sizing: border-box !important;
    }
    
    /* ย่อขนาดหัวข้อบทความให้อ่านง่ายพอดีจอ */
    h1.tax-title, .gold-tax-header h1 {
        font-size: 22px !important;
        line-height: 1.4 !important;
    }
    h2, h3 {
        font-size: 18px !important;
    }
    
    /* 🛠 ไม้ตายป้องกันตาราง (Table) ดันจอมือถือพังล้นขอบกว้างกะทันหัน */
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important; /* ให้เลื่อนซ้าย-ขวาเฉพาะที่ตัวตารางได้ */
        white-space: nowrap !important;
        margin-bottom: 20px !important;
    }
}