/*
Theme Name: TechNews Editorial
Theme URI: https://trustpost.org
Author: TrustPost
Author URI: https://trustpost.org
Description: A premium, stark-white editorial tech news theme inspired by Samsung Newsroom and Apple News.
Version: 1.0.0
Text Domain: technews
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Variables - Samsung/Apple News Clean Editorial */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --heading-color: #000000;
    --accent-color: #1428A0; /* Samsung Corporate Blue */
    --accent-hover: #0a1450;
    --border-color: #e5e5e5;
    --bg-light: #f5f5f7; /* Apple gray background for sections */
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1440px;
    --content-width: 760px;
    --transition: all 0.2s ease-in-out;
}

*, *::before, *::after { box-sizing: border-box; }

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 800; margin-top: 0;
    color: var(--heading-color); letter-spacing: -0.02em;
    line-height: 1.2;
}

a { color: var(--accent-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; border-radius: 4px; }

/* Structural */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 5%;
}
@media (min-width: 1200px) { .container { padding: 0 40px; } }

/* Utility Header (Top Black Bar like Corporate Sites) */
.utility-bar {
    background: #000000; color: #ffffff; padding: 6px 0; font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; display: flex; justify-content: space-between; align-items: center;
}
.utility-bar a { color: #aaaaaa; text-decoration: none; margin-left: 15px; }
.utility-bar a:hover { color: #ffffff; }

/* Main Header */
.site-header {
    background: #ffffff;
    border-bottom: 2px solid #000000;
    padding: 1.5rem 0;
    position: sticky; top: 0; z-index: 1000;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.site-title { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; text-transform: uppercase; }
.site-title a { color: var(--heading-color); text-decoration: none; }
.site-title a:hover { color: var(--accent-color); text-decoration: none; }

.main-navigation ul {
    list-style: none; padding: 0; margin: 0; display: flex; gap: 2rem;
    font-weight: 700; font-size: 0.95rem; text-transform: uppercase;
}
.main-navigation a { color: var(--heading-color); text-decoration: none; padding-bottom: 5px; }
.main-navigation a:hover { color: var(--accent-color); border-bottom: 2px solid var(--accent-color); }

/* Mobile Menu */
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--heading-color); }

@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .main-navigation { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #ffffff; border-bottom: 1px solid var(--border-color); padding: 1rem 5%; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
    .site-navigation.toggled .main-navigation { display: block; }
    .main-navigation ul { flex-direction: column; gap: 1rem; }
    .main-navigation a:hover { border-bottom: none; }
}

/* Homepage "Top Story" Grid (Samsung News style) */
.top-stories-section { padding: 4rem 0; background: var(--bg-color); }
.top-stories-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}
@media (max-width: 992px) { .top-stories-grid { grid-template-columns: 1fr; } }
.featured-story { position: relative; display: flex; flex-direction: column; }
.featured-story img { width: 100%; height: 500px; object-fit: cover; border-radius: 8px; }
@media (max-width: 768px) { .featured-story img { height: 300px; } }
.featured-content { padding-top: 1.5rem; }
.category-label {
    display: inline-block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--accent-color); margin-bottom: 0.5rem; letter-spacing: 0.05em;
}
.featured-title { font-size: 3rem; margin-bottom: 1rem; line-height: 1.1; }
.featured-title a { color: var(--heading-color); text-decoration: none; }
.featured-title a:hover { color: var(--accent-color); text-decoration: none; }
.featured-excerpt { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Side Stories (Compact River) */
.side-stories { display: flex; flex-direction: column; gap: 2rem; }
.story-card-compact { display: grid; grid-template-columns: 120px 1fr; gap: 1.2rem; align-items: start; }
.story-card-compact img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
.story-card-compact .card-body { display: flex; flex-direction: column; }
.story-card-compact h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.story-card-compact a { color: var(--heading-color); text-decoration: none; }
.story-card-compact a:hover { color: var(--accent-color); }
.meta-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

@media (max-width: 500px) {
    .story-card-compact { grid-template-columns: 1fr; }
    .story-card-compact img { width: 100%; height: auto; aspect-ratio: 16/9; }
}

/* Latest News Grid */
.latest-news-section { background: var(--bg-light); padding: 5rem 0; border-top: 1px solid var(--border-color); }
.section-heading { font-size: 2rem; margin-bottom: 2.5rem; border-bottom: 2px solid var(--heading-color); padding-bottom: 0.5rem; display: inline-block; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 3rem 2rem; }
.news-card { display: flex; flex-direction: column; }
.news-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; margin-bottom: 1rem; border-radius: 8px; transition: transform 0.3s ease; }
.news-card-img-wrap { overflow: hidden; border-radius: 8px; margin-bottom: 1.2rem; display: block; }
.news-card:hover img { transform: scale(1.05); }
.news-card h3 { font-size: 1.4rem; margin-bottom: 0.8rem; }
.news-card h3 a { color: var(--heading-color); text-decoration: none; }
.news-card h3 a:hover { color: var(--accent-color); text-decoration: none; }
.news-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Buttons */
.btn-primary {
    display: inline-block; background: #000000; color: #ffffff; padding: 12px 30px; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 4px; border: none; cursor: pointer; text-align: center; transition: background 0.2s; text-decoration: none !important;
}
.btn-primary:hover { background: var(--accent-color); color: #ffffff; }

.load-more-wrap { text-align: center; margin-top: 4rem; }

/* Single Post (Editorial Focus) */
.single-header { max-width: 900px; margin: 4rem auto 2rem; text-align: center; padding: 0 20px; }
.single-title { font-size: 3.5rem; margin-bottom: 1.5rem; line-height: 1.1; }
@media (max-width: 768px) { .single-title { font-size: 2.2rem; } }
.single-meta { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.single-meta img { width: 40px; height: 40px; border-radius: 50%; }
.single-meta strong { color: var(--heading-color); }

.single-hero-img { margin: 0 auto 3rem; max-width: 1200px; text-align: center; }
.single-hero-img img { width: 100%; border-radius: 12px; }

/* Table of Contents Layout */
.single-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}
@media (min-width: 1024px) {
    .single-layout {
        grid-template-columns: 280px 1fr;
        gap: 5rem;
    }
}

.toc-sidebar {
    display: none;
}
@media (min-width: 1024px) {
    .toc-sidebar {
        display: block;
    }
}

.toc-sticky-nav {
    position: sticky;
    top: 100px;
    padding-right: 20px;
}
.toc-sticky-nav h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li {
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}
.toc-list li:last-child {
    border-bottom: none;
}
.toc-list a {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    transition: var(--transition);
}
.toc-list a:hover {
    color: var(--accent-color);
    transform: translateX(3px);
}

.single-content {
    max-width: var(--content-width);
    margin: 0 0 5rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222222;
    padding: 0 20px;
}
.single-content h2 { margin-top: 3rem; margin-bottom: 1rem; font-size: 2rem; }
.single-content h3 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1.5rem; }
.single-content p { margin-bottom: 1.5rem; }
.single-content a { border-bottom: 1px solid var(--accent-color); padding-bottom: 1px; font-weight: 500; }
.single-content a:hover { background: rgba(20,40,160,0.1); text-decoration: none; }

