/* --- Global Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #343a40;
}

h1, h2, h3 {
    font-family: "Georgia", serif;
    color: #212529;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
    background-color: #e0f2f7; /* Light Blue */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    position: fixed; /* Make the header sticky */
    top: 0; /* Position it at the top */
    width: 100%; /* Full width */
    z-index: 1000; /* Ensure it stays on top of other content */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.logo {
    font-size: 1.8rem; /* Larger font */
    font-weight: bold;
    color: #212529;
    text-decoration: none;
    margin-right: 20px; /* Space between logo and nav items */
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-grow: 1; /* Allow nav items to take available space */
    justify-content: flex-start; /* Align nav items to the start */
}

nav ul li {
    margin-right: 25px; /* More space between nav items */
}

nav ul li a {
    font-weight: 500;
    color: #495057;
    font-size: 1.1rem; /* Larger font */
}

/* Adjust main content to prevent it from being hidden under the sticky header */
main {
    padding-top: 100px; /* Adjust this value based on your header's height */
}

/* Search bar within navigation */
nav .search-container {
    margin-top: 0; /* Remove top margin from previous hero section styling */
    margin-left: auto; /* Push search bar to the right */
    position: relative; /* For icon positioning */
}

#blogSearch {
    width: 100%;
    max-width: 300px; /* Longer search bar */
    padding: 8px 15px;
    padding-right: 40px; /* Space for icon */
    border: 1px solid #0056b3; /* Darker blue border */
    border-radius: 25px;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    outline: none;
    transition: all 0.3s ease;
}

#blogSearch:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.search-icon {
    position: absolute;
    right: 15px;
    color: #0056b3; /* Darker blue for icon */
    cursor: pointer;
    font-size: 1.2rem; /* Size of the icon */
}


/* Responsive adjustments for navigation */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    nav ul li {
        margin-right: 0;
        margin-bottom: 10px;
    }

    nav .search-container {
        margin-left: 0;
        width: 100%;
    }

    nav #blogSearch {
        max-width: 100%;
    }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 40px;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #6c757d;
    margin: 0 10px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- Static Page (About, Contact, Legal) --- */
.static-page {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 20px auto;
}

.static-page h1 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.static-page p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

.static-page form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.static-page label {
    font-weight: bold;
    margin-bottom: 5px;
}

.static-page input[type="text"],
.static-page input[type="email"],
.static-page textarea {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.static-page textarea {
    resize: vertical;
}

.static-page button.button {
    align-self: flex-start;
    margin-top: 10px;
}

/* --- Buttons --- */
.button {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #0056b3;
    color: #ffffff;
    text-decoration: none;
}

.button-container {
    text-align: center;
    margin-top: 30px;
}

/* --- Homepage Blog Grid --- */
#blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.blog-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    margin-top: 0;
    font-size: 1.25rem;
}

.blog-card-description {
    color: #6c757d;
    flex-grow: 1;
}

.blog-card .button {
    margin-top: 15px;
    align-self: flex-start;
}


/* --- Single Blog Post Page --- */
.blog-post {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 20px auto;
}

.blog-title {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.blog-date {
    color: #6c757d;
    margin-bottom: 30px;
    font-style: italic;
}

.blog-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.blog-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.blog-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content ul {
    padding-left: 20px;
    margin-bottom: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

/* --- Hero Section --- */
#hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-background.jpg') no-repeat center center/cover; /* Placeholder background image */
    color: #ffffff;
    text-align: center;
    padding: 60px 20px; /* Reduced padding */
    border-radius: 8px;
    margin-bottom: 40px;
    min-height: 250px; /* Ensure it takes up about a third of the page */
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero h2 {
    font-size: 2.5rem; /* Adjusted font size */
    margin-bottom: 15px;
    color: #ffffff;
}

#hero p {
    font-size: 1.1rem; /* Adjusted font size */
    max-width: 800px;
    margin: 0 auto 25px auto;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Hide the button that was removed from hero */
#hero .button {
    display: none;
}
