/* =========================================
   1. VARIABLES & GLOBAL SETTINGS
   ========================================= */
   :root {
    /* Color Palette */
    --primary: #5A7D58;    /* เขียวธรรมชาติ (Sage Green) */
    --primary-dark: #3F583D;
    --secondary: #D4A373;  /* สีไม้/ทอง */
    --dark: #2C3333;       /* สีเทาเข้มเกือบดำ */
    --light: #F7F9F7;      /* สีขาวอมเขียวจางๆ */
    
    /* Fonts */
    --font-main: 'Kanit', sans-serif;
    
    /* Spacing Variables */
    --section-spacing-mobile: 60px;
    --section-spacing-desktop: 100px;
}

body {
    font-family: var(--font-main);
    color: var(--dark);
    background-color: #fff;
    overflow-x: hidden; /* ป้องกันหน้าจอเลื่อนซ้ายขวาเกินความจำเป็น */
    line-height: 1.6;
}

/* =========================================
   2. UTILITIES & ANIMATIONS
   ========================================= */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-light-subtle { background-color: #f8f9fa !important; }

.object-fit-cover { object-fit: cover; }
.letter-spacing-2 { letter-spacing: 2px; }
.spacing-1 { letter-spacing: 1px; }

/* Section Padding Consistency */
.section-padding {
    padding-top: var(--section-spacing-mobile);
    padding-bottom: var(--section-spacing-mobile);
}
@media (min-width: 992px) {
    .section-padding {
        padding-top: var(--section-spacing-desktop);
        padding-bottom: var(--section-spacing-desktop);
    }
}

/* Loading Screen */
.loader-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}

/* Fade In Animation Helper */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0; transform: translateY(20px);
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Highlight Animation (Pulse) */
.highlight-contact {
    animation: pulse-green 2s infinite;
    border: 2px solid var(--primary);
    padding: 10px;
    border-radius: 10px;
    background-color: rgba(90, 125, 88, 0.1);
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(90, 125, 88, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(90, 125, 88, 0); }
    100% { box-shadow: 0 0 0 0 rgba(90, 125, 88, 0); }
}

/* Custom Scrollbar for Modal Desc */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* =========================================
   3. NAVBAR
   ========================================= */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    padding-top: 15px; padding-bottom: 15px;
}

.nav-link {
    color: var(--dark) !important;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
}

/* Mobile Nav Adjustments */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        margin-top: 10px;
    }
}

/* =========================================
   4. HERO BANNER
   ========================================= */
.carousel-item {
    position: relative;
    height: 65vh;       /* Mobile Height: ไม่สูงเกินไป */
    min-height: 400px;
}

/* Overlay gradient เพื่อให้อ่าน text ง่ายขึ้น */
.carousel-item::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
    z-index: 1;
}

