/* News Page Styles - Clean Dark Theme */

:root {
    --news-bg-card: #272b37;
    --news-bg-hover: #2f3442;
    --news-text-primary: #eeeeee;
    --news-text-secondary: #aaaaaa;
    --news-accent: #dd1d1d;
    --news-border: #3e4452;
}

/* Header Section */
.news-main {
    padding-top: 0px;
}

.news-header-section {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.news-header-section .title {
    margin-top: 0;
    margin-bottom: 5px;
}

.news-header-section .subtitle {
    margin-bottom: 20px;
}

.rss-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--news-text-secondary);
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 10px;
    transition: all 0.2s;
}

.rss-badge:hover {
    background: var(--news-accent);
    color: white;
}

/* Layout */
.news-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 900px) {
    .news-layout {
        grid-template-columns: 1fr;
    }
}

/* Featured Post */
.featured-post {
    background: var(--news-bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.featured-post:hover {
    transform: translateY(-2px);
}

.featured-post-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.featured-post-content {
    padding: 30px;
}

.featured-badge {
    background: var(--news-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: inline-block;
}

.featured-post h2 {
    font-size: 2rem;
    margin: 10px 0;
    line-height: 1.2;
}

.featured-post h2 a {
    color: var(--news-text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.featured-post h2 a:hover {
    color: var(--news-accent);
}

.featured-post-meta {
    color: var(--news-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.featured-post-excerpt {
    color: rgba(238, 238, 238, 0.8);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more {
    color: var(--news-accent);
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    text-decoration: underline;
}

/* Filter Bar */
.news-filters .search-container input,
.news-filters .search-container select {
    padding: 10px 15px;
    background: var(--news-bg-card);
    border: 1px solid var(--news-border);
    border-radius: 4px;
    color: var(--news-text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.news-filters .search-container input:focus,
.news-filters .search-container select:focus {
    outline: none;
    border-color: var(--news-accent);
}

.news-filters .search-container select {
    cursor: pointer;
}

.news-filters .search-container select option {
    background-color: var(--news-bg-card);
    color: var(--news-text-primary);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.news-card {
    background: var(--news-bg-card);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--news-border);
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #2c3e50, #34495e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.news-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-category {
    color: var(--news-accent);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.news-card h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.news-card h3 a {
    color: var(--news-text-primary);
    text-decoration: none;
}

.news-card h3 a:hover {
    color: var(--news-accent);
}

.news-card-meta {
    font-size: 0.85rem;
    color: var(--news-text-secondary);
    margin-bottom: 12px;
}

.news-card-excerpt {
    font-size: 0.95rem;
    color: rgba(238, 238, 238, 0.7);
    margin-bottom: 15px;
    flex: 1;
    line-height: 1.5;
}

/* Sidebar */
.sidebar-widget {
    background: var(--news-bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.sidebar-widget h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--news-border);
    padding-bottom: 10px;
    color: var(--news-text-primary);
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 8px;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    color: var(--news-text-secondary);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.categories-list a:hover {
    color: var(--news-accent);
}

.category-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Recent Posts */
.recent-posts-list .recent-posts-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.recent-posts-item:last-child {
    margin-bottom: 0;
}

.recent-posts-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.recent-posts-content h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.recent-posts-content h4 a {
    color: var(--news-text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.recent-posts-content h4 a:hover {
    color: var(--news-accent);
}

.recent-posts-date {
    font-size: 0.8rem;
    color: var(--news-text-secondary);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--news-text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--news-accent);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    background: var(--news-bg-card);
    color: var(--news-text-primary);
    border: 1px solid var(--news-border);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled),
.page-btn.active {
    background: var(--news-accent);
    border-color: var(--news-accent);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Post Detail Page */
.post-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-meta-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.post-category {
    color: var(--news-accent);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.post-date {
    color: var(--news-text-secondary);
}

.post-title {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.post-author {
    color: var(--news-text-secondary);
    font-style: italic;
}

.post-featured-image {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: rgba(238, 238, 238, 0.9);
}

.post-body p {
    margin-bottom: 25px;
}

.post-body h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px 0;
    color: var(--news-text-primary);
}

.post-body a {
    color: var(--news-accent);
    text-decoration: underline;
}

.post-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--news-border);
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-btn.x {
    background: #000000;
}

.share-btn.reddit {
    background: #ff4500;
}

.share-btn.lemmy {
    background: #2b2b2b;
}

.share-btn.linkedin {
    background: #0a66c2;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.copy {
    background: #555;
}

/* Comments */
.comments-section {
    margin-top: 60px;
}

.comment-form {
    background: var(--news-bg-card);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--news-border);
    border-radius: 4px;
    color: white;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--news-accent);
}

.btn-primary {
    background: var(--news-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #b31818;
}

.comment {
    background: var(--news-bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.comment-author {
    font-weight: bold;
    color: var(--news-text-primary);
}

.comment-date {
    color: var(--news-text-secondary);
}

/* Loading/Error */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--news-text-secondary);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
}

/* The X (Twitter) button was pure #000 on the dark page — near-invisible.
   Give it a hairline border so it reads as a button. */
.share-btn.x {
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Keep markdown post content inside the column on every viewport. */
.post-body img {
    max-width: 100%;
    height: auto;
}

/* The news post page previously had no small-screen styling: the six share
   buttons overflowed horizontally and long content pushed the layout wide. */
@media (max-width: 600px) {
    .share-buttons {
        flex-wrap: wrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .featured-post-image {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .post-body {
        font-size: 1.05rem;
    }
}