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

:root {
    /* Color Palette */
    --primary: #03133d;
    /* Indigo 600 */
    --primary-hover: #696872;
    --secondary: #10b981;
    /* Emerald 500 */
    --accent: #948c7f;
    /* Amber 500 */

    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */

    /* Layout */
    --container-width: 1200px;
    --content-width: 720px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Transitions */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Layout Components */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Styles */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-list a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-excerpt {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

/* Trending Ticker */
.trending-ticker-container {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 48px;
    box-shadow: var(--shadow-sm);
}

.trending-label {
    background: var(--text-main);
    color: white;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.ticker-dot {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    margin-right: 0.75rem;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

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

.ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: scrollTicker 30s linear infinite;
    padding-left: 1rem;
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-item {
    padding: 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.ticker-item::after {
    content: '•';
    margin-left: 2rem;
    color: var(--border);
}

.ticker-item:hover {
    color: var(--primary);
}

@keyframes scrollTicker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .trending-ticker-container {
        margin-top: 0 !important;
    }

    .trending-label {
        padding: 0 1rem;
        font-size: 0.75rem;
    }
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.post-image-link {
    display: block;
    overflow: hidden;
}

.post-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

/* Blog Feed */
.blog-feed {
    padding: 1rem 0;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.post-category {
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.post-title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.post-card:hover .post-title {
    color: var(--primary);
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
}

/* Featured Focus Grid Scroll */
.focus-grid-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    padding-right: 1.5rem;
    scrollbar-width: none;
    /* Hide for Firefox */
    -ms-overflow-style: none;
    /* Hide for MS */
    -webkit-overflow-scrolling: touch;
}

.focus-grid-scroll::-webkit-scrollbar {
    display: none;
    /* Hide for Chrome/Safari */
}

.focus-card {
    flex: 0 0 350px;
    /* Fixed width for scrolling cards */
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    display: block;
}

.focus-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.focus-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 50%, transparent 100%);
    padding: 1.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    transition: background 0.3s ease;
}

.focus-card:hover img {
    transform: scale(1.1);
}

.focus-card:hover .focus-overlay {
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.6) 50%, transparent 100%);
}

.focus-overlay h3 {
    color: white;
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.spotlight-badge {
    position: relative;
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    font-size: 0.7rem !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 100px;
    white-space: nowrap;
    z-index: 3;
}

/* Article View Styles */
.article-container {
    max-width: var(--content-width);
    margin: 4rem auto;
    padding-bottom: 6rem;
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.article-category {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.article-title {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.article-featured-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.article-content {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #334155;
    font-family: 'Inter', sans-serif;
}

.article-content p {
    margin-bottom: 2.5rem;
}

.article-content strong {
    color: var(--text-main);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .top-nav {
        height: auto;
        padding: 1rem 0;
    }

    .top-nav .container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-list {
        display: flex;
        gap: 1.25rem;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-list a {
        font-size: 0.85rem;
    }

    .login-btn {
        padding: 0.4rem 1rem !important;
    }

    .article-title {
        font-size: 2rem;
    }
}

/* MSN Style News Grid */
.news-grid-msn {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 5rem;
}

.msn-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.msn-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.msn-card-image {
    width: 100%;
    object-fit: cover;
}

/* Featured Card (Horizontal span 2 columns) */
.msn-card-featured {
    grid-column: span 2;
    grid-row: span 1;
    position: relative;
    min-height: 280px;
}

.msn-card-featured .msn-card-image {
    height: 100%;
    aspect-ratio: 21/9;
}

.msn-card-featured .msn-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    padding: 2rem;
}

.msn-card-featured h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.2;
}

/* Vertical Card */
.msn-card-vertical .msn-card-image {
    aspect-ratio: 16/9;
}

.msn-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.msn-card-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msn-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.msn-card-footer .source-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #f1f5f9;
}

/* Headline List Card */
.msn-card-headlines {
    padding: 1.25rem;
}

.msn-headline-item {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.msn-headline-item:hover {
    color: var(--primary);
}

.msn-headline-item:last-child {
    border-bottom: none;
}

/* Weather Widget */
.msn-widget-weather {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.msn-weather-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.msn-weather-temp {
    font-size: 3rem;
    font-weight: 700;
}

/* Market Widget */
.msn-widget-markets {
    padding: 1.25rem;
}

.msn-market-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
}

.msn-market-item:last-child {
    border-bottom: none;
}

.market-up {
    color: #10b981;
    font-weight: 600;
}

.market-down {
    color: #ef4444;
    font-weight: 600;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .news-grid-msn {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .news-grid-msn {
        grid-template-columns: 1fr;
    }

    .msn-card-featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .msn-card-featured .msn-card-image {
        min-height: 250px;
    }
}

/* Article Modal Styles */
.article-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.article-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-modal-overlay.active .article-modal-content {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.1);
    color: var(--text-main);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(15, 23, 42, 0.2);
    transform: rotate(90deg);
}

.modal-hero-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.modal-body-content {
    padding: 3rem;
}

.modal-article-header h1 {
    font-size: 2.5rem;
    margin: 1.5rem 0;
    line-height: 1.1;
}

.article-text-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
}

.article-text-content p {
    margin-bottom: 2rem;
}

.modal-article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.modal-action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.modal-action-btn:hover {
    background: #f8fafc;
}

@media (max-width: 768px) {
    .article-modal-overlay {
        padding: 1rem;
    }
    .modal-body-content {
        padding: 1.5rem;
    }
    .modal-article-header h1 {
        font-size: 1.75rem;
    }
    .modal-hero-image {
        height: 250px;
    }
}