/* =========================================
   NEWSWIRE - MOBILE-FIRST RESPONSIVE v3.0
   Optimized for ALL Devices
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@400;700;900&display=swap');

:root {
    /* Color Palette */
    --primary-dark: #0a1120;
    --primary-main: #1e293b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #0f172a;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;

    --font-heading: 'Merriweather', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --container-width: 1440px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Prevent font scaling in landscape */
    -ms-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-sans);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   HEADER
   ========================================= */
header {
    background: var(--bg-header);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--accent-red);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
}

.brand span {
    color: var(--accent-red);
}

.date-display {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* =========================================
   LAYOUT - MOBILE FIRST
   ========================================= */
.main-container {
    display: block;
    /* Mobile first: stacked */
    width: 100%;
    max-width: var(--container-width);
    margin: 1rem auto;
    padding: 0 0.75rem;
}

/* =========================================
   SIDEBAR - Hidden on mobile by default
   ========================================= */
.left-column,
.right-column {
    display: none;
    /* Hidden on mobile */
}

/* =========================================
   CENTER COLUMN - Full width on mobile
   ========================================= */
.center-column {
    width: 100%;
}

/* Featured Section */
.featured-section {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent-red);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Featured Items - Mobile First Styling */
.featured-item {
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.featured-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.featured-img-wrapper {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    /* Full width on mobile */
    height: 180px;
    flex-shrink: 0;
}

.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.featured-item:hover .featured-img {
    transform: scale(1.03);
}

.featured-content {
    display: flex;
    flex-direction: column;
}

.source-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 0.4rem;
    letter-spacing: 0.8px;
}

.featured-link {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    /* Smaller on mobile */
    line-height: 1.3;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.featured-item:hover .featured-link {
    color: var(--accent-blue);
}

.featured-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Headline Cards */
.headline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.headline-item {
    background: white;
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.headline-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.headline-link-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.headline-thumb {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.headline-item:hover .headline-thumb {
    transform: scale(1.05);
    transition: transform var(--transition-fast);
}

.headline-text {
    flex: 1;
    min-width: 0;
    /* Fix text overflow */
}

.headline-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    /* Readable on mobile */
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-main);
}

.headline-item:hover .headline-title {
    color: var(--accent-blue);
}

.source-inline {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 4px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--bg-header);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

footer p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* =========================================
   TABLET (600px+)
   ========================================= */
@media (min-width: 600px) {
    .header-inner {
        padding: 0 1.5rem;
    }

    .brand {
        font-size: 1.8rem;
    }

    .date-display {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .main-container {
        padding: 0 1.5rem;
        margin: 1.5rem auto;
    }

    .featured-section {
        padding: 1.5rem;
    }

    .featured-item {
        flex-direction: row;
        /* Side by side on tablets */
        gap: 1.25rem;
    }

    .featured-img-wrapper {
        width: 220px;
        height: 150px;
    }

    .featured-link {
        font-size: 1.3rem;
    }

    .featured-desc {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .headline-thumb {
        width: 90px;
        height: 65px;
    }

    .headline-title {
        font-size: 1.05rem;
    }
}

/* =========================================
   TABLET LANDSCAPE (900px+)
   ========================================= */
@media (min-width: 900px) {
    .brand {
        font-size: 2rem;
    }

    .main-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 2rem;
    }

    .featured-section {
        padding: 2rem;
    }

    .headline-item {
        padding: 1rem;
    }
}

/* =========================================
   DESKTOP (1200px+) - Show Sidebars
   ========================================= */
@media (min-width: 1200px) {
    .header-inner {
        padding: 0 2rem;
    }

    .brand {
        font-size: 2.2rem;
    }

    .date-display {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .main-container {
        display: grid;
        grid-template-columns: 240px 1fr 320px;
        gap: 2.5rem;
    }

    /* Show sidebars on desktop */
    .left-column,
    .right-column {
        display: block;
    }

    .left-column {
        background: var(--bg-sidebar);
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: var(--shadow-sm);
        height: fit-content;
        border: 1px solid var(--border-light);
        position: sticky;
        top: 5rem;
    }

    .source-list {
        list-style: none;
    }

    .source-list li a {
        display: flex;
        align-items: center;
        padding: 0.7rem 0.8rem;
        margin-bottom: 4px;
        border-radius: 8px;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-main);
        border-left: 3px solid transparent;
        transition: all var(--transition-fast);
    }

    .source-list li a:hover {
        background: #f8fafc;
        color: var(--accent-blue);
        border-left-color: var(--accent-blue);
        padding-left: 1.2rem;
        box-shadow: var(--shadow-sm);
    }

    /* Desktop featured sizing */
    .featured-img-wrapper {
        width: 200px;
        height: 140px;
    }

    .featured-link {
        font-size: 1.25rem;
    }

    .headline-thumb {
        width: 110px;
        height: 80px;
    }

    .headline-title {
        font-size: 1.15rem;
    }

    /* Right column styling */
    .right-column .headline-item {
        border-left: 4px solid transparent;
    }

    .right-column .headline-item:hover {
        border-left-color: var(--accent-red);
    }

    .right-column .headline-title {
        font-size: 1rem;
    }

    .right-column .headline-thumb {
        width: 80px;
        height: 60px;
    }
}