/* css/index.css */

/* Hero Section */
.hero-section {
    /* คุณต้องมีไฟล์รูปภาพ 'hero-bg-light.jpg' ในโฟลเดอร์ images/ */
    background: url('../img/index/main.jpg') no-repeat center center/cover;
    /* หรือใช้สีพื้นหลังสว่างแทน ถ้าไม่มีรูปภาพโทนสว่าง: */
    /* background-color: #ecf0f1; */ /* สีเทาอ่อน-ฟ้าอ่อน */

    color: var(--secondary-color); /* เปลี่ยนสีข้อความเป็นสีเข้ม เพื่อให้ตัดกับพื้นหลังสว่าง */
    text-align: center;
    padding: 150px 20px;
    height: 100vh; /* เต็มหน้าจอ */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* ป้องกันเนื้อหาล้นเมื่อมี animations */
}

.hero-section::before { /* Overlay เพื่อให้อ่านข้อความง่ายขึ้น */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4); /* สีขาวโปร่งใส 40% */
    z-index: 0;
}

.hero-content {
    position: relative; /* เพื่อให้อยู่ด้านบน overlay */
    z-index: 1;
    opacity: 0; /* เริ่มต้นที่ซ่อนอยู่ */
    transform: translateY(20px);
    animation: fadeInSlideUp 1s forwards ease-out 0.5s; /* หน่วงเวลา 0.5s */
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 3.8rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* ปรับเงาข้อความให้เบาลง */
}

.hero-content p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.08); /* ปรับเงาข้อความให้เบาลง */
}

/* Buttons in Hero Section */
/* เพื่อให้ปุ่มยังคงตัดกับพื้นหลังสว่าง เราอาจใช้ปุ่มสีเข้มหรือปุ่มที่มี border */
.hero-section .btn-primary {
    background-color: var(--primary-color); /* หรือใช้ var(--secondary-color) เพื่อให้เข้มขึ้น */
    color: var(--white);
    border: 2px solid var(--primary-color); /* เพิ่ม border เพื่อความคมชัด */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.hero-section .btn-primary:hover {
    background-color: var(--secondary-color); /* หรือสีเข้มขึ้นเมื่อ hover */
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}


/* Intro Section */
.intro-section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--white);
}

.intro-section h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.intro-section p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

/* Featured Projects & Latest Blog Posts Sections */
.featured-projects,
.latest-blog-posts {
    padding: 80px 0;
    text-align: center;
}

.featured-projects {
    background-color: var(--light-gray);
}

.featured-projects h2,
.latest-blog-posts h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.project-grid,
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Card Styles */
.project-card,
.blog-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover,
.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.project-card img,
.blog-card img {
    width: 100%;
    height: 220px; /* กำหนดความสูงคงที่สำหรับรูปภาพปก */
    object-fit: cover; /* ครอปรูปให้เต็มพื้นที่ */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.project-card h3,
.blog-card h3 {
    font-size: 1.6rem;
    margin: 20px 20px 10px 20px;
    color: var(--secondary-color);
}

.project-card p,
.blog-card p {
    font-size: 1rem;
    padding: 0 20px;
    margin-bottom: 15px;
    flex-grow: 1; /* ทำให้ข้อความยืดเต็มพื้นที่ */
}

.blog-card .post-meta {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 5px;
    padding: 0 20px;
}

.project-card .btn,
.blog-card .btn {
    margin: 0 20px 20px 20px;
    align-self: flex-start; /* จัดปุ่มให้อยู่ซ้าย */
}


.view-all-btn {
    margin-top: 50px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .project-grid, .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .project-card img, .blog-card img {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 20px; /* ลด padding ลงสำหรับมือถือ */
        height: 70vh; /* ลดความสูงสำหรับมือถือ */
    }
    .hero-content h1 {
        font-size: 2.2rem; /* ปรับขนาดฟอนต์ให้เล็กลง */
    }
    .hero-content p {
        font-size: 0.95rem; /* ปรับขนาดฟอนต์ให้เล็กลง */
    }
    .intro-section h2,
    .featured-projects h2,
    .latest-blog-posts h2 {
        font-size: 2rem;
    }
    .project-grid, .blog-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 70vh;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .intro-section h2,
    .featured-projects h2,
    .latest-blog-posts h2 {
        font-size: 1.8rem;
    }
}