/* --- style.css (Updated: Equal Height Version) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Prompt:wght@300;400;500;600&display=swap');

:root {
    --bg-body: #ffffff;
    --bg-section: #f5f5f7; /* สีเทาอ่อนแบบ Apple */
    --text-main: #1d1d1f;  /* สีดำเกือบสนิท */
    --text-muted: #86868b; /* สีเทาตัวหนังสือ */
    --brand-orange: #f56300; /* ส้มแบรนด์ */
    --glass-nav: rgba(255, 255, 255, 0.85); /* กระจกขาวฝ้า */
    --shadow-soft: 0 15px 40px rgba(0, 0, 0, 0.08); /* เงานุ่ม */
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', 'Prompt', sans-serif;
    margin: 0; padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Navbar --- */
.navbar-custom {
    background: var(--glass-nav);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 0;
    position: fixed; top: 0; width: 100%; z-index: 1000;
}
.brand-logo { 
    width: 40px; height: 40px; border-radius: 50%; 
    object-fit: cover; margin-right: 10px; 
}
.brand-text { color: var(--text-main); font-weight: 600; font-size: 1.1rem; }
.nav-link { 
    color: var(--text-main) !important; 
    font-size: 0.95rem; font-weight: 500; margin: 0 12px; opacity: 0.8; transition: 0.3s; 
}
.nav-link:hover { opacity: 1; color: var(--brand-orange) !important; }
.btn-nav {
    background: var(--text-main); color: white; border-radius: 20px;
    padding: 6px 20px; font-size: 0.9rem; transition: 0.3s; border: none;
}
.btn-nav:hover { background: var(--brand-orange); color: white; transform: translateY(-1px); }

