/*
Theme Name: News Flash
Theme URI: 
Author: Antigravity AI
Author URI: 
Description: A typography-driven, image-free news theme optimized for high readability and a bright, energetic Japanese atmosphere. Features a real-time animated headline ticker.
Version: 1.0.3
Text Domain: news-flash
*/

/* ==========================================================================
   CSS Variables (Design System)
   ========================================================================== */
:root {
    /* Colors */
    --color-bg-base: #f8f9fa; /* Bright, soft off-white for wide areas */
    --color-bg-content: #ffffff; /* Crisp white for reading areas */
    --color-text-main: #333333; /* Soft black for less eye strain */
    --color-text-muted: #6c757d; /* Gray for dates, meta */
    --color-primary: #D32F2F; /* Energetic News Red */
    --color-primary-hover: #b71c1c;
    --color-accent: #1976D2; /* Trustworthy Japanese Blue */
    --color-border: #e9ecef;
    --color-border-dark: #dee2e6;
    --color-ticker-bg: #212529;
    --color-ticker-text: #ffffff;
    
    /* Typography */
    --font-family-base: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.8; /* Generous line height for Japanese readability */
    --line-height-heading: 1.4;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Layout */
    --container-max-width: 1200px;
    --article-max-width: 800px; /* Narrower for comfortable reading without eye tracking distance */
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

/* ==========================================================================
   Reset & Basics
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-main);
    background-color: var(--color-bg-base);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    line-height: var(--line-height-heading);
    font-weight: 700;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    background-color: var(--color-bg-content);
    border-bottom: 4px solid var(--color-primary); /* Bold brand line */
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) 0;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0;
}

.site-title a {
    color: var(--color-text-main);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.site-description {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--spacing-lg);
}

.main-navigation a {
    color: var(--color-text-main);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.05rem;
}

.main-navigation a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   News Ticker
   ========================================================================== */
.news-ticker-wrapper {
    background-color: var(--color-ticker-bg);
    color: var(--color-ticker-text);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 40px;
}

.ticker-label {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: bold;
    padding: 0 var(--spacing-md);
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 2;
    position: relative;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticker-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 10px solid var(--color-primary);
}

.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.ticker-items {
    display: flex;
    position: absolute;
    white-space: nowrap;
    height: 100%;
    align-items: center;
    left: 100%; /* Start outside screen */
}

.ticker-item {
    padding: 0 var(--spacing-lg);
    font-size: 0.95rem;
}

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

.ticker-item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Main Layout & Loops
   ========================================================================== */
.site-content {
    padding: var(--spacing-xl) 0;
}

/* Tidy grid layout for main page without images */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.post-card {
    background: var(--color-bg-content);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border-dark); /* Newspaper-like top border */
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-top-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-top-color: var(--color-primary);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-category {
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-sm);
}

.post-title a {
    color: var(--color-text-main);
}

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

.post-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
    flex-grow: 1;
}

.read-more-link {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-primary);
    text-transform: uppercase;
    align-self: flex-start;
}

/* Featured post specific layout */
.post-featured {
    grid-column: 1 / -1; /* Spans full width */
    border-top: 4px solid var(--color-primary);
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    padding: var(--spacing-xl);
}

.post-featured .post-title {
    font-size: 2.2rem;
}

.post-featured .post-excerpt {
    font-size: 1.1rem;
    max-width: 800px;
    color: var(--color-text-main);
}

/* ==========================================================================
   Single Article
   ========================================================================== */
.single-article {
    background: var(--color-bg-content);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-border);
    margin: 0 auto;
    max-width: var(--article-max-width);
    box-shadow: var(--shadow-sm);
}

.article-header {
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--color-text-main);
    padding-bottom: var(--spacing-md);
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-main);
}

.article-meta {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    display: flex;
    gap: var(--spacing-md);
}

.article-content {
    font-size: 1.1rem; /* Slightly larger for easier reading */
}

/* Typography inside article */
.article-content p {
    margin-bottom: var(--spacing-md);
}

