/* ============================================================
   pages/news.css — AI News & Blog styles
   ============================================================ */

/* ── Hero ── */
.news-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 56px 0 48px;
}

.news-hero-inner {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: center;
}

.news-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.news-hero-sub {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
}

.news-search-form {
    display: flex;
    gap: 8px;
}

/* ── Featured article ── */
.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
}

.featured-article:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.featured-article-image {
    position: relative;
    min-height: 300px;
    background: var(--surface-2);
    overflow: hidden;
}

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

.featured-article-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 4rem;
    opacity: 0.3;
}

.featured-article-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 4px 12px;
    background: rgba(255,184,0,0.15);
    border: 1px solid rgba(255,184,0,0.3);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-yellow);
    backdrop-filter: blur(8px);
}

.featured-article-body {
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.featured-article-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.featured-article-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.news-read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-orange);
}

/* ── Meta elements ── */
.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.news-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0,212,255,0.1);
    color: var(--accent-cyan);
    text-decoration: none;
    transition: background 0.15s;
}

.news-category-badge:hover { background: rgba(0,212,255,0.18); }

.news-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.news-read-time {
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* ── Layout ── */
.news-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}

.news-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-main { min-width: 0; }

/* ── Tags cloud ── */
.news-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.news-tag {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}

.news-tag:hover,
.news-tag.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0,212,255,0.05);
}

/* ── Results bar ── */
.news-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

/* ── Newsletter sidebar ── */
.sidebar-newsletter-form { margin-top: 10px; }

.sidebar-email-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface-2, #161929);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.83rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.sidebar-email-input:focus { border-color: rgba(255,92,53,0.5); }
.sidebar-email-input::placeholder { color: var(--text-faint); }

/* ── News grid ── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.15s;
}

.news-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.news-card-image-link { display: block; }

.news-card-image {
    position: relative;
    height: 180px;
    background: var(--surface-2);
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img { transform: scale(1.03); }

.news-img-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
    position: relative;
    overflow: hidden;
}

.news-img-fallback::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,92,53,0.08) 0%, rgba(168,85,247,0.08) 100%);
}

.news-img-fallback-icon {
    font-size: 2rem;
    position: relative;
    z-index: 1;
    opacity: 0.5;
}

.news-img-fallback-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    position: relative;
    z-index: 1;
    max-width: 90%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-source-chip {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.news-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

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

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

.news-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.news-author {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.news-read-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-orange);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.news-read-link:hover { opacity: 0.75; }

/* ── Article page ── */
.article-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 48px 0 36px;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 820px;
}

.article-excerpt {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 720px;
    margin-bottom: 20px;
}

.article-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.article-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-author-name { font-weight: 600; font-size: 0.88rem; }
.article-author-meta { font-size: 0.75rem; color: var(--text-muted); }

.article-cover {
    border-radius: var(--radius-xl);
    overflow: hidden;
    max-height: 480px;
    margin-bottom: 0;
}

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

/* ── Article layout ── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 80px;
    align-items: start;
}

.article-body-wrap { min-width: 0; }

/* ── Prose ── */
.prose {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.prose h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 2em 0 0.75em;
}

.prose h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.75em 0 0.6em;
}

.prose p { margin-bottom: 1.4em; }

.prose a { color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 3px; }

.prose strong { color: var(--text); font-weight: 600; }

.prose ul, .prose ol {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.prose li { margin-bottom: 0.4em; }

.prose blockquote {
    border-left: 3px solid var(--accent-orange);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: rgba(255,92,53,0.05);
    border-radius: 0 8px 8px 0;
    color: var(--text);
    font-style: italic;
}

.prose code {
    font-family: monospace;
    font-size: 0.88em;
    background: var(--surface-2, #161929);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-cyan);
}

.prose pre {
    background: var(--surface-2, #161929);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 1.4em;
}

.prose pre code { background: none; padding: 0; color: var(--text); }

.prose img {
    width: 100%;
    border-radius: 10px;
    margin: 1em 0;
}

/* ── Article footer elements ── */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-tags-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.article-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.article-share-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.share-btn {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.share-btn:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Article sidebar ── */
.article-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.related-article-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: opacity 0.15s;
}

.related-article-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-article-item:hover { opacity: 0.75; }

.related-article-image {
    width: 56px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
}

.related-article-image img { width: 100%; height: 100%; object-fit: cover; }
.related-article-title { font-size: 0.8rem; font-weight: 500; line-height: 1.35; }
.related-article-date { font-size: 0.7rem; color: var(--text-faint); margin-top: 3px; }

/* ── Responsive ── */
@media (max-width: 1000px) {
    .news-hero-inner { grid-template-columns: 1fr; }
    .featured-article { grid-template-columns: 1fr; }
    .featured-article-image { min-height: 220px; }
    .article-layout { grid-template-columns: 1fr; }
    .article-sidebar { position: static; }
}

@media (max-width: 860px) {
    .news-layout { grid-template-columns: 1fr; }
    .news-sidebar { position: static; }
    .news-grid { grid-template-columns: 1fr; }
}