/* Related Posts block */
.related-posts { background: var(--bg-light); padding: 4rem 0; border-top: 1px solid var(--border-color); }

/* Footer */
.site-footer { background: #000000; color: #ffffff; padding: 4rem 0 2rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { font-size: 1.8rem; font-weight: 900; margin: 0 0 1rem; text-transform: uppercase; color: #ffffff; }
.footer-about { color: #aaaaaa; max-width: 400px; line-height: 1.6; }
.footer-widget-title { color: #ffffff; font-size: 1.1rem; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #333; padding-bottom: 10px; display: inline-block;}
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links a { color: #aaaaaa; text-decoration: none; }
.footer-links a:hover { color: #ffffff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid #333333; padding-top: 2rem; display: flex; justify-content: space-between; color: #777777; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;}

/* Spinner for AJAX Load */
.spinner { margin: 0 auto; width: 70px; text-align: center; display: flex; justify-content: center; gap: 8px; }
.spinner > div { width: 14px; height: 14px; background-color: #000; border-radius: 100%; display: inline-block; animation: sk-bouncedelay 1.4s infinite ease-in-out both; }
.spinner .bounce1 { animation-delay: -0.32s; }
.spinner .bounce2 { animation-delay: -0.16s; }
@keyframes sk-bouncedelay { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
