/*
Theme Name: Modern News
Theme URI: https://example.com/modern-news
Author: Antigravity
Author URI: https://example.com
Description: A premium, modern, and responsive news theme for WordPress.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modern-news
*/

/* =========================================
   1. Design System & Variables
   ========================================= */
:root {
    /* Colors - Premium Palette */
    --color-bg: #f4f6f8;
    --color-surface: #ffffff;
    --color-text-main: #111827;
    /* Darker, sharper text */
    --color-text-muted: #6b7280;
    --color-primary: #2563eb;
    /* Royal Blue */
    --color-primary-dark: #1d4ed8;
    --color-accent: #dc2626;
    /* News Red */
    --color-border: #e5e7eb;
    --color-overlay: rgba(0, 0, 0, 0.6);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;

    /* Shadows - Soft & Modern */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-surface: #1e293b;
        --color-text-main: #f3f4f6;
        --color-text-muted: #9ca3af;
        --color-primary: #60a5fa;
        --color-primary-dark: #3b82f6;
        --color-border: #334155;
        --color-overlay: rgba(0, 0, 0, 0.7);
    }
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-main);
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   3. Layout Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: 1280px;
    /* Wider container */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 2.5fr 1fr;
        /* Main content wider */
    }
}

/* =========================================
   4. Header
   ========================================= */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.site-title a {
    color: var(--color-text-main);
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.main-navigation a {
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

/* =========================================
   5. Hero Section (New)
   ========================================= */
.hero-section {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.hero-content {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16/9;
}

@media (min-width: 768px) {
    .hero-content {
        aspect-ratio: 21/9;
        /* Cinematic wide on desktop */
    }
}

.hero-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-content:hover .hero-image img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
}

.hero-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-lg);
    color: white;
    z-index: 10;
}

.hero-cat {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.hero-cat a {
    color: white;
}

.hero-title {
    font-size: 1.75rem;
    color: white;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        width: 80%;
    }
}

.hero-title a {
    color: white;
}

.hero-meta {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.hero-excerpt {
    display: none;
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

@media (min-width: 768px) {
    .hero-excerpt {
        display: block;
    }
}

.btn-primary {
    display: inline-block;
    background: white;
    color: var(--color-text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* =========================================
   6. Posts Grid
   ========================================= */
.section-header {
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--spacing-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 1.5rem;
    margin: 0;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    /* Match padding + border width */
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 640px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.post-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary-dark);
}

.post-thumbnail {
    position: relative;
    padding-top: 60%;
    /* Aspect ratio */
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-cat {
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.post-cat a {
    color: inherit;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.post-title a {
    color: var(--color-text-main);
    background-image: linear-gradient(var(--color-text-main), var(--color-text-main));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size .3s;
}

.post-card:hover .post-title a {
    color: var(--color-primary);
    background-size: 100% 2px;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: auto;
    /* Push to bottom if needed, or just flow */
}

/* =========================================
   7. Sidebar & Widgets
   ========================================= */
.widget {
    background: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.widget-title {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px dashed var(--color-border);
}

.widget li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget a {
    color: var(--color-text-main);
    font-weight: 500;
}

.widget a:hover {
    color: var(--color-primary);
}

/* =========================================
   8. Footer
   ========================================= */
.site-footer {
    background: #111827;
    /* Dark footer */
    color: #9ca3af;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.site-footer a {
    color: #e5e7eb;
}

.site-footer a:hover {
    color: white;
}