/* นำเข้าฟอนต์ Kanit */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;500;700&display=swap');

body { 
    font-family: 'Kanit', sans-serif; 
    background-color: #1a1a1a; 
    color: white; 
}

/* ทำให้ภาพพิกเซลสกิน Minecraft ไม่แตก/เบลอ */
.image-pixelated {
    image-rendering: pixelated;      /* สำหรับ Chrome/Edge */
    image-rendering: crisp-edges;    /* สำหรับ Firefox */
}

/* =========================================
   ระบบ Background Slideshow (4 รูปภาพ)
========================================= */
.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* เลเยอร์สีดำจางๆ บังรูปภาพไว้ให้ตัวหนังสือเด่นขึ้น */
.slideshow-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* ระยะเวลา 1 รอบ = 20 วินาที (รูปละ 5 วิ) */
    animation: fadeAnimation 20s infinite; 
}

/* กำหนด Delay ของการโชว์รูปแต่ละรูป */
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide:nth-child(3) { animation-delay: 10s; }
.slide:nth-child(4) { animation-delay: 15s; }

/* อนิเมชันการเฟดจาง (Fade in -> Show -> Fade out) */
@keyframes fadeAnimation {
    0%   { opacity: 0; }
    10%  { opacity: 1; }
    25%  { opacity: 1; } /* โชว์เต็มที่ */
    35%  { opacity: 0; } /* เริ่มเฟดออกให้รูปถัดไปมาแทน */
    100% { opacity: 0; }
}