/* Basic Reset & Body Styles */
body {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; /* Traditional font choice */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #4A4A4A; /* Softer dark gray */
    background-color: #F8F5EF; /* Warm off-white, like parchment */
}

/* Header Styles */
header {
    background: #7C562B; /* Deep, rich brown */
    color: #F8F5EF; /* Warm off-white */
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3); /* Deeper shadow */
}

header h1 {
    margin: 0;
    font-size: 3rem; /* Slightly larger for classic feel */
    font-weight: normal; /* Often less bold in traditional designs */
    letter-spacing: 2px; /* Adds a touch of elegance */
}

/* Main Content Styles */
main {
    padding: 30px;
    max-width: 1200px;
    margin: 30px auto;
    /* The white box properties were removed or commented out */
}

/* Image Gallery Section */
.image-gallery {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 25px; /* Slightly more space between columns */
    margin-top: 40px;
}

.gallery-item {
    position: relative; /* KEY: Establish positioning context for the text-overlay */
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: #FDFCFB; /* Very light, almost white background for the whole item */
    border: 1px solid #D7CDBE; /* Muted, warm border for the whole item */
    border-radius: 3px; /* Minimal rounding for the whole item */
    padding: 0; /* No internal padding here, content dictates height */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Subtle shadow for the whole item */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    /* IMPORTANT: Ensure overflow: hidden; is NOT here. */
    /* This allows the text-overlay to extend beyond the image's height. */
    margin-bottom: 50px; /* Increased margin at the bottom to make space for the dropped text */
    /* You might need to adjust this margin-bottom based on your text's exact height */
}

.gallery-item:hover {
    transform: translateY(-8px); /* More pronounced lift */
    box-shadow: 0 6px 15px rgba(0,0,0,0.2); /* Stronger shadow on hover */
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below image */
    border: 1px solid #C4B9A7; /* A subtle border around images */
    margin-bottom: 0; /* Ensure no space below image */
    border-radius: 3px 3px 0 0; /* Match parent's top corners, square bottom */
}

/* Global Navigation Styles */
header nav ul {
    list-style: none; /* Removes bullet points */
    padding: 0;
    margin: 1rem 0 0; /* Add margin below the main title */
    text-align: center; /* Centers the navigation links */
    display: flex; /* Use flexbox for horizontal layout */
    justify-content: center; /* Centers items in the flex container */
    gap: 25px; /* Space between navigation items */
}

header nav ul li {
    display: inline-block; /* Ensures list items are inline but respect margins/padding */
    /* margin: 0 15px; No need for this if using gap */
}

header nav ul li a {
    text-decoration: none; /* Removes underline */
    color: #F8F5EF; /* Warm off-white, matching header text */
    padding: 8px 15px; /* Add some padding for clickable area */
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 3px; /* Slightly rounded corners for buttons */
}

header nav ul li a:hover {
    color: #4E342E; /* Darker brown on hover */
    background-color: #D7CCC8; /* Lighter background on hover */
}


/* NEW: Styles for the text overlay container */
.text-overlay {
    position: absolute; /* Position relative to .gallery-item */
    bottom: 0; /* Align its bottom with the .gallery-item's bottom */
    left: 0;
    width: 100%;
    /*background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white background for the text */
    padding: 10px 15px; /* Padding inside the text box */
    box-sizing: border-box; /* Include padding in the width calculation */
    transform: translateY(50%); /* KEY: Shifts the element down by 50% of its own height */
                                /* This makes it appear half on the image, half below */
    text-align: left; /* Left justified */
    font-style: italic; /* Italic font */
    font-size: 3.5rem; /* Inherited by p, but good to have here for consistency */
    font-weight: bold; /* Inherited by p */
    color: #4C4C4C; /* Default color for the text */
}

/* Style for the actual link text inside the overlay */
.text-overlay p {
    margin: 0; /* Remove default paragraph margins */
    /* font-size and font-weight are now inherited from .text-overlay */
}

.text-overlay a {
    text-decoration: none;
    color: #8D6E63; /* A warm, muted brown for links */
    transition: color 0.3s ease;
}

.text-overlay a:hover {
    color: #A1887F; /* Lighter warm brown on hover */
    text-decoration: underline; /* Classical touch for links */
}


/* Footer Styles */
footer {
    background: #553A1C; /* Even deeper, grounding brown */
    color: #F8F5EF; /* Warm off-white */
    text-align: center;
    padding: 2rem 0;
    margin-top: 50px; /* Ensure sufficient margin from gallery items */
    box-shadow: 0 -3px 8px rgba(0,0,0,0.3); /* Deeper shadow */
}

.footer-links a {
    color: #F8F5EF;
    text-decoration: none;
    margin: 0 20px; /* More spacing for elegance */
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.footer-links a:hover {
    color: #D7CCC8; /* Lighter on hover */
    text-decoration: underline;
}

footer p {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.8;
}