@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #2b201a;
    --text-color: #e6d7b9;
    --accent-color: #e6d7b9;
    --card-bg: #2b201a;
    --border-color: #e6d7b9;
}

body {
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: 
        linear-gradient(rgba(43, 32, 26, 0.95), rgba(43, 32, 26, 0.95)),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(230, 215, 185, 0.05) 2px,
            rgba(230, 215, 185, 0.05) 4px
        );
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'VT323', monospace;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 4px double var(--border-color);
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-img {
    height: 70px;
    width: auto;
    image-rendering: pixelated;
}

.logo-container .tagline {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 0;
    text-transform: uppercase;
}

/* SEARCH BAR */
.search-container {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.search-input {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    text-transform: uppercase;
    outline: none;
}

.search-input::placeholder {
    color: rgba(230, 215, 185, 0.5);
}

.search-button {
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 1px solid var(--text-color);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    text-transform: uppercase;
    margin-left: 5px;
}

.search-button:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}


nav a {
    margin-left: 2rem;
    text-decoration: none;
    color: var(--text-color);
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    text-transform: uppercase;
    border: 1px solid transparent;
    padding: 0.2rem 0.5rem;
}

nav a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 1px solid var(--text-color);
}

/* HERO SECTION LAYOUT */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Hero takes 2/3, Sidebar 1/3 */
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
    border-bottom: 2px solid var(--border-color);
}

#hero-container {
    border-right: 2px solid var(--border-color);
}

#hero-container .article-card {
    border: none;
    height: 100%;
    margin: 0;
}

#hero-container .article-image {
    aspect-ratio: 16 / 9; /* Wider hero image */
}

#hero-container h2 {
    font-size: 2.5rem;
}

/* HERO SIDEBAR */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--card-bg);
    overflow: hidden; /* Prevent sidebar blowouts */
}

/* REALITY FORECAST WIDGET */
.reality-forecast-widget {
    border-bottom: 2px dashed var(--border-color);
    padding: 0;
    font-family: 'VT323', monospace;
    background-color: rgba(0, 0, 0, 0.2);
}

/* SHARED SIDEBAR HEADERS */
.widget-header,
.ticker-header {
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 0.5rem;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.widget-content {
    padding: 1rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.status-label {
    opacity: 0.8;
}

.status-value {
    font-weight: bold;
    color: #ff5f5f; /* Retro red/orange */
    text-shadow: 0 0 2px rgba(255, 95, 95, 0.5);
}

.forecast-row {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1rem;
    margin-bottom: 0;
}

.status-text {
    margin: 0.2rem 0 0 0;
    color: #5af; /* Retro cyan */
    line-height: 1.2;
    font-size: 1.1rem;
}

.status-warning {
    margin-top: 1rem;
    color: #fb0; /* Retro yellow/orange */
    border: 1px dashed #fb0;
    padding: 0.5rem;
    font-size: 1rem;
    text-align: center;
    animation: blink-warning 2s infinite steps(2, start);
}

@keyframes blink-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* NEWS TICKER STYLES */
.news-ticker-container {
    background-color: var(--card-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1; /* Take remaining height */
    min-height: 200px;
}

.ticker-wrapper {
    flex-grow: 1;
    overflow-y: auto; /* Allow scrolling if content is too long */
    position: relative;
    padding: 1rem;
    max-height: 100%; /* Ensure it respects parent height */
}

.ticker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Optional: Animation for auto-scrolling can be added here or via JS */
}

.ticker-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(230, 215, 185, 0.3);
    padding-bottom: 1rem;
}

.ticker-item:last-child {
    border-bottom: none;
}

.ticker-item a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.ticker-item .ticker-time {
    font-size: 0.8rem;
    opacity: 0.7;
    display: block;
    margin-bottom: 0.3rem;
    font-family: 'VT323', monospace;
}

.ticker-item .ticker-headline {
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.2;
}

.ticker-item:hover .ticker-headline {
    text-decoration: underline;
    color: #fff;
}


/* MAIN GRID */
.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 0; /* Removing gap for a grid-line look */
    padding-top: 2rem;
    padding-bottom: 2rem;
    max-width: 1280px;
    margin: auto;
    background-color: var(--bg-color);
}

.article-card {
    background-color: var(--card-bg);
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    margin: 0 -2px -2px 0; /* Collapse borders by overlapping right and bottom */
    transition: background-color 0.2s;
    overflow: hidden;
    position: relative;
}

.article-card:hover {
    background-color: rgba(230, 215, 185, 0.1);
    z-index: 10;
    outline: 2px solid var(--text-color);
}

/* Removed old .article-card.hero styles as we use specific container now */

.article-image-link {
    display: block;
    width: 100%;
}

.article-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-bottom: 2px solid var(--border-color);
    filter: contrast(1.2); /* Retro photo effect */
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-category {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--text-color);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
    display: inline-block;
    align-self: flex-start;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.article-category:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.article-card h2 {
    font-size: 2rem;
    margin: 0.5rem 0 1rem 0;
    line-height: 1;
}

.article-card p {
    font-size: 1rem;
    margin: 0;
    flex-grow: 1;
    color: var(--text-color);
    opacity: 0.8;
}

.main-footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin-top: 3rem;
    border-top: 4px double var(--border-color);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* AD BANNER STYLES - WINDOWS 95 STYLE */
.retro-ad-banner {
    grid-column: 1 / -1;
    background-color: #c0c0c0;
    color: #000;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff; /* Win95 Outset Border */
    padding: 2px;
    margin-bottom: 2rem;
    cursor: pointer;
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    box-shadow: none;
    animation: none;
}

.ad-title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    padding: 3px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.ad-close-btn {
    background-color: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    width: 16px;
    height: 14px;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    font-weight: bold;
}

.ad-body {
    padding: 1rem 2rem;
    text-align: center;
}

.retro-ad-banner h3 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: #000;
    text-transform: none;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

.retro-ad-banner p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 1;
    color: #000;
}

.retro-ad-banner .ad-options {
    margin-top: 1rem;
    font-size: 0.9rem;
    background: #fff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080; /* Win95 Inset Border */
    padding: 5px;
    display: inline-block;
}

.retro-ad-banner:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding-top: 3px;
    padding-left: 3px;
}

/* BREAKING NEWS TOAST */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 1000;
    font-family: 'VT323', monospace;
    display: none; /* Hidden by default */
}

.toast {
    background-color: var(--card-bg);
    border: 2px solid var(--text-color);
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
    padding: 0;
    margin-bottom: 10px;
    animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.removing {
    animation: slide-out 0.5s ease-in forwards;
}

.toast-header {
    background-color: #ff5f5f;
    color: var(--bg-color);
    padding: 5px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--text-color);
}

.toast-title {
    text-transform: uppercase;
}

.toast-close {
    cursor: pointer;
    font-weight: bold;
}

.toast-body {
    padding: 10px;
    font-size: 1.1rem;
    line-height: 1.2;
}


@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
    }
    #hero-container {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    .news-ticker-container {
        max-height: 300px; /* Limit height on mobile */
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 1.5rem;
        text-align: center;
    }
    nav {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    nav a {
        margin: 0.5rem;
    }
    .search-container {
        margin-left: 0;
        margin-top: 1rem;
    }
    .reality-forecast-widget,
    .news-ticker-container {
        display: none;
    }
    .main-grid {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    .article-card {
        margin: 0;
    }
    .retro-ad-banner h3 {
        font-size: 2rem;
    }
}
