/*
 * Theme Name: Narad-WP
 * Component: Blogpage & Archives
 * Description: Native Vanilla CSS styling for the Ultimate (Hero+List) and Grid archive layouts.
 */

:root {
    --nrd-blog-max-width: 1680px;
    --nrd-blog-primary: #4f46e5;
    /* indigo-600 */
    --nrd-blog-grid-primary: #059669;
    /* emerald-600 */
}

.narad-blog-main-wrapper {
    background-color: #f3f4f6;
    /* gray-100 */
    padding-top: 5rem;
    padding-bottom: 5rem;
    font-family: var(--nrd-font-sans, 'Inter', sans-serif);
}

.narad-container {
    max-width: var(--nrd-blog-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Archive Headers (For category/tag pages)
   ========================================================================== */
.narad-archive-header {
    text-align: center;
    max-width: 56rem;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}

.narad-archive-title {
    font-size: 2.25rem;
    font-weight: 900;
    color: #111827;
    /* gray-900 */
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.narad-archive-desc {
    font-size: 1.125rem;
    color: #4b5563;
    /* gray-600 */
}

/* ==========================================================================
   Global Layout Container (Flex for Sidebar)
   ========================================================================== */
.narad-layout-container {
    max-width: var(--nrd-blog-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .narad-layout-container.has-sidebar {
        display: flex;
        gap: 3rem;
    }
}

.narad-layout-content {
    flex-grow: 1;
    width: 100%;
}

@media (min-width: 1024px) {
    .narad-layout-container.has-sidebar .narad-layout-content {
        width: 66.666667%;
    }
}

/* Sidebar Styling */
.narad-layout-sidebar {
    width: 100%;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .narad-layout-sidebar {
        width: 33.333333%;
        margin-top: 0;
    }
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    /* gray-200 */
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget ul li a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: var(--nrd-blog-primary);
}


/* ==========================================================================
   1. The Ultimate Editorial Layout (Hero + List + Optional Sidebar)
   ========================================================================== */
.narad-blog-ultimate-wrapper {
    background-color: #ffffff;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 0 0 0.75rem 0.75rem;
    border: 1px solid #e5e7eb;
    max-width: var(--nrd-blog-max-width);
    margin: 0 auto;
}

@media (min-width: 768px) {
    .narad-blog-ultimate-wrapper {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .narad-blog-ultimate-wrapper {
        padding: 2.5rem;
    }
}

/* Hero Section (Always full width within the wrapper) */
.narad-ultimate-hero {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .narad-ultimate-hero {
        height: 600px;
    }
}

.narad-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.narad-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.narad-no-image {
    background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 100%);
}

.narad-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.narad-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    color: #ffffff;
}

@media (min-width: 768px) {
    .narad-hero-content {
        padding: 3rem;
    }
}

.narad-hero-badge {
    display: inline-block;
    background-color: var(--nrd-blog-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.125rem;
}

.narad-hero-title {
    font-size: 1.875rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .narad-hero-title {
        font-size: 3rem;
        width: 75%;
    }
}

@media (min-width: 1024px) {
    .narad-hero-title {
        font-size: 3.75rem;
    }
}

.narad-hero-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-hero-title a:hover {
    color: #818cf8;
    /* indigo-400 */
}

.narad-hero-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    /* gray-300 */
    gap: 1rem;
}

.narad-meta-author {
    display: flex;
    align-items: center;
}

.narad-meta-author img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    margin-right: 0.5rem;
    border: 1px solid #3b82f6;
    /* blue-500 */
}

/* Post-Hero Flex Layout (List + Sidebar) */
.narad-ultimate-flex-container {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
}

@media (min-width: 1024px) {
    .narad-ultimate-flex-container.has-sidebar {
        display: flex;
        gap: 3rem;
    }
}

.narad-ultimate-list-section {
    flex-grow: 1;
    width: 100%;
}

@media (min-width: 1024px) {
    .narad-ultimate-flex-container.has-sidebar .narad-ultimate-list-section {
        width: 66.666667%;
    }
}

/* The Dense List Items */
.narad-ultimate-list-inner {
    display: flex;
    flex-direction: column;
}

.narad-dense-list-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

@media (min-width: 768px) {
    .narad-dense-list-item {
        flex-direction: row;
        gap: 2rem;
    }
}

.narad-dense-img-container {
    width: 100%;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .narad-dense-img-container {
        width: 40%;
    }
}

.narad-dense-img-container a {
    display: block;
    overflow: hidden;
    border-radius: 0.25rem;
    background-color: #f3f4f6;
    aspect-ratio: 16/9;
}

@media (min-width: 768px) {
    .narad-dense-img-container a {
        aspect-ratio: 4/3;
    }
}

.narad-dense-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.narad-dense-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.narad-dense-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.narad-dense-cat {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #111827;
    background-color: #f1f5f9;
    /* slate-100 */
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.narad-dense-cat:hover {
    background-color: #111827;
    color: #ffffff;
}

.narad-dense-date {
    font-size: 0.75rem;
    color: #6b7280;
    /* gray-500 */
    font-weight: 500;
}

.narad-dense-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .narad-dense-title {
        font-size: 1.875rem;
    }
}

.narad-dense-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-dense-title a:hover,
.narad-dense-list-item:hover .narad-dense-title a {
    color: var(--nrd-blog-primary);
}

.narad-dense-excerpt {
    font-size: 0.875rem;
    color: #4b5563;
    /* gray-600 */
    line-height: 1.625;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .narad-dense-excerpt {
        font-size: 1rem;
    }
}

.narad-dense-readmore {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-dense-readmore i {
    margin-left: 0.25rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.narad-dense-readmore:hover,
.narad-dense-list-item:hover .narad-dense-readmore {
    color: var(--nrd-blog-primary);
}

.narad-dense-list-item:hover .narad-dense-readmore i {
    transform: translateX(4px);
}


/* ==========================================================================
   2. The Clean Grid Layout (Visual Masonry style)
   ========================================================================== */
.narad-blog-grid-wrapper {
    background-color: #ffffff;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.75rem 0.75rem;
    border: 1px solid #e5e7eb;
}

.narad-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .narad-grid-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* If no sidebar, go 3 columns on large screens */
@media (min-width: 1024px) {
    .no-sidebar .narad-grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}

.narad-grid-card {
    display: flex;
    flex-direction: column;
}

.narad-grid-img-wrap {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 4/3;
    display: block;
}

.narad-grid-cat-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: #ffffff;
    color: #047857;
    /* emerald-700 */
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    z-index: 10;
}

.narad-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.narad-grid-meta {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.narad-grid-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.375;
    margin-bottom: 0.5rem;
}

.narad-grid-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narad-grid-card:hover .narad-grid-title a {
    color: var(--nrd-blog-grid-primary);
}

.narad-grid-excerpt {
    font-size: 0.875rem;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Pagination Overrides (WordPress default classes)
   ========================================================================== */
.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
    /* slate-50 */
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #f1f5f9;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

@media (min-width: 768px) {
    .nav-links {
        justify-content: space-between;
    }
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.page-numbers:hover {
    background-color: #e2e8f0;
    /* slate-200 */
}

.page-numbers.current {
    background-color: var(--nrd-blog-primary);
    color: #ffffff;
}

.page-numbers.next,
.page-numbers.prev {
    width: auto;
    padding: 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

a.page-numbers.next:hover,
a.page-numbers.prev:hover {
    color: var(--nrd-blog-primary);
    background-color: transparent;
}