/*=====================================================================
  [1] Global Setup & Variables
=====================================================================*/
:root {
    /* Color Palette (Dark Theme Focus) */
    --clr-bg-primary: #05070f;              /* Deep background */
    --clr-surface-dark: rgba(15, 23, 42, 0.9); /* Card background */
    --clr-text-light: #f4f5f7;              /* Primary text color */
    --clr-text-secondary: rgba(255, 255, 255, 0.65); /* Meta text color */
    --clr-border-subtle: rgba(255, 255, 255, 0.1);
    
    /* Primary Accent Gradient (Teal/Green) */
    --gradient-primary: linear-gradient(135deg, #10b981, #22d3ee);
    /* Hero Gradient (Blue/Dark) */
    --gradient-hero: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(37, 99, 235, 0.7));
    
    /* Spacing */
    --space-xs: 0.75rem;
    --space-s: 1.5rem;
    --space-m: 2rem;
    --space-l: 3rem;
}

/* Base Styles */
.articles-page {
    /* Assuming 'Cairo' font is imported earlier */
    font-family: 'Cairo', sans-serif; 
    background: var(--clr-bg-primary);
    color: var(--clr-text-light);
    direction: rtl; /* Ensure RTL layout */
}

/*=====================================================================
  [2] Sticky Header
=====================================================================*/
.site-primary-header {
    background: rgba(5, 7, 14, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1200;
    /* Adding subtle blur for depth */
    backdrop-filter: blur(8px);
}


/*=====================================================================
  [3] Hero Section (articles-hero)
=====================================================================*/
.articles-hero {
    width: min(1100px, 100% - 32px);
    margin: var(--space-m) auto var(--space-s);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 30px;
    background: var(--gradient-hero);
    box-shadow: 0 40px 70px rgba(7, 14, 30, 0.8);
    
    /* Grid Layout */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Slightly wider min width */
    gap: var(--space-m);
    align-items: center;
}

.articles-hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem; /* Slightly larger */
    color: #93c5fd;
    margin: 0;
    font-weight: 700;
}

.articles-hero h1 {
    margin: 0;
    font-size: clamp(2.5rem, 4vw, 3.2rem);
    line-height: 1.3;
}

.articles-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: 0.5rem;
}

/* Hero Visual (Background Image and Gradient Overlay) */
.articles-hero-visual {
    min-height: 260px;
    border-radius: 20px;
    background: radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.4), transparent 60%),
        url('../images/pc-games/elden ring.webp') center/cover no-repeat;
    /* Ensure image is not distorted on mobile */
    background-size: cover;
}


/* Hero Metrics */
.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.hero-metrics div {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metrics strong {
    font-size: 1.4rem;
    display: block;
    color: #38bdf8; /* Highlight metric number */
    font-weight: 800;
}


/*=====================================================================
  [4] General Button Styles (btn)
=====================================================================*/
.btn {
    border-radius: 999px;
    padding: 0.85rem 1.6rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: var(--gradient-primary);
    color: var(--clr-bg-primary);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn:hover {
    transform: translateY(-2px);
    /* Slightly stronger shadow on hover */
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.5); 
}


/*=====================================================================
  [5] Articles Grid & Card Styles
=====================================================================*/

.articles-grid {
    width: min(1120px, 100% - 32px);
    margin: 0 auto var(--space-l);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Consistent card size */
    gap: var(--space-s);
}

.article-card {
    background: var(--clr-surface-dark);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--clr-border-subtle);
    box-shadow: 0 15px 30px rgba(8, 15, 30, 0.7);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px); /* Lift effect */
    box-shadow: 0 25px 50px rgba(8, 15, 30, 0.9);
}

/* Card Media */
.article-card-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-media img {
    transform: scale(1.05); /* Zoom effect */
}

/* Card Body */
.article-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1; /* Allows body to expand and push the button down */
}

.article-card-tag {
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #38bdf8;
    font-weight: 600;
}

.article-card h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.4;
}

.article-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
    /* Limit text to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--clr-text-secondary);
    padding-top: 0.5rem;
}

.article-card .btn.ghost {
    margin-top: auto; /* Push the button to the bottom */
}


/*=====================================================================
  [6] Responsive Overrides
=====================================================================*/

@media (max-width: 768px) {
    /* Header Adjustments */
    .site-primary-header .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Grid Adjustments */
    .articles-hero {
        grid-template-columns: 1fr; /* Single column layout for Hero */
    }

    .articles-grid {
        grid-template-columns: 1fr; /* Single column layout for Grid */
        /* Increased padding on small screens to avoid edge touching */
        width: 100%;
        padding: 0 1rem;
    }
    
    .article-card {
        max-width: 400px; /* Optional: Constrain card width for better reading flow */
        margin: 0 auto;
    }
    
    .articles-hero h1 {
        font-size: 2.5rem;
    }
}