/* --- Root Variables & General Setup --- */
:root {
    --bg-main: #F5F5DC; /* Beige */
    --text-dark: #36454F; /* Charcoal */
    --accent-primary: #6F4E37; /* Coffee Brown */
    --accent-secondary: #556B2F; /* Dark Olive Green */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lora', serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-dark);
    /* Replace this URL with your chosen craft paper texture! */
    background-image: url('https://www.toptal.com/designers/subtlepatterns/uploads/light-paper-fibers.png');
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-top: 0;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: rgba(245, 245, 220, 0.8); /* Semi-transparent beige */
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--accent-secondary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-weight: 700;
    font-size: 1rem;
}

/* --- Main Content Sections --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("/Images/pexels-tim-douglas-6205600.jpg"), no-repeat center center/cover;
    /* Image from Pexels by Tim Douglas */
    background-position-y: center;
    color: white;
    text-align: center;
    padding: 8rem 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.features {
    padding: 4rem 0;
    text-align: center;
}

.features h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

/* --- Component Styling (Buttons & Cards) --- */
.btn {
    background-color: var(--accent-primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #5a3e2b; /* A slightly darker coffee */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    text-align: left;
    width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.card img {
    border-radius: 5px;
}

/* --- Additions for the Brewing Calculator --- */

.calculator-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 3rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.calculator-container h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.calculator-container p {
    text-align: center;
    margin-bottom: 2rem;
    color: #555;
}

.calculator-form .form-group {
    margin-bottom: 1.5rem;
}

.calculator-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-family: var(--font-body);
}

.calculator-form input,
.calculator-form select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--accent-secondary);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: #fdfdfd;
}

/* Ensure the calculate button is centered */
.calculator-form {
    text-align: center;
}

#results {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
    text-align: center;
}

#results h3 {
    margin-bottom: 1rem;
}

#results p {
    font-size: 1.1rem;
    line-height: 1.8;
}

#results .error {
    color: #c0392b; /* A nice red for errors */
    font-weight: bold;
}

/* --- Additions for the Coffee Map Page --- */

.map-intro {
    text-align: center;
    margin-bottom: 2rem;
}

#coffee-map {
    height: 500px; /* This is crucial for the map to be visible */
    width: 100%;
    border: 2px solid var(--accent-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

/* Style the Leaflet popups to match our theme */
.leaflet-popup-content-wrapper {
    background-color: var(--bg-main);
    color: var(--text-dark);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    font-family: var(--font-body);
    line-height: 1.6;
}

.leaflet-popup-content strong {
    font-family: var(--font-heading);
    color: var(--accent-primary);
}

.leaflet-popup-tip {
    background-color: var(--bg-main);
}

/* Style the submission form container */
.submission-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 3rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.submission-container h3 {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.form-group-row .form-group {
    flex: 1;
}

.submission-container textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--accent-secondary);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: #fdfdfd;
    resize: vertical;
}

.form-note {
    text-align: center;
    margin-top: 1.5rem;
    font-style: italic;
    font-size: 0.9rem;
    color: #666;
}

/* --- Newsletter Signup Section --- */

.newsletter-signup {
    background-color: var(--accent-secondary); /* Dark Olive Green */
    color: var(--bg-main); /* Light Beige for text */
    padding: 4rem 2rem;
    text-align: center;
}

/* Make sure headings in this section are also light-colored */
.newsletter-signup h2 {
    color: #fff;
    font-size: 2.5rem;
}

.newsletter-signup p {
    color: var(--bg-main);
    max-width: 500px;
    margin: 0 auto 2rem auto; /* Center the paragraph */
}

/* Use Flexbox for a clean, single-line form */
.signup-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* Space between input and button */
    max-width: 500px;
    margin: 0 auto;
}

.signup-input {
    flex-grow: 1; /* Allows the input to take up available space */
    padding: 0.8rem;
    border: 2px solid transparent;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.signup-input:focus {
    outline: none;
    border-color: var(--accent-primary); /* Coffee Brown focus outline */
}

/* The existing .btn class will be used, but let's ensure it looks good */
.signup-form .btn {
    /* No new styles needed if the existing .btn class works well! */
    /* Our coffee-colored button should contrast nicely with the green. */
    flex-shrink: 0; /* Prevents the button from shrinking */
}

/* --- Footer --- */
.site-footer {
    background-color: #e5e5d3; /* Lighter beige */
    padding: 3rem 0 0 0;
    border-top: 2px solid var(--accent-secondary);
    margin-top: 4rem;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #ccc;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .footer-grid {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-form {
        justify-content: center;
    }
}