/* General Body Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* Header and Navigation */
header {
    background-color: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.logo {
    width: 100px;
}

.header-top {
    display: flex;
    align-items: center;
}

.header-bottom {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow this container to grow */
    justify-content: space-between; /* Push nav and search apart */
    margin-left: 2rem; /* Add space between logo and nav */
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #0056b3;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #0056b3;
}

/* Search Form */
.search-form {
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes form to the far right */
}

.search-form input[type="search"] {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.search-form button {
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #004494;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    position: relative;
    transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #333;
    left: 0;
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}


/* Media Query for Mobile (screens smaller than 768px) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-top {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-bottom {
        display: none; /* Hide menu by default on mobile */
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        margin-top: 1rem;
        margin-left: 0; /* Reset margin for mobile view */
    }

    .header-bottom.active {
        display: flex; /* Show when active */
    }
    
    .menu-toggle {
        display: block; /* Show hamburger on mobile */
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
    }

    nav ul li {
        margin: 10px 0;
        text-align: center;
        background-color: #f9f9f9;
        padding: 10px;
        border-radius: 4px;
    }

    .search-form {
        margin-top: 15px;
        width: 100%;
        margin-left: 0; /* Reset margin for mobile */
    }

    .search-form input[type="search"] {
        width: 100%;
    }
}


/* Main Content Area */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    height: 90px;
    background-color: #e9e9e9;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem; /* Added for the bottom banner */
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #888;
    border-radius: 8px;
}

/* News List Container */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Individual News Item in a List */
.news-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.news-item-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-item-category {
    font-size: 0.8rem;
    color: #0056b3;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.news-item h2 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
}

.news-item h2 a {
    text-decoration: none;
    color: #333;
}

.news-item h2 a:hover {
    text-decoration: underline;
}

.news-item p {
    font-size: 0.9rem;
    color: #666;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.news-item-date {
    font-size: 0.8rem;
    color: #666;
    align-self: flex-start;
}


/* News Article (Details Page) */
.news-article {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.article-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
}

.article-meta {
    font-size: 0.9rem;
    color: #777;
    margin-top: 1.5rem; /* Add space below the image */
    margin-bottom: 1.5rem; /* Add space above the content */
    border-bottom: 1px solid #eee; /* Add a separator line */
    padding-bottom: 1rem; /* Space out the separator line */
    display: flex; /* Use flexbox for alignment */
    justify-content: space-between; /* Distribute items evenly */
    align-items: center; /* Align items vertically */
    max-width: 800px; /* Match the image max-width */
    margin-left: auto; /* Center the block */
    margin-right: auto; /* Center the block */
}

.article-meta span {
    /* Revert back to inline display for horizontal layout */
    display: inline;
    margin-bottom: 0; /* Remove bottom margin */
}

.article-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-preview {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 1.5rem;
}


/* Pagination */
.pagination {
    text-align: center;
    margin-top: 2rem;
}

.pagination a {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    color: #0056b3;
    margin: 0 5px;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #0056b3;
    color: #fff;
}
