/*
สวัสดีครับ แกะโค๊ดมาถึงตรงนี้ได้แสดงว่าพอสนใจเว็บผมอยู่ไม่มากก็น้อย
ผม เจ้าหน้าที่ระบบงานคอมพิวเตอร์ สำนักงานเขตคลองเตยครับ
อยากเอาไปใช้ แกะเอาโค๊ดไปใช้ได้เลยครับ ไม่ได้ obfuscate code ไว้
code ไม่ได้ยากครับ css ง่ายๆ ใครๆก็ทำได้ 
แต่ไอเดีย วิธีทำ วิธีคิด ต่างหาก ที่ต้องพัฒนาอยู่ตลอด ลองเอาไปต่อยอดดูนะครับ
*/

/* =========================================
   หลัก จิปาถะ
   ========================================= */
/* ลบกล่องแบนเนอร์และฟิล์มดำในสส่วนของแบนเนอร์ */
.item-Onbanner-outer, .item-Onbanner-inner, .bg-layer { 
    display: none !important; 
}
/* ลบ ::before ใน Footer */
#footer-wrapper .bg-color-primary::before {
    pointer-events: none !important;
}
/* ลบไอคอน W3C */
.group-w3c {
    display: none !important;
}
/* เพิ่มลล */
.social-wrapper ul li a:hover {
    transform: translateX(5px);
}

/* ซ่อนกล่องเบอร์โทรศัพท์กลาง และ โทรสาร ด้านล่าง*/
.group-footer.right > .row:first-child {
    display: none !important;
}

/* แก้เบอร์โทรตกบรรทัด*/
.copyright figure.table table th,
.copyright figure.table table td,
.copyright figure.table table span,
.copyright figure.table table p {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

/* ปลดล็อกความกว้าง ให้ตารางยืดหยุ่นขึ้นบนมือถือ */
.copyright figure.table table th,
.copyright figure.table table td {
    width: auto !important;
    padding: 5px 10px !important;
}
/* ซ่อนกล่องแชร์หน้ารอง */
.group-social-share {
    display: none !important;
}

/* =========================================
   ส่วนของ FB
============================== */
/* เลย์เอาต์ Grid สำหรับจัดเรียงการ์ด */
.fb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* จัดเรียงอัตโนมัติ */
    gap: 20px;
    padding: 10px 0;
}
/* สไตล์ของการ์ดแต่ละใบ */
.fb-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}
/* เอฟเฟกต์เวลาเอาเมาส์ชี้ */
.fb-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}
/* รูปภาพปกของการ์ด */
.fb-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
/* พื้นที่ใส่ข้อความ */
.fb-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
/* วันที่โพสต์ */
.fb-date {
    font-size: 0.8rem;
    color: #65676B;
    margin-bottom: 8px;
    font-weight: 600;
}
/* ข้อความโพสต์ (ตัดบรรทัดที่ 3 อัตโนมัติถ้ายาวไป) */
.fb-text {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Responsive: ซ่อนการ์ดใบที่ 7-12 เมื่อดูผ่านมือถือ */
@media (max-width: 768px) {
    .fb-card:nth-child(n+7) {
        display: none !important;
    }
}
/* --- อัปเดตการ์ดให้รู้ว่าคลิกได้ --- */
.fb-card {
    cursor: pointer; /* เปลี่ยนเมาส์เป็นรูปมือ */
}

/* =========================================
   logic สไตล์สำหรับ Popup FB
============================== */
.fb-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* ให้อยู่บนสุดของเว็บ */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px); /* เบลอฉากหลัง */
}

.fb-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fb-modal-box {
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.fb-modal-overlay.active .fb-modal-box {
    transform: translateY(0) scale(1);
}

/* ปุ่มกากบาท ปิด Popup */
.fb-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: 0.2s;
}

.fb-modal-close:hover {
    background: #e74c3c; /* สีแดงตอนเอาเมาส์ชี้ */
    transform: rotate(90deg);
}

.fb-modal-img {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
    background: #f0f2f5;
}

.fb-modal-body {
    padding: 25px;
}

.fb-modal-text {
    font-size: 1.05rem;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap; /* ช่วยรักษาย่อหน้าและบรรทัดใหม่จากFB */
    margin-bottom: 20px;
}

.fb-modal-footer {
    padding: 0 25px 25px 25px;
    text-align: center;
}

.fb-btn {
    display: inline-block;
    background: #1877f2;
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);
}

.fb-btn:hover {
    background: #166fe5;
    transform: translateY(-2px);
}

/* ========================================================= */
/* ส่วนการปรับแต่งหน้าตา การ์ดข้อมูลสาธารณะ (Open Data / OIT) */
/* ========================================================= */
.oit-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, 1fr); /* บังคับมือถือ 2 คอลัมน์ */
    margin-top: 15px;
}

.oit-card-img {
    width: 100%;
    height: 110px; 
    object-fit: contain; /* ให้โลโก้โชว์เต็มใบ ไม่โดนตัด */
    background-color: #f8f9fa; /* พื้นเทาอ่อนช่วยให้โลโก้ดูเด่น */
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.oit-card-title {
    color: #333;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center; /* จัดตัวหนังสือให้อยู่กึ่งกลาง */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* ตัดข้อความที่ยาวเกิน 3 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* สำหรับจอคอมพิวเตอร์ (จอใหญ่กว่า 768px) */
@media (min-width: 768px) {
    .oit-grid {
        grid-template-columns: repeat(4, 1fr); /* คอมพิวเตอร์ 4 คอลัมน์ */
    }
    .oit-card-img {
        height: 150px; 
    }
    .oit-card-title {
        font-size: 1rem;
    }
}
