/* --- Global Styles & Refined Variables --- */
:root {
    --primary-font: 'Noto Sans Thai', sans-serif;
    --heading-font: 'Pridi', serif;
    --primary-color: #3d5a49; /* Muted Sage Green */
    --secondary-color: #fdfdfc; /* Clean, soft off-white */
    --accent-color: #d4b281; /* Warm Tan/Gold */
    --text-color: #3e3e3e; /* Darker, softer grey */
    --light-text-color: #ffffff;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,0.07);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--primary-font);
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- Header & Hero Section --- */
.hero-section {
    height: 70vh;
    background-image: url('images/new_hero_bg.webp.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--light-text-color);
    padding: 0 20px;
}

.hero-text h1 {
    font-family: var(--heading-font);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.4);
}

.hero-text .subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 300;
    opacity: 0.95;
}

/* --- Gallery Section --- */
.gallery-section {
    padding: 80px 0;
    text-align: center;
}

.gallery-section h2 {
    font-family: var(--heading-font);
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin-bottom: 50px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Filter Buttons */
#filter-buttons {
    margin-bottom: 60px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.filter-btn {
    padding: 12px 30px;
    border: 1px solid #e0e0e0;
    background-color: transparent;
    color: #555;
    font-family: var(--primary-font);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    background-color: #f5f5f5;
    border-color: var(--accent-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(93, 122, 104, 0.3);
}

/* --- Image Gallery & Animation --- */
#image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Adjusted minmax for better sizing */
    gap: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Set a fixed height for items to ensure consistent sizing */
    height: 250px; /* Adjust this height as needed */
    cursor: pointer; /* Indicate that items are clickable */
}

.gallery-item.hidden {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes images fill the item without stretching */
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: var(--light-text-color);
    padding: 25px 30px;
    text-align: left;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .overlay {
    transform: translateY(0);
    opacity: 1;
}

.overlay h3 {
    margin: 0 0 5px 0;
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: 600;
}

.overlay .description {
    margin: 0 0 10px 0;
    font-family: var(--primary-font);
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
}

.overlay .amenities {
    margin: 0;
    font-family: var(--primary-font);
    font-size: 0.8rem;
    font-weight: 300;
    opacity: 0.8;
    line-height: 1.5;
}

/* --- Footer --- */
footer {
    background-color: #f1f0eb;
    color: #666;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

/* --- Lightbox Modal Styles --- */
.lightbox-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 60px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    animation: fadeIn 0.3s forwards; /* Add fade-in animation */
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 900px;
    max-height: 80vh; /* Limit height to 80% of viewport height */
    object-fit: contain; /* Ensure image fits within modal without cropping */
    animation: zoomIn 0.4s forwards; /* Add zoom-in animation */
}

#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px; /* Space for caption */
    font-size: 1.1rem;
    font-family: var(--primary-font);
}

.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;
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

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

@keyframes zoomOut {
    from {transform: scale(1);}
    to {transform: scale(0.8);}
}
