/* Basic reset and body style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Guardian Text Egyptian Web', Georgia, serif; /* Guardian-like font stack */
    line-height: 1.5;
    background-color: #f6f6f6; /* Light grey background */
    color: #333; /* Dark text */
}

/* Header styles */
header {
    background-color: white; /* White background */
    color: black;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dcdcdc; /* Light grey border */
}

.header-top {
    display: flex;
    align-items: baseline;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

#site-title {
    font-size: 2.5rem; /* Larger title */
    font-weight: bold;
    margin-right: 1rem;
    color: #052962; /* Guardian blue */
}

.header-subtitle {
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    border-top: 1px solid #dcdcdc;
    display: flex;
    gap: 1rem;
    overflow-x: auto; /* Allow horizontal scrolling if needed */
}

nav a {
    color: #333; /* Dark link color */
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap; /* Prevent wrapping */
}

nav a:hover {
    background-color: #f0f0f0; /* Light grey on hover */
}

/* Main content area */
main {
    max-width: 1200px; /* Limit width on large screens */
    margin: 0 auto; /* Center the content */
    padding: 1rem;
}

/* Section styles */
.pillar-section {
    margin-bottom: 2rem; /* Space between sections */
}

.pillar-section h2 {
    color: #052962; /* Guardian blue header text */
    border-bottom: 3px solid #052962; /* Blue line under headers */
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: bold;
}

/* Breaking News Banner */
#breaking-news-banner {
    background-color: #ff9900; /* Guardian orange for breaking news */
    color: white;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-radius: 3px;
    display: flex;
    align-items: center;
}

#breaking-news-banner h2 {
    display: inline;
    font-size: 1.2rem;
    margin-right: 1rem;
    color: white;
    border: none; /* Remove the blue line */
    padding-bottom: 0;
}

.breaking-news-container {
    display: inline;
}

.breaking-news-container .news-item {
    display: inline-block; /* Display breaking news items inline */
    margin-right: 1rem;
    background-color: inherit; /* Inherit background */
    padding: 0;
    box-shadow: none; /* Remove shadow for inline items */
    border-bottom: none; /* Remove border */
}

.breaking-news-container .news-item a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

/* --- ADD SEARCH STYLES HERE --- */
/* General styles for search containers */
#search-container, #search-container-top {
    padding: 0.5rem 0; /* Adjust padding as needed */
    text-align: center; /* Center the form */
    margin-bottom: 1rem; /* Space below the search bar */
}

#search-form, #search-form-top { /* Target both forms */
    display: inline-flex; /* Align input and button horizontally */
    align-items: center;
}

#search-input, #search-input-top { /* Target both inputs */
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 3px 0 0 3px; /* Rounded corners on left */
    width: 200px; /* Adjust width as needed */
}

#search-form button, #search-form-top button { /* Target buttons in both forms */
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: #052962; /* Use Guardian-like blue */
    color: white;
    border: 1px solid #052962; /* Match border color */
    border-radius: 0 3px 3px 0; /* Rounded corners on right */
    cursor: pointer;
}

#search-form button:hover, #search-form-top button:hover { /* Hover for both buttons */
    background-color: #001f4d; /* Darker blue on hover */
}
/* --- END ADD SEARCH STYLES --- */

/* Grid layout for news items */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
    gap: 1.5rem;
}

/* News item styles */
.news-item {
    background-color: white; /* White background for each news item */
    border-radius: 5px;
    overflow: hidden; /* Ensure content fits within rounded corners */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.news-item:hover {
    transform: translateY(-2px); /* Lift slightly on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Deeper shadow on hover */
}

.news-item img {
    width: 100%;
    height: 160px; /* Fixed height for thumbnails */
    object-fit: cover; /* Cover the area */
    display: block; /* Remove extra space below image */
}

.news-item-content {
    padding: 0.8rem;
}

.news-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
}

.news-item h3 a {
    color: #333; /* Dark link color for headlines */
    text-decoration: none;
    font-weight: bold;
}

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

.news-item p {
    margin: 0.25rem 0;
    color: #666; /* Lighter text for dates/details */
    font-size: 0.85rem;
}

.news-item .section-name {
    font-weight: bold;
    color: #052962; /* Guardian blue */
    font-size: 0.8rem;
}

/* Footer styles */
footer {
    background-color: white;
    color: #666;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #dcdcdc; /* Light grey border */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-nav {
    margin-top: 0.5rem;
}

.footer-nav a {
    color: #666;
    margin: 0 0.5rem;
    text-decoration: none;
    font-size: 0.85rem;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #site-title {
        font-size: 2rem;
    }
    nav {
        flex-wrap: wrap; /* Allow nav items to wrap on small screens */
        justify-content: center;
    }
    .news-grid {
        grid-template-columns: 1fr; /* Stack news items on small screens */
    }
}