/* --- Hero Section --- */
.hero-section {
    position: relative; height: 90vh; 
    width: 100%; overflow: hidden; background: #000;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.99), transparent); z-index: 2;
}
.hero-content {
    position: absolute; bottom: 80px; left: 0; width: 100%;
    z-index: 3; text-align: center; color: white; padding: 0 20px;
}
.hero-title {
    font-size: 4rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -1px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero-subtitle {
    font-size: 1.5rem; font-weight: 400; margin-bottom: 30px; opacity: 0.9;
}
.carousel-item { height: 90vh; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }

/* --- Global Section --- */
.section-padding { padding: 100px 0; }
.section-bg-gray { background-color: var(--bg-section); }
.text-orange { color: var(--brand-orange); }

/* =========================================
   PROJECT SECTION (จุดที่แก้ไขเรื่องความสูง)
   ========================================= */

/* คอนเทนเนอร์รูปภาพ (ฝั่งซ้าย) */
.project-img-container {
    height: 100%; /* บังคับให้สูงเต็มพื้นที่คอลัมน์ */
    min-height: 500px; /* กำหนดความสูงขั้นต่ำเพื่อความสวยงาม */
    border-radius: 12px;
    overflow: hidden; /* ตัดส่วนเกินของภาพ */
    box-shadow: var(--shadow-soft);
    position: relative;
}

/* ตัวรูปภาพ */
.project-img {
    width: 100%;
    height: 100%; /* ยืดความสูงให้เท่ากล่อง */
    
    /* เลือกโหมดรูปภาพ (เลือกบรรทัดใดบรรทัดหนึ่ง) */
    object-fit: cover;  /* แนะนำ: เต็มพื้นที่สวยงาม (แต่อาจตัดขอบบนล่างนิดหน่อย) */
    /* object-fit: contain; */ /* ทางเลือก: เห็นครบทั้งใบ (อาจมีพื้นที่ว่าง) */
    /* object-fit: fill; */ /* ทางเลือก: ยืดภาพให้เต็ม (ภาพอาจเบี้ยว) */
    
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: block;
}

.project-img-container:hover .project-img {
    transform: scale(1.01); /* ซูมภาพนิดหน่อยเมื่อชี้ */
}

/* การ์ดกระจก (ฝั่งขวา) */
.project-glass-card {
    height: 100%; /* ยืดความสูงให้เต็มพื้นที่เท่ากับรูป */
    background: rgba(255, 255, 255, 0.65); /* ขาวโปร่งแสง */
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 40px;
    
    display: flex;
    flex-direction: column;
    justify-content: center; /* จัดเนื้อหาให้อยู่กึ่งกลางแนวตั้ง */
    
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

/* --- Buttons --- */
.btn-apple {
    background: var(--brand-orange); 
    color: white; 
    border: none;
    padding: 12px 30px; 
    border-radius: 8px; /* ปรับความมนของปุ่มตรงนี้ (8px, 12px, 50px) */
    font-size: 1rem; 
    font-weight: 500;
    transition: 0.3s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
}
.btn-apple:hover { 
    background: #e05a00; 
    transform: translateY(-2px); 
    color: white; 
    box-shadow: 0 5px 15px rgba(245, 99, 0, 0.3);
}

/* --- Footer --- */
.footer { 
    background: #f5f5f7; 
    padding: 80px 0 40px 0; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    border-top: 1px solid #e5e5e5; 
}
.footer h5 { color: var(--text-main); font-weight: 600; margin-bottom: 20px; }
.footer a { color: var(--text-muted); text-decoration: none; transition: 0.2s; display: block; margin-bottom: 10px; }
.footer a:hover { color: var(--brand-orange); padding-left: 5px; }

/* --- Mobile Responsiveness --- */
/* --- Mobile Responsiveness (แก้ความสูงสไลด์) --- */
/* --- Mobile Responsiveness (ฉบับสมบูรณ์ & ไล่สีสมูท) --- */
@media (max-width: 991px) {
    
    /* 1. Navbar: ปรับให้กะทัดรัด */
    .navbar-custom { padding: 10px 0; }
    .brand-logo { width: 35px; height: 35px; }
    .brand-text { font-size: 0.95rem; }
    
    /* 2. Hero Section: ปรับความสูงและพื้นหลัง */
    .hero-section {
        height: 60vh; /* ความสูง 60% ของจอ (กำลังดี ไม่สูงเกิน) */
        min-height: 400px; /* กันจอเตี้ยเกินไป */
    }
    
    .hero-overlay {
        /* ไล่สีใหม่! ให้สมูทขึ้น ไม่ตัดเป็นก้อนดำเข้ม */
        background: linear-gradient(
            to top, 
            rgba(0, 0, 0, 0.9) 0%,    /* ล่างสุดดำเข้ม 90% */
            rgba(0, 0, 0, 0.5) 40%,   /* ตรงกลางจางลงเหลือ 50% */
            rgba(0, 0, 0, 0.1) 70%,   /* จางลงอีก */
            transparent 100%          /* บนสุดใสแจ๋ว */
        );
    }

    .hero-content {
        bottom: 0;
        padding: 0 20px 40px 20px; /* เว้นระยะขอบล่างให้หายใจสะดวก */
        width: 100%;
    }

    .hero-title { 
        font-size: 1.8rem; /* ลดขนาดตัวหนังสือหัวข้อ */
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
        opacity: 0.9;
    }

    /* 3. ปุ่มใน Hero */
    .btn-apple {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    /* 4. Project Section: แก้รูปเบี้ยว */
    .section-padding { padding: 50px 0; }

    .project-img-container {
        height: auto !important;     /* ปลดล็อกความสูง */
        min-height: auto !important; /* ปลดล็อกความสูงขั้นต่ำ */
        margin-bottom: 25px;         /* เว้นห่างจากกล่องข้อความ */
        box-shadow: none;            /* เอากรอบเงาออก */
        background: transparent;
        text-align: center;
    }
    
    .project-img {
        width: 100%;
        max-width: 100%;
        height: auto !important;     /* ให้รูปสูงตามสัดส่วนจริง */
        object-fit: contain;         /* โชว์รูปครบทั้งใบ ไม่โดนตัด */
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* เงารูปเบาๆ */
    }

    /* 5. Glass Card: กล่องข้อความ */
    .project-glass-card {
        padding: 25px;
        height: auto; /* สูงตามเนื้อหา */
    }
    
    .display-6 { font-size: 1.6rem; } /* หัวข้อโปรเจกต์เล็กลง */
    .fs-6 { font-size: 0.95rem; }     /* เนื้อหาเล็กลง */

    /* 6. Footer: จัดกลาง */
    .footer { text-align: center; }
    .footer .col-lg-2 { margin-top: 30px; }
    .footer .d-flex { justify-content: center; }

} /* <--- วงเล็บปิดสุดท้าย ห้ามลืมเด็ดขาด! */