/* Reset & Basics */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #444;
    line-height: 1.7;
    /* Adding the Background Image chosen for you (subtle marble) */
    background-image: url('https://mesinummi.ee/taust.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Makes bg stay still while scrolling */
    padding: 40px 0; /* Space top and bottom */
}

/* The Main Centered Box */
.main-container {
    max-width: 1140px;
    margin: 0 auto;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden; /* Contains floated elements */
}

/* Typography Helpers */
h1, h2, h3, .logo {
    font-family: 'Playfair Display', serif;
    color: #222;
}

a { text-decoration: none; }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
}

.logo {
    font-size: 50px;
    font-weight: 800;
    letter-spacing: 3px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    padding: 50px 50px 80px 50px;
}

.hero-content {
    flex: 1;
    padding-right: 30px;
}

.hero-content h1 {
    font-size: 64px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-content h1 span {
    color: #888;
    font-style: italic;
}

.hero-image {
    flex: 1.2;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Overlapping Sections (The core design feature) --- */
.overlap-section {
    display: flex;
    align-items: center;
    padding: 80px 0;
    position: relative;
}

.text-box {
    background: #fff;
    padding: 50px;
    z-index: 2; /* Ensures text sits on top of image */
    border: 1px solid #f0f0f0; /* Subtle border defined in original */
}

.text-box h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.text-box p {
    margin-bottom: 30px;
    color: #666;
}

.read-more {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px;
    color: #000;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
}

.image-box img {
    width: 100%;
    height: auto;
    display: block;
    z-index: 1;
}

/* Variation 1: Image Right, Text sits over it to the left */
.right-image-focus {
    padding-left: 50px;
}
.right-image-focus .text-box {
    width: 50%;
    margin-right: -10%; /* Allows it to overlap the image */
}
.right-image-focus .image-box {
    width: 60%;
}

/* Variation 2: Image Left, Text sits over it to the right */
.left-image-focus {
    justify-content: flex-end; /* Pushes everything to right */
    padding-right: 50px;
}
.left-image-focus .image-box {
    width: 60%;
    margin-right: -10%; /* Allows image to overlap text */
}
.left-image-focus .text-box {
    width: 50%;
}


/* Feature Image Section */
.feature-image {
    position: relative;
    margin: 60px 0;
}

.feature-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    filter: brightness(0.7);
}

.feature-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    width: 80%;
}

.feature-text h3 {
    color: #fff;
    font-size: 32px;
    font-style: italic;
}

/* Gallery */
.gallery-intro {
    text-align: center;
    margin-bottom: 30px;
}
.gallery-intro h2 {
    font-size: 32px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 50px 80px 50px;
}

.grid-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* Footer */
footer {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    body { padding: 0; } /* Full width on smaller screens */
    
    .hero h1 { font-size: 48px; }
    
    /* Stack the overlap sections neatly on tablet/mobile */
    .overlap-section {
        flex-direction: column;
        padding: 40px 20px;
    }
    
    .right-image-focus, .left-image-focus {
        padding-left: 20px;
        padding-right: 20px;
    }

    .text-box, .image-box {
        width: 100% !important; /* Force full width */
        margin: 0 !important; /* Remove overlap margins */
    }
    
    /* Reorder for mobile so image is always on top of text */
    .right-image-focus { flex-direction: column-reverse; }
    
    .text-box {
        padding: 30px 20px;
        border: none; /* Remove border on mobile for cleaner look */
        text-align: center;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 20px;
    }
    nav ul {
        margin-top: 20px;
    }
    nav ul li {
        margin: 0 10px;
    }
    .hero {
        flex-direction: column-reverse;
        padding: 30px 20px;
    }
    .hero-content {
        padding-right: 0;
        text-align: center;
        margin-top: 30px;
    }
    .gallery {
        grid-template-columns: 1fr;
        padding: 0 20px 50px 20px;
    }
    .grid-item img {
        height: auto;
    }
}