.article-content h2 {
    font-size: 1.8rem;
    border-left: 5px solid var(--color-primary);
    padding-left: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.article-content h3 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-lg);
}

.article-content ul, .article-content ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.article-content li {
    margin-bottom: var(--spacing-xs);
}

.article-content blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--color-bg-base);
    border-left: 4px solid var(--color-text-muted);
    font-style: italic;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Related Articles (To make users want to read more)
   ========================================================================== */
.related-articles {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.related-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #1a1e23; /* Deep professional dark gray */
    color: #e9ecef;
    padding: 0;
    margin-top: 5rem;
    font-size: 0.95rem;
}

.footer-widgets {
    display: grid;
    gap: 3rem;
    padding: 4rem 0;
}

@media (min-width: 768px) {
    .footer-widgets {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 4rem;
    }
}

.footer-widget-title {
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.8rem;
    font-weight: 700;
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.footer-widget.footer-about p {
    color: #adb5bd;
    line-height: 1.8;
}

.footer-widget li {
    margin-bottom: 0.8rem;
    list-style: none;
}

.footer-widget ul {
    padding: 0;
    margin: 0;
}

.footer-widget a {
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-widget a::before {
    content: '›';
    margin-right: 8px;
    color: var(--color-primary);
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.footer-widget a:hover {
    color: #ffffff;
}

.footer-widget a:hover::before {
    transform: translateX(3px);
}

.footer-bottom {
    background: #14171a; /* Darker than footer body */
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-info {
    text-align: center;
    font-size: 0.9rem;
    color: #8c98a4;
}
.footer-info a {
    color: #adb5bd;
    text-decoration: none;
}
.footer-info a:hover {
    color: #ffffff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm) var(--spacing-md);
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .single-article {
        padding: var(--spacing-md);
        border: none;
        border-top: 4px solid var(--color-primary);
        box-shadow: none;
    }
    
    .author-profile-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
}

/* ==========================================================================
   AI News Autopost Custom Design
   ========================================================================== */
.ainews-content-wrap {
    font-family: var(--font-primary);
    line-height: 1.8;
    color: var(--color-text);
}
.ainews-content-wrap h2 {
    font-size: 1.4em;
    background: #f7f9fa;
    border-left: 5px solid var(--color-primary);
    padding: 12px 15px;
    margin: 40px 0 20px;
    font-weight: bold;
    border-radius: 0 4px 4px 0;
}
.ainews-content-wrap h3 {
    font-size: 1.25em;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 8px;
    margin: 30px 0 15px;
}
.ainews-content-wrap ul {
    background: #fdfdfd;
    border: 1px solid var(--color-border);
    padding: 15px 15px 15px 35px;
    border-radius: 5px;
    margin: 0 0 20px 0;
}
.ainews-content-wrap ul li {
    margin-bottom: 8px;
}
.ainews-content-wrap strong {
    background: linear-gradient(transparent 60%, #fffacd 40%);
    font-weight: bold;
}

.ainews-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    list-style: none !important;
}
.ainews-tags-list li {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #495057;
}

/* ==========================================================================
   Pagination (Numbered)
   ========================================================================== */
.news-pagination {
    margin: 4rem 0;
    width: 100%;
}

.news-pagination .screen-reader-text {
    display: none;
}

.news-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.news-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.news-pagination .page-numbers:hover {
    background: var(--color-bg-base);
    color: var(--color-primary);
    border-color: var(--color-border-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.news-pagination .page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

.news-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    min-width: 20px;
    box-shadow: none;
    padding: 0;
}

/* ==========================================================================
   Static Pages (About, Contact, Privacy, etc.)
   ========================================================================== */
.page-content-wrap {
    font-size: 1.05rem;
    color: var(--color-text-main, #333);
}

.page-content-wrap h2 {
    font-size: 1.5rem;
    color: var(--color-text-main);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.page-content-wrap h3 {
    font-size: 1.25rem;
    color: var(--color-text-main);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-primary);
    padding-left: 0.8rem;
}

.page-content-wrap p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.page-content-wrap ul {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.page-content-wrap li {
    margin-bottom: 0.5rem;
}
