/* ======================================= */
/* News page specific overrides / layout   */
/* ======================================= */

body {
    /* Keep starfield canvas handled by JS */
    position: relative;
    overflow-x: hidden;
}

/* Nebula overlay */
#nebula-news {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 60% 20%, rgba(80, 105, 180, 0.12), transparent 45%),
                radial-gradient(circle at 20% 80%, rgba(120, 80, 200, 0.10), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.section-title {
    font-size: 1.9rem;
    text-align: center;
    color: #d3e7ff;
    margin-bottom: 0.0rem;
    letter-spacing: 0.03em;
}

/* Story cards grid */
.grid-stories {
    display: grid;
    gap: 1.8rem;
}

@media (min-width: 700px) {
    .grid-stories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1050px) {
    .grid-stories {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Story card with optional small thumbnail */
.story-card {
    background: rgba(18, 18, 28, 0.85);
    border: 1px solid #1c1c28;
    border-radius: 10px;
    padding: 1.6rem;
    position: relative;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    backdrop-filter: blur(3px);
    text-decoration: none;
    color: inherit;
    display: block;
}

.story-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4aa8ff, #9ad4ff);
    opacity: 0.25;
}

.story-card:hover {
    transform: translateY(-6px);
    border-color: #4aa8ff;
    box-shadow: 0 8px 20px rgba(74, 168, 255, 0.25);
}

.story-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
    color: #d3e7ff;
    line-height: 1.3;
}

.story-source-and-date {
    display: flex;
    align-items: baseline;
    column-gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.story-source {
    display: block;
    font-size: 1rem;
    color: #8ea5bb;
    font-weight: 400;
}

.story-date {
    display: block;
    font-size: 0.85rem;
    color: gray;
    font-weight: 400;
}

/* Small thumbnail - floats right with text wrap */
.story-thumbnail {
    width: 100px;
    height: 100px;
    float: right;
    margin: 0 0 0.75rem 0.75rem;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(40, 40, 50, 0.5);
    display: none; /* Hidden by default */
}

/* Show thumbnail when it has content */
.story-thumbnail:not(:empty) {
    display: block;
}

.story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.story-card p {
    font-size: 0.95rem;
    color: #c0c0d0;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.story-link {
    font-size: 0.9rem;
    color: #9ad4ff;
    text-decoration: none;
    display: block;
    clear: both; /* Ensure link appears below floated content */
}

.story-link:hover {
    text-decoration: underline;
}