/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Playfair+Display:wght@700&display=swap');

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    color: #333;
    background-color: #f7f7f7;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

/* Hero Sections (Parallax) */
.hero-section,
.article-hero,
.articles-hero {
    position: relative;
    height: 550px; /* Larger hero for desktop */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    will-change: background-position;
    transition: background-position 0.2s ease-out;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}

.hero-text {
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-text p {
    font-size: 1.1rem;
}

/* Articles Grid */
.articles-page,
.single-article {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.article-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}
.article-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.article-info {
    padding: 1rem;
}
.article-info h2 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
}
.article-date {
    font-size: 0.9rem;
    color: #777;
}

/* "Read More" Button - Dark Gray (for article cards) */
.read-more,
.article-card .read-more {
    display: inline-block;
    background: #444;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 2px solid #222;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.read-more:hover,
.article-card .read-more:hover {
    background: #000;
    color: #fff;
}

/* Single Article */
.single-article {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.article-body {
    padding: 2rem;
    line-height: 1.7;
    font-size: 1.05rem;
}
.article-body img,
.article-body video {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Related Articles */
.related-articles {
    padding: 2rem;
}
.related-articles h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.related-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.related-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.related-item h3 {
    font-size: 1rem;
    padding: 0.5rem;
    margin: 0;
}
.related-item a {
    text-decoration: none;
    color: inherit;
}

/* Responsive Hero */
@media (max-width: 1024px) {
    .hero-section,
    .article-hero,
    .articles-hero {
        height: 450px;
    }
}
@media (max-width: 768px) {
    .hero-section,
    .article-hero,
    .articles-hero {
        height: 350px;
        background-attachment: scroll;
    }
    .hero-text h1 {
        font-size: 1.8rem;
    }
}

/* Top Story Hero */
.top-story {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    color: #fff;
}
.top-story-content {
    max-width: 600px;
    z-index: 2;
    position: relative;
}
.top-story-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.top-story-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
}
.top-story-content .read-more {
    display: inline-block;
    background: #39ff14;
    color: #111;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 2px solid #000;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.top-story-content .read-more:hover {
    background: #28cc0a;
    color: #fff;
}

/* Latest Articles */
.latest-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.latest-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.news-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.news-card a {
    color: inherit;
    text-decoration: none;
    display: block;
}
.news-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.news-info {
    padding: 1rem;
}
.news-info h3 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}
.news-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}
.news-snippet {
    font-size: 0.95rem;
    color: #333;
}
@media (max-width: 768px) {
    .top-story {
        height: 250px;
        background-attachment: scroll;
    }
    .top-story-content h1 {
        font-size: 1.8rem;
    }
}

/* Layout for homepage and single article */
.content-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.sidebar .widget {
    background: #fff;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.sidebar h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.trending-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.trending-list li:last-child {
    border-bottom: none;
}
.trending-list a {
    text-decoration: none;
    color: #333;
    font-size: 1rem;
}
.trending-list a:hover {
    color: #0073e6;
}

/* Responsive Layout */
@media (max-width: 900px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        margin-top: 2rem;
    }
}

/* Articles Index (Wall Street Journal Style) */
.articles-index {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.wsj-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wsj-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #e6e6e6;
}
.wsj-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.wsj-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin: 0 0 .35rem;
}
.wsj-title a {
    color: #111;
    text-decoration: none;
}
.wsj-title a:hover {
    text-decoration: underline;
}
.wsj-meta {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    gap: 1rem;
    margin-bottom: .5rem;
    align-items: center;
}
.wsj-views svg {
    margin-right: .25rem;
}
.wsj-snippet {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}
.load-more-wrap {
    text-align: center;
    margin: 2rem 0 3rem;
}
.loadMoreBtn,
#loadMoreBtn {
    padding: 0.6rem 1.2rem;
    background: #111;
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}
#loadMoreBtn[disabled] {
    opacity: .6;
    cursor: wait;
}

/* Back to top button */
#backToTop {
    display: none;
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 99;
    font-size: 20px;
    background-color: #111;
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}
#backToTop:hover {
    background-color: #333;
}

/* Responsive WSJ List */
@media (max-width: 768px) {
    .wsj-item {
        grid-template-columns: 1fr;
    }
    .wsj-thumb img {
        height: 200px;
    }
}

/* Fullscreen Home Hero with Smooth Parallax + Fade-In */
.home-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.home-hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    will-change: transform;
    transition: transform 0.2s ease-out;
}
.home-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.5s ease;
    pointer-events: none;
}
.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}
.home-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    text-align: center;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards;
}
.home-hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0 0 1rem;
}
.home-hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    color: rgba(255,255,255,0.9);
}
.home-hero-content .read-more {
    background: #39ff14;
    color: #111;
    border: 2px solid #000;
}
.home-hero-content .read-more:hover {
    background: #28cc0a;
    color: #fff;
}
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .home-hero {
        height: 100vh;
    }
    .home-hero-content h1 {
        font-size: 2rem;
    }
}

/* Fade-in Animation for Cards */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tablet-Specific Styles (iPads and similar devices) */
@media (min-width: 768px) and (max-width: 1024px) {
    .articles-grid,
    .news-grid,
    .related-grid {
        gap: 1rem;
    }

    .article-info h2,
    .news-info h3,
    .related-item h3 {
        font-size: 1.1rem;
    }

    .article-body {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .content-layout {
        grid-template-columns: 2fr 1fr;
        gap: 1.25rem;
    }

    .top-story-content h1 {
        font-size: 2.2rem;
    }

    .hero-section,
    .article-hero,
    .articles-hero {
        height: 400px;
        background-attachment: scroll;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .home-hero-content h1 {
        font-size: 2.5rem;
    }

    .home-hero-content p {
        font-size: 1.05rem;
    }

    .wsj-item {
        grid-template-columns: 180px 1fr;
        gap: 1rem;
    }

    .wsj-thumb img {
        height: 120px;
    }
}