/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('/IMG_20250414_174901.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    animation: slideBackground 20s infinite;
}

/* --- Header & Navbar --- */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 5%;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #ff4d4d; /* เปลี่ยนเป็นสีแดงตามธีมใหม่ */
}

/* --- Main Content Layout --- */
.content-wrapper {
    flex: 1; 
    padding-top: 100px;
    padding-bottom: 50px;
    background: rgba(253, 253, 253, 0.9);
}

.hero-article {
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- BUTTON STYLES (สีแดงเท่านั้น) --- */
.cta-button, .btn-main, .btn-contact {
    display: inline-block;
    background-color: #ff4d4d !important; /* สีแดงสด */
    color: white !important;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
    text-align: center;
}

.cta-button:hover, .btn-main:hover, .btn-contact:hover {
    background-color: #cc0000 !important; /* สีแดงเข้มเมื่อชี้ */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

/* --- CONTACT INFO (ชิดซ้าย + ไฮไลท์เฉพาะข้อความ) --- */
.contact-section {
    padding: 40px 5%;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    padding: 30px;
    border-radius: 12px;
    background: #f8f9fa;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: flex-start; /* บังคับชิดซ้าย */
}

.info-item i {
    color: #ff4d4d;
    font-size: 1.2rem;
    min-width: 25px;
    text-align: center;
}

.info-item div {
    display: flex;
    flex-direction: row; /* เรียงแนวนอน */
    align-items: center;
    gap: 12px;
    width: auto;
}

.info-item p {
    margin: 0;
}

/* ไฮไลท์สีแดงเฉพาะหลังตัวหนังสือหัวข้อ */
.info-item .label {
    background-color: #ff4d4d;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block; /* ทำให้พื้นหลังกว้างเท่าตัวอักษร */
    width: fit-content;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.info-item .value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.info-item .value a {
    color: inherit;
    text-decoration: none;
}

/* --- FORM STYLES --- */
.contact-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

textarea {
    width: 100%;
    min-height: 125px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* --- GALLERY GRID (4 คอลัมน์) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px;
    max-width: 1400px;
    margin: 20px auto;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    height: 200px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}

.gallery-item img:hover {
    transform: scale(1.08);
}

/* สไตล์สำหรับหน้าจอแสดงรูปใหญ่ */
.modal-overlay {
    display: none; /* ซ่อนไว้เริ่มต้น */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(62, 41, 41, 0.911);
    z-index: 99999; /* ให้อยู่เหนือ header และทุกอย่าง */
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}

.modal-overlay img {
    max-width: 100%;
    max-height: 100%;
    width: 100vw;
    height: 100vh;
    object-fit: contain; /* ขยายรูปให้ใหญ่ที่สุดโดยคงสัดส่วนเดิม */
    image-rendering: -webkit-optimize-contrast; /* ช่วยให้รูปคมชัดขึ้น */
}

/* ปิดการเลื่อนหน้าเว็บเมื่อเปิดรูป (จัดการผ่าน JS) */
body.no-scroll {
    overflow: hidden;
}

/* --- Footer --- */
footer {
    width: 100%;
    background: white;
    padding: 25px;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* --- Responsive --- */
@media (max-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { 
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-container { grid-template-columns: 1fr; }
    .info-item div { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 480px) { .gallery-grid { grid-template-columns: 1fr; } }

@keyframes slideBackground {
    0%, 100% { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('/IMG_20250414_174901.jpg'); }
    50% { background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('/1768317831270.jpg'); }
}
