/*
Theme Name: TrustPost v3 - The Editorial Masterpiece
Theme URI: https://trustpost.org
Author: Antigravity
Author URI: https://trustpost.org
Description: A high-authority, ultra-clean editorial theme modeled after Bloomberg, NYT, and The Atlantic. Focus on absolute typographic perfection and high-contrast clarity.
Version: 3.0.0
Text Domain: technews
*/

/* 
================================================================
TABLE OF CONTENTS
================================================================
1. Design Tokens & Root
2. Global Resets
3. Typography Engine
4. Header & Navigation
5. Homepage: The Lede & River
6. Homepage: Multi-Story Grid
7. Single Post: The Reading Room
8. Single Post: Editorial UI (TOC, Author)
9. Footer: The Authority Sitemap
10. Utilities & Loading
================================================================
*/

:root {
    /* Colors - Pure & Authoritative */
    --bg: #ffffff;
    --fg: #111111;
    --fg-muted: #555555;
    --fg-light: #888888;
    --accent: #0059FF; /* Bloomberg Blue */
    --border: #eeeeee;
    --border-dark: #111111;
    
    /* Typography - The Master Pairing */
    --font-serif: "Source Serif 4", "Georgia", serif;
    --font-heading: var(--font-serif);
    --font-body: var(--font-serif);
    --font-ui: "Inter", -apple-system, system-ui, sans-serif;
    
    /* Layout Spacing */
    --max-width: 1320px;
    --content-width: 720px;
    --section-gap: 120px;
    --item-gap: 40px;
    
    /* Transitions */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.4s var(--ease);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,900;1,8..60,400&display=swap');

/* --- 2. Global Resets --- */
*, *::before, *::after { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    color: var(--fg);
    line-height: 1.625;
    background: var(--bg);
    overflow-x: hidden;
}

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

@media (max-width: 768px) {
    .container { padding: 0 20px; }
}

/* --- 3. Typography Engine --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--fg);
    line-height: 1.05;
    margin: 0;
    font-weight: 900;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.05em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.04em; }
h3 { font-size: 1.6rem; letter-spacing: -0.03em; }

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

/* --- 4. Header & Navigation --- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 2.5rem 0;
    transition: var(--transition);
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.08em;
    text-transform: uppercase;
}

.main-navigation ul {
    list-style: none; padding: 0; margin: 0;
    display: flex; gap: 2.5rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 1024px) {
    .header-inner { flex-direction: row; justify-content: space-between; }
    .header-actions { position: static; transform: none; }
    .main-navigation { display: none; }
}

/* --- 5. Homepage: The Lede & River --- */
.top-stories-section { padding-top: var(--section-gap); padding-bottom: calc(var(--section-gap) / 2); }

.top-stories-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 80px;
}

.featured-story .hero-image-wrap {
    display: block;
    margin-bottom: 2.5rem;
    overflow: hidden;
}

.featured-story img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    filter: grayscale(1);
    transition: var(--transition);
}

.featured-story:hover img { filter: grayscale(0); transform: scale(1.02); }

.category-label {
    display: block;
    color: var(--accent);
    font-size: 0.75rem;
    font-family: var(--font-ui);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.featured-title { margin-bottom: 1.5rem; }
.featured-excerpt { font-size: 1.25rem; color: var(--fg-muted); margin-bottom: 2rem; max-width: 90%; }
.meta-date { font-family: var(--font-ui); font-size: 0.75rem; color: var(--fg-light); font-weight: 500; text-transform: uppercase; }

/* The River (Sidebar) */
.side-stories { display: flex; flex-direction: column; gap: 40px; }
.story-card-compact { display: flex; flex-direction: column; gap: 15px; border-bottom: 1px solid var(--border); padding-bottom: 40px; }
.story-card-compact:last-child { border-bottom: none; }
.story-card-compact h3 { font-size: 1.2rem; line-height: 1.2; }

@media (max-width: 1024px) {
    .top-stories-grid { grid-template-columns: 1fr; gap: 60px; }
}

/* --- 6. Homepage: Multi-Story Grid --- */
.category-block-section { padding: var(--section-gap) 0; }
.v2-section-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--border-dark); padding-bottom: 15px; margin-bottom: 40px; }
.v2-heading { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.2em; font-family: var(--font-ui); }
.v2-view-all { font-family: var(--font-ui); font-size: 0.75rem; font-weight: 700; color: var(--fg-light); }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; }
.news-card { display: flex; flex-direction: column; gap: 20px; }
.news-card-img-wrap img { aspect-ratio: 4/3; object-fit: cover; }
.news-card h3 { font-size: 1.4rem; line-height: 1.2; }

