/* ============================================
   News Article Styles
   Optimized for readability and Google Discover
   ============================================ */

/* Article Layout - Full Width */
.container .article-layout {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
    width: 100%;
}

.article-layout .news-article {
    min-width: 0; /* Prevents grid overflow */
    line-height: 1.8;
    padding: 0;
    max-width: none;
}

/* Fallback for articles without article-layout wrapper (old structure) */
.container > .news-article:first-child:not(.article-layout .news-article) {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px var(--container-padding);
    line-height: 1.8;
}


.article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

/* Quest guides use their own title block; hide the duplicate WordPress-style article header */
.news-article:has(.ul-header) .article-header,
.news-article:has(.mq-header) .article-header {
    display: none;
}

@media (max-width: 768px) {
    .news-article .article-meta,
    .article-layout .article-meta {
        flex-wrap: wrap;
        gap: 15px;
    }
}

.news-article .article-meta {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}


.article-date {
    color: var(--color-text-muted);
}

.article-author {
    color: var(--color-text-muted);
    margin-left: 8px;
}

.article-author::before {
    content: "• ";
    margin-right: 4px;
    color: var(--color-text-dim);
}

.article-author-link {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.article-author-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.news-article .article-title {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--color-text);
}

.article-excerpt {
    font-size: 1.2em;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.article-featured-image {
    margin-top: 30px;
    margin-bottom: 0;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.article-content {
    font-size: 1.1em;
    color: var(--color-text);
}

.article-content h2 {
    font-size: 1.8em;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--color-accent);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.article-content h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.article-content h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 12px;
    color: var(--color-accent);
}

.article-content h5,
.article-content h6 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--color-accent);
}

.article-content p {
    margin-bottom: 12px;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--color-accent);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 30px 0;
    border: 1px solid var(--color-border);
}

.article-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 20px;
    margin: 30px 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.article-tags {
    margin-bottom: 30px;
}

.article-tags a {
    display: inline-block;
    padding: 5px 12px;
    margin: 5px 5px 5px 0;
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s;
}

.article-tags a:hover {
    background: var(--color-accent-subtle);
    border-color: var(--color-accent-border);
    color: var(--color-accent);
}

.article-tools-cta {
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-top: 30px;
}

.article-tools-cta h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.article-tools-cta p {
    color: var(--color-text-muted);
}

.article-tools-cta ul {
    list-style: none;
    padding-left: 0;
}

.article-tools-cta li {
    margin-bottom: 8px;
}

.article-tools-cta a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.article-tools-cta a:hover {
    text-decoration: underline;
}

/* ============================================
   News Index Page
   ============================================ */
.news-index {
    padding: 40px var(--container-padding);
}

.news-index-header {
    margin-bottom: 40px;
    text-align: center;
}

.news-index-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.news-index-header p {
    color: var(--color-text-muted);
    font-size: 1.1em;
}

.news-list {
    display: grid;
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

/* News Card Styles */
.news-card {
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    transition: all 0.2s;
}

.news-card:hover {
    border-color: var(--color-accent-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.news-card-image {
    width: 200px;
    height: 150px;
    overflow: hidden;
    background: var(--color-bg-container);
    flex-shrink: 0;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    color: var(--color-text);
}

.news-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.news-card-meta time {
    white-space: nowrap;
    color: var(--color-text-muted);
}

.news-card-meta-sep {
    color: var(--color-text-muted);
    opacity: 0.5;
    white-space: nowrap;
    margin: 0 2px;
}

.news-card-author {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.news-card-author:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.news-card-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.news-card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.news-card-title a:hover {
    color: var(--color-accent);
}

.news-card-excerpt {
    color: var(--color-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* Loading and End Messages */
.news-loading,
.news-end,
.news-empty,
.news-error {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
}

.news-error {
    color: #ef4444;
}

/* Game Cards Sidebar */
.sidebar-section {
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}


/* Responsive */
@media (max-width: 768px) {
    .article-layout {
        padding: 20px 15px;
    }
    
    .news-article {
        width: 100%;
    }
    
    .news-article .article-title,
    .article-layout .article-title {
        font-size: 2em;
    }
    
    .article-content {
        font-size: 1em;
    }
    
    .article-content h2 {
        font-size: 1.5em;
    }
    
    .article-content h3 {
        font-size: 1.2em;
    }
    
    /* News cards on mobile */
    .news-card {
        grid-template-columns: 1fr;
    }
    
    .news-card-image {
        width: 100%;
        height: 200px;
    }
}