.carousel-item img {
    height: 100%; width: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-caption {
    z-index: 2;
    bottom: 15%; /* ยกขึ้นมาจากขอบล่าง */
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    text-align: center;
}

@media (min-width: 992px) {
    .carousel-item {
        height: 100vh; /* Desktop Height: เต็มจออลังการ */
        min-height: 600px;
    }
    .hero-caption {
        top: 50%; transform: translateY(-50%); bottom: auto;
        text-align: left;
        padding-left: 3rem;
    }
}

/* =========================================
   5. ABOUT & BADGE (5 Years)
   ========================================= */
.experience-badge {
    position: absolute;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex; flex-direction: column; 
    justify-content: center; align-items: center;
    box-shadow: 0 8px 25px rgba(90, 125, 88, 0.4);
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Mobile Position */
    width: 90px; height: 90px;
    bottom: -20px; right: 20px;
}
.experience-badge:hover { transform: scale(1.1); }
.experience-badge .amount { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.experience-badge .label { font-size: 0.75rem; opacity: 0.9; }

@media (min-width: 992px) {
    .experience-badge {
        /* Desktop Position: Overlapping */
        width: 140px; height: 140px;
        bottom: -40px; left: -40px; right: auto;
        border: 5px solid #fff;
    }
    .experience-badge .amount { font-size: 3.5rem; }
    .experience-badge .label { font-size: 1rem; }
}

/* =========================================
   6. ROOMS (Mobile Scroll Snap)
   ========================================= */
.mobile-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 20px;
    margin-right: -12px; /* Visual compensation */
}
.mobile-scroll-container::-webkit-scrollbar { display: none; }

.mobile-scroll-item {
    flex: 0 0 85%; /* Mobile: กว้าง 85% เพื่อให้เห็นการ์ดถัดไปนิดๆ */
    scroll-snap-align: center;
}

@media (min-width: 768px) {
    .mobile-scroll-container {
        display: flex; flex-wrap: wrap; overflow-x: visible; margin-right: 0;
    }
    .mobile-scroll-item {
        flex: 0 0 auto; width: 33.3333%; /* Desktop: Grid ปกติ */
    }
}

/* Room Card Styling */
.room-card {
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.room-img-wrapper {
    height: 220px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    position: relative;
}
.room-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.room-card:hover .room-img-wrapper img { transform: scale(1.05); }

/* =========================================
   7. REVIEW TRIPS (Guest Diaries)
   ========================================= */
.trip-card {
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.trip-img-wrapper {
    height: 200px;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}
.trip-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.trip-card:hover .trip-img-wrapper img { transform: scale(1.1); }

/* Overlay Effect */
.trip-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex; justify-content: center; align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.trip-card:hover .trip-overlay { opacity: 1; }

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   8. RESPONSIVE TEXT SIZES
   ========================================= */
@media (max-width: 768px) {
    .display-1 { font-size: 2.5rem; }
    .display-6 { font-size: 1.8rem; }
    .lead { font-size: 1rem; }
}


/* --- Gallery Grid Styles --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* แบ่งเป็น 3 คอลัมน์ */
    gap: 8px;
    margin-top: 15px;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1/1; /* บังคับสัดส่วนสี่เหลี่ยมจัตุรัส */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.gallery-thumb:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* --- Image Viewer Modal Styles --- */
#imageViewerModal {
    background: rgba(0, 0, 0, 0.95) !important; /* พื้นหลังดำทึบกว่า */
    z-index: 3000; /* อยู่บนสุด */
}

.modal-content-img {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0.8); opacity:0;}
    to {transform:scale(1); opacity:1;}
}

/* =========================================
   9. NEW FEATURES: SCROLL & REVIEWS
   ========================================= */

/* --- A. Horizontal Scroll (ใช้สำหรับ Moments at Hindad) --- */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap; /* ห้ามขึ้นบรรทัดใหม่ */
    overflow-x: auto;  /* ให้เลื่อนแนวนอน */
    -webkit-overflow-scrolling: touch; /* เลื่อนลื่นๆ ใน iOS */
    scroll-snap-type: x mandatory; /* ให้หยุดทีละแผ่น */
    gap: 1.5rem;
    padding: 10px 5px 30px 5px; /* เผื่อที่ให้เงาด้านล่าง */
}

/* ซ่อน Scrollbar ให้สวยงาม */
.scrolling-wrapper::-webkit-scrollbar { height: 8px; }
.scrolling-wrapper::-webkit-scrollbar-track { background: transparent; }
.scrolling-wrapper::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.scrolling-wrapper::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.scrolling-card-item {
    flex: 0 0 85%; /* มือถือ: กว้าง 85% */
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .scrolling-card-item {
        flex: 0 0 350px; /* คอมพิวเตอร์: กว้างล็อกตายตัว 350px */
    }
}

/* --- B. Testimonial Card Design (Words from Guests) --- */
.testimonial-card {
    background: rgba(255, 255, 255, 0.1); /* สีขาวโปร่งใส */
    backdrop-filter: blur(10px); /* เบลอพื้นหลัง */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto; /* จัดกึ่งกลาง */
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.quote-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

/* ปรับปุ่มลูกศร Carousel ให้อยู่ห่างออกมาหน่อย */
.carousel-control-prev, .carousel-control-next {
    width: 5%;
}
@media (min-width: 992px) {
    .carousel-control-prev { left: -5%; }
    .carousel-control-next { right: -5%; }
}