/* Define CSS variables */
:root {
    --header-height: 60px;       /* Fixed height for header */
    --header-padding: 24px;      /* 1.5rem padding converted to px */
    --total-header-space: calc(var(--header-height) + var(--header-padding) * 2); /* Total space taken by header */
}

.filter-container {
    position: fixed;
    left: 0;
    top: var(--total-header-space); /* Use the total header space variable */
    margin-top: 0;
    width: 320px; /* Set explicit width to match main-container margin-left */
    height: calc(100vh - var(--total-header-space)); /* Full height minus total header space */
    overflow: hidden; /* Hide overflow, let the filter-section handle scrolling */
}

.filter-section {
    padding: 20px;
    height: 100%; /* Take full height of the container */
    overflow-y: auto; /* Change to auto for better scrolling behavior */
    display: flex;
    flex-direction: column; /* Stack children vertically */
}

/* Style the list of sources */
.source-list {
    list-style-type: none;
    padding: 0 0 30px 0; /* Add 30px padding to the bottom */
    margin: 0;
    overflow-y: auto; /* Enable scrolling if needed */
    flex: 1; /* Allow the list to grow and fill available space */
}

.source-list li {
    margin-bottom: 10px;
}

.source-list li a {
    display: block;
    padding: 10px;
    background-color: #0c60b4; /* Match the background color of the filter container */
    color: #ffffff; /* White text for contrast */
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.source-list li a:hover {
    background-color: #084a9c; /* Slightly darker blue for hover effect */
    color: #ffffff; /* Ensure text remains white on hover */
}

/* main-container.css */
body {
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    overflow: hidden; /* Prevent scrolling on the whole page */
    height: 100vh; /* Set body to full viewport height */
}

.layout-container {
    display: flex;
    height: calc(100vh - var(--total-header-space)); /* Full height minus total header space */
    overflow: hidden; /* Prevent scrolling in the layout container */
}

.main-container {
    display: flex;
    flex: 1;
    margin-left: 320px; /* Adjust for the fixed filter section width */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 18px rgba(210, 180, 140, 0.2); /* Reduced shadow */
    overflow-y: auto; /* Enable vertical scrolling */
    height: calc(100vh - var(--total-header-space)); /* Full height minus total header space */
}

.content-section {
    flex: 1;
    padding-left: 20px; /* Space to the left of content */
}

.article {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #ffe4b5; /* Moccasin color for borders */
    padding: 20px 0;
}

.article:last-child {
    border-bottom: none;
}

.article img {
    width: 198px; /* 10% smaller than 220px */
    height: 148.5px; /* 10% smaller than 165px */
    object-fit: cover;
    margin-right: 25px;
    border-radius: 8px;
    display: block;
}

.placeholder-image {
    width: 198px;
    height: 148.5px;
    background-color: #f0f0f0;
    border-radius: 8px;
    margin-right: 25px;
}

.article .content {
    flex: 1;
    position: relative;
}

.article h2 {
    margin: 0 0 15px 0;
    font-size: 2.2em;
    color: #b8860b; /* Dark goldenrod for subheadings */
    font-weight: normal;
}

.article a {
    text-decoration: none;
    color: #5a4a41;
    transition: color 0.3s ease;
}

.article a:hover {
    color: #d2691e;
}

.article p {
    margin: 15px 0;
    font-size: 1.21em;
    line-height: 1.76;
    color: #6b5a4f;
}

.article .content {
    padding-bottom: 30px;
}

.source {
    font-size: 1.045em;
    color: #a08679;
    font-style: italic;
    position: absolute;
    bottom: 0;
    left: 0;
    padding-left: 0;
    text-align: left;
    width: calc(100% - 25px);
}

.refresh-button {
    background-color: #0c60b4;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.refresh-button:hover {
    background-color: #084a9c;
}

@media (max-width: 768px) {
    .filter-container {
        position: static;
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }
    
    .layout-container {
        flex-direction: column;
        height: auto; /* Allow layout to expand on mobile */
        overflow: visible; /* Allow scrolling on mobile */
    }
    
    .main-container {
        margin-left: 0; /* Remove margin to adjust for responsive layout */
        height: auto; /* Allow container to expand on mobile */
        overflow-y: visible; /* Use default scrolling on mobile */
    }

    body {
        overflow: auto; /* Re-enable scrolling on mobile */
        height: auto; /* Allow body to expand on mobile */
    }

    .article img, .placeholder-image {
        width: 97.2px;
        height: 72.9px;
    }
}