/* เดิม: 'style.css' */

/* การตั้งค่าพื้นฐาน */
:root {
    --primary-color: #007bff; /* สีหลักที่ใช้ในเว็บ */
    --secondary-color: #6c757d; /* สีรอง */
    --dark-color: #212529; /* สีข้อความเข้ม */
    --light-color: #f8f9fa; /* สีพื้นหลังอ่อน */
    --white-color: #ffffff;
    --gray-color: #666;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white-color);
    color: var(--dark-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container { /* เพื่อควบคุมความกว้างของเนื้อหา */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4%;
}

/* ส่วนเมนู (Navigation) */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 4%; /* ใช้ padding ตาม container */
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.98); /* เกือบโปร่งใส */
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.logo img {
    height: 67.5px; /* ปรับขนาดโลโก้ */
    vertical-align: middle;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 45px; /* เพิ่มระยะห่างเมนู */
}

nav ul li a {
    text-decoration: none;
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-speed);
    position: relative;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -8px;
    left: 0;
    transition: width var(--transition-speed) ease-in-out;
}

nav ul li a:hover::after {
    width: 100%;
}

/* ส่วนหัวข้อหลัก (Hero Section) - สำหรับ index.html */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('images/tissot1.jpg') no-repeat center center/cover;
    position: relative;
    color: var(--white-color);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65); /* Darker overlay for better text contrast */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: 20px;
}

.hero-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 1.1;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-section h1 span {
    color: var(--primary-color);
}

.hero-section h2 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 25px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

.hero-section p {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 40px auto;
}

/* Page Header - สำหรับหน้าอื่นๆ (เช่น services.html) */
.page-header {
    background-color: var(--dark-color); /* หรือใช้รูปภาพ/gradient */
    color: var(--white-color);
    padding: 150px 0 80px 0; /* เพิ่ม padding ด้านบนเพื่อหลบ nav */
    text-align: center;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 20px;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.8);
}

/* ปุ่ม */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark-color);
    border: 2px solid var(--dark-color);
}

.btn-secondary:hover {
    background-color: var(--dark-color);
    color: var(--white-color);
}

/* สไตล์ส่วนทั่วไปของ Section */
.portfolio-section, .about-section, .contact-section, .gallery-section, .service-list-section, .cta-section {
    padding: 100px 0;
    text-align: center;
}

.portfolio-section {
    background-color: var(--light-color);
}
.about-section {
    background-color: var(--white-color);
}
.contact-section {
    background-color: var(--light-color);
}
.gallery-section {
    background-color: #f1f4f8;
}
.service-list-section { /* สีพื้นหลังสำหรับส่วน Services */
    background-color: var(--white-color);
}
.cta-section { /* ส่วน Call to Action */
    background-color: var(--dark-color);
    color: var(--white-color);
}
.cta-section h2 {
    color: var(--white-color);
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    color: var(--dark-color);
}

.section-description {
    font-size: 1.15rem;
    color: var(--gray-color);
    max-width: 800px;
    margin: 0 auto 60px auto;
    line-height: 1.7;
}

/* ส่วนแสดงผลงาน (Portfolio Grid) */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.project-item {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: var(--border-radius);
    overflow: visible;
    background-color: var(--white-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.project-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.15);
}

.project-img {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: visible;
    background-color: #f0f0f0;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.project-item:hover img {
    transform: scale(1.08);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.4s;
}

.overlay span {
    color: var(--white-color);
    border: 2px solid var(--white-color);
    padding: 12px 28px;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 2px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    backdrop-filter: blur(3px);
}

.project-item:hover .overlay {
    opacity: 1;
}

.project-info {
    padding: 25px;
    background-color: var(--white-color);
    text-align: left;
}

.project-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.project-info p {
    color: var(--gray-color);
    font-size: 1.05rem;
}

/* ส่วน Gallery Section (ใหม่) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.image-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease;
    cursor: pointer;
}

.image-grid img:hover {
    transform: scale(1.05);
}

/* ส่วน Service List (ใหม่) */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.service-item {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.service-item img {
    width: 80px; /* ขนาดไอคอนบริการ */
    height: 80px;
    margin-bottom: 20px;
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    object-fit: cover;
}

.service-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.service-item p {
    font-size: 1rem;
    color: var(--gray-color);
    line-height: 1.6;
}

/* ส่วน About Section */
.about-section .about-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.8;
}

.about-section .about-content p {
    margin-bottom: 25px;
    color: var(--gray-color);
}

/* ส่วน Contact Section */
.contact-section .contact-info {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.8;
}

.contact-section .contact-info p {
    margin-bottom: 15px;
    color: var(--gray-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 40px 0;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 15px 4%;
    }

    nav ul {
        display: none;
    }

    .logo img {
        height: 60px;
    }

    .hero-section h1 {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
    .hero-section h2 {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .hero-section p {
        font-size: 1rem;
    }

    .page-header {
        padding: 120px 0 60px 0;
    }
    .page-header h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    .page-header p {
        font-size: 1rem;
    }

    .btn-primary, .btn-secondary {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .portfolio-section, .about-section, .contact-section, .gallery-section, .service-list-section, .cta-section {
        padding: 70px 0;
    }

    h2 {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
        margin-bottom: 15px;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 40px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .project-img {
        height: 280px;
    }

    .project-info {
        padding: 20px;
    }

    .project-info h3 {
        font-size: 1.2rem;
    }

    .project-info p {
        font-size: 0.95rem;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        margin-top: 30px;
    }

    .image-grid img {
        height: 100px;
    }

    .service-grid {
        grid-template-columns: 1fr; /* แถวละ 1 สำหรับมือถือ */
        gap: 30px;
    }
    .service-item {
        padding: 25px;
    }
    .service-item img {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    .service-item h3 {
        font-size: 1.3rem;
    }
    .service-item p {
        font-size: 0.9rem;
    }

    .about-section .about-content,
    .contact-section .contact-info {
        font-size: 1rem;
    }
}
/* Lightbox Styles */
.lightbox {
    display: none; /* ซ่อนไว้ก่อน */
    position: fixed; /* ให้อยู่เหนือทุกอย่าง */
    z-index: 1000; /* ค่า z-index สูงๆ */
    padding-top: 50px; /* เว้นระยะจากด้านบน */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* เปิดใช้งาน scroll หากรูปภาพใหญ่เกินไป */
    background-color: rgba(0,0,0,0.9); /* พื้นหลังสีดำโปร่งแสง */
    align-items: center; /* จัดให้อยู่กึ่งกลางในแนวตั้ง */
    justify-content: center; /* จัดให้อยู่กึ่งกลางในแนวนอน */
    box-sizing: border-box; /* สำคัญสำหรับการคำนวณ padding/border */
}

.lightbox.active { /* คลาสนี้จะถูกเพิ่มเมื่อ lightbox เปิดใช้งาน */
    display: flex; /* ใช้ flexbox ในการจัดกึ่งกลาง */
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%; /* จำกัดความกว้างสูงสุด */
    max-height: 90%; /* จำกัดความสูงสูงสุด */
    object-fit: contain; /* ปรับขนาดรูปภาพให้พอดีโดยไม่ตัดส่วน */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* เพิ่ม responsive adjustments ถ้าต้องการ */
@media only screen and (max-width: 700px){
   .lightbox-content {
        width: 100%;
    }
}