@media (max-width: 900px) {
    .news-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* --- 7. Single Post: The Reading Room --- */
.single-header { padding: 80px 0 40px; }
.single-title { font-size: clamp(2.5rem, 8vw, 5rem); line-height: 1; margin-bottom: 40px; }
.single-meta { display: flex; align-items: center; gap: 20px; font-family: var(--font-ui); font-size: 0.8rem; border-top: 1px solid var(--border); padding-top: 20px; }
.meta-author-img img { border-radius: 50%; filter: grayscale(1); }

.v2-hero-wrap { margin-bottom: 80px; }
.single-hero-img img { width: 100%; max-height: 80vh; object-fit: cover; }

.single-content {
    max-width: var(--content-width);
    margin: 0 auto 100px;
    font-size: 1.375rem;
    line-height: 1.65;
}

.single-content p { margin-bottom: 2.5rem; }
.single-content h2 { margin-top: 100px; margin-bottom: 40px; font-size: 2.4rem; }

/* Editorial Elements */
.single-content p:first-of-type::first-letter {
    float: left;
    font-size: 5rem;
    line-height: 0.85;
    padding-top: 4px;
    padding-right: 12px;
    font-weight: 900;
}

/* --- 8. Single Post: Editorial UI --- */
.v2-floating-toc {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%) translateX(200%);
    width: 240px;
    background: var(--bg);
    border: 1px solid var(--fg);
    padding: 20px;
    transition: transform 0.6s var(--ease);
    z-index: 100;
}

.v2-floating-toc.visible { transform: translateY(-50%) translateX(0); }

.v2-toc-list { list-style: none; padding: 0; margin: 20px 0 0; }
.v2-toc-list li { margin-bottom: 12px; font-size: 0.75rem; font-family: var(--font-ui); font-weight: 700; text-transform: uppercase; }

.author-bio-box-v2 {
    border: 1px solid var(--fg);
    padding: 60px;
    margin-top: 100px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 40px;
}

@media (max-width: 600px) { .author-bio-box-v2 { grid-template-columns: 1fr; text-align: center; padding: 40px 20px; } }

/* --- 9. Footer: The Authority Sitemap --- */
.site-footer {
    background: #000;
    color: #fff;
    padding: 120px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    border-bottom: 1px solid #333;
    padding-bottom: 80px;
    margin-bottom: 40px;
}

.v2-footer-logo { font-size: 2.5rem; letter-spacing: -0.1em; margin-bottom: 2rem; }
.footer-about { opacity: 0.6; font-size: 0.9rem; max-width: 320px; }

.footer-widget-title { color: #fff; font-family: var(--font-ui); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { opacity: 0.6; font-size: 0.9rem; }
.footer-links a:hover { opacity: 1; }

.footer-bottom { display: flex; justify-content: space-between; font-size: 0.7rem; opacity: 0.4; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 0.1em; }

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* --- 10. Utilities --- */
#search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: var(--transition);
}

#search-overlay.open { opacity: 1; pointer-events: all; }

.search-input-full {
    background: none; border: none;
    border-bottom: 2px solid var(--fg);
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 4rem);
    width: 80vw;
    text-align: center;
    outline: none;
}
