/*
 * Theme Name: Narad-WP
 * Mode: Magazine
 * Description: Native Vanilla CSS styling for the Magazine Homepage layout.
 * Note: Highly responsive, utilizing CSS Grid, Flexbox, and CSS Variables.
 */

/* ==========================================================================
   1. CSS Variables & Configuration
   ========================================================================== */
:root {
    --nrd-mag-primary: #0044cc;
    --nrd-mag-secondary: #ff6600;
    --nrd-mag-purple: #9333ea;
    --nrd-mag-text: #1f2937;
    --nrd-mag-text-light: #6b7280;
    --nrd-mag-bg: #f9fafb;
    --nrd-mag-white: #ffffff;

    --nrd-container-width: 1280px;
    --nrd-spacing-sm: 1rem;
    /* 16px */
    --nrd-spacing-md: 1.5rem;
    /* 24px */
    --nrd-spacing-lg: 2.5rem;
    /* 40px */
    --nrd-spacing-xl: 4rem;
    /* 64px */

    --nrd-radius-sm: 0.5rem;
    --nrd-radius-md: 0.75rem;
    --nrd-radius-lg: 1rem;

    --nrd-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   2. Global / Utility Clases
   ========================================================================== */
/* Scope these base styles to the body when Magazine mode is active */
body.mode-magazine {
    background-color: var(--nrd-mag-bg);
    color: var(--nrd-mag-text);
    font-family: var(--nrd-font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Main constraint wrapper for sections to keep them perfectly centered */
.narad-container {
    max-width: var(--nrd-container-width);
    margin: 0 auto;
    padding: 0 var(--nrd-spacing-sm);
}

/* Universal image background utility - makes the `img` tag act like `background-size: cover` */
.narad-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.6s ease;
}

/* Gray block for posts without thumbnails */
.narad-bg-placeholder,
.narad-thumb-placeholder {
    background-color: #e5e7eb;
}

/* Sexy deep gradient overlay so white text is always readable regardless of image brightness */
.narad-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
}

/* Card Zoom Effect: scales up the contained image without breaking boundaries */
.card-zoom {
    overflow: hidden;
}

.card-zoom:hover .narad-bg-img {
    transform: scale(1.05);
}

/* Gentle drop shadow lift effect for the editor's picks */
.drop-shadow-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.drop-shadow-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   3. Hero Section (Masonry Grid)
   ========================================================================== */
.narad-magazine-hero {
    margin: var(--nrd-spacing-xl) 0;
}

/* 
 * The CSS Grid Engine for the Hero
 * Mobile: 1 column stack
 * Desktop: 3 column grid (Main article spans 2 columns, Stacked posts span 1)
 */
.narad-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--nrd-spacing-md);
}

@media (min-width: 1024px) {
    .narad-hero-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Main Large Article (Left Side) --- */
.narad-hero-main {
    position: relative;
    border-radius: var(--nrd-radius-lg);
    height: 400px;
    /* Fixed height scale for mobile */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
    .narad-hero-main {
        grid-column: span 2;
        /* Takes up 2 out of 3 columns */
        height: 500px;
        /* Fixed tall height for desktop elegance */
    }
}

/* Removes anchor text decoration and block behavior */
.narad-hero-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* Text Container over the gradient overlay */
.narad-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--nrd-spacing-md);
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .narad-hero-content {
        padding: var(--nrd-spacing-lg);
    }
}

/* Main Dramatic Headline */
.narad-hero-title {
    color: var(--nrd-mag-white);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 var(--nrd-spacing-sm) 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    .narad-hero-title {
        font-size: 3rem;
    }
}

.narad-hero-main:hover .narad-hero-title {
    color: #bfdbfe;
    /* Subtle blue tint on hover */
}

/* Meta Data Flexbox (Author, Dot Separator, Date) */
.narad-hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #d1d5db;
    font-size: 0.875rem;
}

.narad-meta-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.narad-meta-author img {
    border-radius: 50%;
    border: 1px solid var(--nrd-mag-white);
    /* White ring around author face */
}

/* --- Stacked Articles (Right Side) --- */
.narad-hero-stacked {
    display: flex;
    flex-direction: column;
    gap: var(--nrd-spacing-md);
}

/* 
 * The math here is important: 
 * Two 238px boxes + One 24px gap = 500px 
 * This ensures the two right boxes perfectly match the height of the left main box.
 */
.narad-hero-small {
    position: relative;
    border-radius: var(--nrd-radius-lg);
    height: 238px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.narad-hero-small-title {
    color: var(--nrd-mag-white);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.narad-hero-small:hover .narad-hero-small-title {
    color: #fed7aa;
    /* Subtle orange tint on hover */
}

.narad-meta-date-small {
    color: #d1d5db;
    font-size: 0.75rem;
    margin: 0;
}


/* ==========================================================================
   4. Category Badges
   ========================================================================== */
.narad-cat-badge {
    align-self: flex-start;
    /* Ensures badge doesn't stretch 100% width in flex container */
    color: var(--nrd-mag-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: var(--nrd-radius-sm);
    margin-bottom: var(--nrd-spacing-sm);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Dynamic colors for the badges */
.narad-cat-primary {
    background-color: var(--nrd-mag-primary);
}

.narad-cat-secondary {
    background-color: var(--nrd-mag-secondary);
}


/* ==========================================================================
   5. Editor's Picks Section (Category Specific Posts)
   ========================================================================== */
.narad-magazine-picks {
    margin-bottom: var(--nrd-spacing-xl);
}

/* Flexbox Header for Title vs "View All" link */
.narad-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: var(--nrd-spacing-lg);
    padding-bottom: 0.5rem;
}

.narad-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nrd-mag-text);
    margin: 0;
    position: relative;
}

/* Clean underline accent to mimic professional news outlets */
.narad-section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    /* Precise absolute positioning over the padding */
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--nrd-mag-primary);
}

.narad-view-all {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nrd-mag-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-view-all:hover {
    color: var(--nrd-mag-secondary);
}

/* 
 * Picks Grid Layout: Responsive CSS Grid
 * Phone: 1 column
 * Tablet: 2 columns
 * Desktop: 4 columns
 */
.narad-picks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--nrd-spacing-lg);
}

@media (min-width: 768px) {
    .narad-picks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .narad-picks-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Individual Pick Card Standard Setup */
.narad-pick-card {
    display: flex;
    flex-direction: column;
}

.narad-pick-link {
    text-decoration: none;
    /* No ugly blue lines */
}

/* Standardizing Thumbnail Crop */
.narad-pick-thumbnail {
    border-radius: var(--nrd-radius-lg);
    overflow: hidden;
    height: 192px;
    margin-bottom: var(--nrd-spacing-sm);
    position: relative;
    /* Anchor point for narad-thumb-img */
}

.narad-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.narad-pick-card:hover .narad-thumb-img {
    transform: scale(1.05);
}

/* Typography inside picks cards */
.narad-pick-header {
    margin-bottom: 0.5rem;
}

.narad-pick-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
}

.narad-pick-title a {
    color: var(--nrd-mag-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-pick-card:hover .narad-pick-title a {
    color: var(--nrd-mag-primary);
}

.narad-pick-excerpt {
    color: var(--nrd-mag-text-light);
    font-size: 0.875rem;
    margin: 0;
}

.narad-pick-excerpt p {
    margin: 0;
}