:root {
    --primary-color: #2a2a2a;
    --secondary-color: #0066cc;
    --background-color: #f8f9fa;
    --accent-color: #e63946;
    --text-color: #333;
    --light-gray: #e0e0e0;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inconsolata", monospace;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
    padding-bottom: 80px;
    overflow-y: scroll;
}


header {
    padding: 0;
    text-align: center;
    margin-bottom: 0px;
}

ul.nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    background: var(--background-color);
    z-index: 999;
    text-decoration: none;
    padding: 10px 20px;
    color: var(--secondary-color);
    font-weight: bold;
    list-style-type: none;
    overflow: hidden;
    flex-wrap: wrap;
}

ul.nav li {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}

ul.nav li:hover {
    text-decoration: 3px dotted underline var(--secondary-color);
}

.main-navigation {
    margin-top: 0px;
}

.main-navigation ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0;
}

.main-navigation li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.main-navigation li a:hover {
    color: var(--accent-color);
}

.site-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: -1px;
    display: flex;
    justify-content: center;
}

.logo-image {
    max-width: 75%;
    height: auto;
    padding-top: 15px;
}

.time-stamp {
    color: #777;
    font-size: 0.9rem;
    margin: 5px 0 15px;
}

.lead-story {
    text-align: center;
    margin-bottom: 10px;
    margin-top: 96px;
}

@media screen and (max-width: 768px) {
    .lead-story {
        margin-top: 132px;
    }

}

.lead-headline {
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 0px;
    margin-top: 50px;
    line-height: 1;
    text-decoration: underline;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.lead-headline a {
    color: var(--accent-color);
    text-decoration: none;
}

.lead-headline a:hover {
    text-decoration: underline;
}

.lead-summary {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

.lead-image {
    width: 400px;
    max-width: 90vw;
    display: flex;
    max-height: 400px;;
    justify-content: center;
    align-items: center;
    overflow: clip;
    aspect-ratio: 1;
}

.lead-image img {
    margin-top: 4vh;
    height: 100%;
    overflow-clip-margin: content-box;
    overflow: clip;
}

.content-grid {
    /* display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px; */
    margin-top: .5rem;
    column-count: 3;
}

@media (max-width: 1024px) {
    .content-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .content-grid {
        column-count: 1;
    }
}

/* .column {
    display: flex;
    flex-direction: column;
    gap: 10px;
} */

.nobreak {
    display: inline-block;
    break-inside: avoid-column;
}

.hidden {
    display: none;
    visibility: collapse;
}

.selected {
    background-color: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.news-item {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s;
    position: relative;
    break-inside: avoid-column;
}

/* from the n-th item, hide it */
.news-item:nth-child(n+31) {
    display: none;
    visibility: collapse;
}

.news-item:hover {
    transform: translateY(-3px);
}

.news-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.news-item a:hover {
    color: var(--secondary-color);
}

.news-item .source {
    display: inline-block;
    color: #777;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: bold;
}

.publish-date {
    display: inline-block;
    color: #999;
    font-size: 0.8rem;
    margin-top: 5px;
    margin-left: 10px;
}

.article-image {
    width: 100%;
    height: auto;
}

.featured {
    font-size: 1.3rem;
    font-weight: bold;
}

.category-header {
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 5px;
    margin: 25px 0 15px;
}

.article-details {
    display: flex;
    justify-content: space-between;
}

.breaking {
    background-color: var(--accent-color);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    display: inline-block;
    margin-right: 5px;
    text-transform: uppercase;
}

.sidebar-module {
    background-color: #f8f8f8;
    border-radius: 5px;
    padding: 15px;
    margin-top: 25px;
    box-shadow: var(--box-shadow);
}

.sidebar-module h3 {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 5px;
}

.tweet {
    background-color: white;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #1DA1F2;
}

.tweet p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.tweet time {
    color: #999;
    font-size: 0.75rem;
}

footer {
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--light-gray);
    font-size: 0.9rem;
    color: #777;
}

@media screen and (max-width: 600px) {
    footer {
        margin-bottom: 200px;
    }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    text-align: left;
}

.traffic-counter {
    background-color: #f1f1f1;
    border-radius: 5px;
    padding: 10px 15px;
    box-shadow: var(--box-shadow);
    margin: 5px auto;
}

.counter-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
    text-align: center;
}

.counter-stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.stat-label {
    font-size: 0.6rem;
    color: #777;
    text-transform: uppercase;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

@media (max-width: 1024px) {
    body {
        padding: 0 15px;
    }

    .content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .lead-headline {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .ad-banner img {
        max-width: 100%;
        height: auto;
    }

    .site-title {
        margin-bottom: 10px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .news-item {
        padding: 12px;
        margin-bottom: 5px;
    }

    .search-container {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .site-title {
        font-size: 2rem;
    }

    .lead-headline {
        font-size: 1.6rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .copyright {
        text-align: center;
    }

    .counter-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .news-item a {
        font-size: 1rem;
    }

    .category-header {
        margin: 20px 0 10px;
    }

    .time-stamp {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    body {
        padding: 0 10px;
    }

    .lead-headline {
        font-size: 1.4rem;
    }

    .logo-image {
        max-width: 80%;
    }

    .ad-banner {
        transform: scale(0.9);
        transform-origin: center top;
    }

    .news-item {
        padding: 10px;
        margin-bottom: 5px;
    }
}

.search-container {
    margin-top: 15px;
    width: 100%;
    max-width: 275px;
}

.search-form {
    display: flex;
    height: 36px;
}

.search-input {
    flex-grow: 1;
    padding: 0px 12px;
    border: 1px solid var(--light-gray);
    border-right: none;
    border-radius: 1px 0 0 1px;
    font-size: 0.9rem;
    outline: none;
    font-family: "Inconsolata", monospace;
}

.search-input:focus {
    border-color: var(--secondary-color);
}

.search-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    font-family: "Inconsolata", monospace;
}

.search-button:hover {
    background-color: #0055aa;
}

.source-container {
    display: flex;
    flex-direction: column;
    position: relative;
    border-top: 1px solid var(--light-gray);
    margin-top: 100px;
}

.source-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    padding: 10px;
    background-color: #b5c9d6;
    color: white;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    margin: 20px 5px 0;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: "Inconsolata", monospace;
    transition: background-color 0.2s, color 0.2s;
}
.source-toggle:hover {
    background-color: var(--secondary-color);
    color: white;
}

.source-block {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    overflow: hidden;
    gap: 5px;
    transition: height 0.3s ease-in-out;
    height: 0; /* Initially collapsed */
    margin: 10px 5px;
}

.source-block.open {
    height: auto; /* Adjust based on content */
}

.quotes {
    position: fixed;
    bottom: 6px;
    left: 0px;
    width: 100%;
    height: 48px;
    background: rgba(0, 0, 0, 1);
    z-index: 999;
}