/* กำหนดสไตล์ให้กับทั้งเว็บไซต์ */
body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* ส่วนหัว (Header) */
header {
    background: #2c6e49;
    color: white;
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 2.5em;
    margin: 0;
}

/* เมนูนำทาง (Navigation) */
nav {
    background-color: #333;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 10;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    background-color: #333;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-size: 1.1em;
    padding: 15px 0;
    display: block;
    text-align: center;
}

nav ul li a:hover {
    background-color: #45a049;
}

/* ส่วนเนื้อหาหลัก (Content) */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.content {
    margin: 40px 0;
}

h2 {
    font-size: 2em;
    color: #2c6e49;
    margin-bottom: 20px;
    text-align: center;
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ปรับขนาดรูปภาพให้ลดลง 40% */
img {
    width: 60%; /* ลดขนาดภาพลง 40% */
    height: auto; /* คงอัตราส่วนความสูงตามความกว้าง */
    border-radius: 8px;
    margin-bottom: 20px;
}

ul {
    list-style-type: none;
    padding-left: 0;
}

ul li {
    font-size: 1.2em;
    margin: 10px 0;
}

/* ฟอร์มติดต่อ */
form {
    display: grid;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

form input, form textarea {
    padding: 10px;
    font-size: 1em;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

form button {
    padding: 10px 20px;
    background-color: #2c6e49;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

form button:hover {
    background-color: #45a049;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
}

footer p {
    margin: 0;
}

/* ปุ่มกลับไปด้านบน */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #45a049;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    display: none;
}

#backToTop:hover {
    background-color: #2c6e49;
}
