/* ========================================
   ScreenRant Template - Main Stylesheet
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1d4ed8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

/* ========================================
   Header
   ======================================== */
.header {
    background-color: #1a1a1a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo a:hover {
    color: #f59e0b;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    color: #e5e5e5;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: #f59e0b;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #f59e0b;
    transition: width 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* ========================================
   Hero Section (Featured Content)
   ======================================== */
.hero-section {
    padding: 2rem 0;
    background-color: #fff;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.hero-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
}

.hero-main-link {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    color: #fff;
}

.hero-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.hero-main-link:hover .hero-main-img {
    opacity: 0.5;
}

.hero-main-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.hero-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.hero-excerpt {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.hero-latest {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.hero-latest-item {
    flex: 1;
    border-bottom: 1px solid #e5e5e5;
    padding: 0.75rem 0;
}

.hero-latest-item:first-child {
    padding-top: 0;
}

.hero-latest-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Show only first 3 items in hero */
.hero-latest-item:nth-child(n+4) {
    display: none;
}

.hero-latest-link {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.75rem;
    align-items: start;
    color: #333;
    height: 100%;
}

.hero-latest-link:hover {
    color: #333;
}

.hero-latest-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.hero-latest-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hero-latest-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-latest-link:hover .hero-latest-title {
    color: #f59e0b;
}

.hero-latest-meta {
    font-size: 0.75rem;
    color: #999;
}

/* ========================================
   Featured Picks Section
   ======================================== */
.featured-section {
    padding: 2rem 0;
    background-color: #fff;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.featured-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    min-height: 220px;
    transition: transform 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-3px);
}

.featured-card a {
    display: block;
    color: #fff;
    height: 100%;
}

.featured-card-img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.featured-card:hover .featured-card-img {
    opacity: 0.5;
}

.featured-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.featured-card-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0;
}

.hero-category,
.article-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.hero-meta,
.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ========================================
   Main Content Area
   ======================================== */
.main {
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.content-main {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #f59e0b;
}

/* ========================================
   Articles
   ======================================== */
.articles-list {
    display: grid;
    gap: 2rem;
}

.article-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
    transition: transform 0.3s ease;
}

.article-card:last-child {
    border-bottom: none;
}

.article-card:hover {
    transform: translateX(5px);
}

.article-image-link img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-title a:hover {
    color: #f59e0b;
}

.article-excerpt {
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f59e0b;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    flex: 1;
    font-weight: 500;
    transition: color 0.3s ease;
}

.sidebar-list a:hover {
    color: #f59e0b;
}

.sidebar-meta {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

/* ========================================
   Category Page
   ======================================== */
.category-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.category-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 1.125rem;
    opacity: 0.8;
}

/* ========================================
   Detail Page
   ======================================== */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #666;
}

.breadcrumb a {
    color: #2563eb;
}

.breadcrumb a:hover {
    color: #1d4ed8;
}

.separator {
    margin: 0 0.5rem;
}

.article-detail {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.article-detail-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #666;
}

.meta-separator {
    color: #ccc;
}

.article-detail-image {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.article-detail-image img {
    width: 100%;
}

.article-detail-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

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

.article-detail-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.article-detail-content ul,
.article-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

/* ========================================
   Related Articles
   ======================================== */
.related-articles {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.related-card {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
}

.related-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.related-card h3 {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.related-card a {
    color: #1a1a1a;
}

.related-card a:hover h3 {
    color: #f59e0b;
}

/* ========================================
   Static Pages (About, Privacy, Terms, Contact)
   ======================================== */
.static-page {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #f59e0b;
}

.page-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.page-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.page-content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* ========================================
   Ad Slots
   ======================================== */
.ad {
    min-height: 90px;
    background-color: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    text-align: center;
    padding: 1rem;
}

.ad-page-top {
    margin: 0;
    padding: 0;
    min-height: auto;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: #1a1a1a;
    color: #e5e5e5;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    font-size: 0.875rem;
}

.footer-nav {
    display: flex;
    gap: 2rem;
}

.footer-nav a {
    color: #e5e5e5;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #f59e0b;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: 12px;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

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

    .sidebar {
        position: static;
        margin-top: 2rem;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .article-card {
        grid-template-columns: 1fr;
    }

    .article-image-link img {
        height: 200px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .hero-latest-item:nth-child(n+4) {
        display: block;
    }

    .hero-latest-item:nth-child(n+5) {
        display: none;
    }

    .hero-latest-link {
        grid-template-columns: 80px 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

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

    .article-detail {
        padding: 1.5rem;
    }

    .article-detail-title {
        font-size: 1.75rem;
    }

    .hero-main-img {
        height: 300px;
    }
}