/* Articles List Page */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 2rem 4rem; /* offset for nav */
    font-family: 'Inter', sans-serif;
}

.articles-header {
    text-align: center;
    margin-bottom: 4rem;
}

.articles-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary, #111);
}

.articles-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary, #666);
}

/* Featured Article */
.featured-article {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 1.5rem;
    overflow: hidden;
    margin-bottom: 3rem;
    background: #fff;
    transition: transform 0.2s;
    position: relative; /* Anchor for pseudo-element */
}

.featured-article:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

@media (min-width: 768px) {
    .featured-article {
        flex-direction: row;
        padding: 0; /* Instead of padding the card, pad the content block */
        gap: 0;
    }
}

.featured-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem; /* Adjusts minimum allowed whitespace between text and meta footer */
    padding: 2rem;
}

.content-body {
    display: flex;
    flex-direction: column;
    gap: inherit; /* inherit the exact gap dimension set by the parent flex container */
}

@media (min-width: 768px) {
    .featured-content {
        padding: 2.5rem 3rem; /* Adjust padding per user feedback */
    }
}

.featured-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.featured-title a {
    color: inherit;
    text-decoration: none;
}

/* Make entire featured card clickable */
.featured-title a::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.featured-summary {
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    margin: 0;
    font-size: 1.125rem;
}

.featured-image-wrapper {
    flex: 1;
    background-color: #e5e7eb;
    border-radius: 0;
    overflow: hidden;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Grid Articles */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 5rem;
}

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

.grid-article {
    border: 1px solid #e5e7eb;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    position: relative; /* Anchor for pseudo-element */
}

.grid-article:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.grid-image-wrapper {
    position: relative;
    padding: 0; /* Let image bleed to the edges */
}

.grid-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 0;
}

.grid-image-placeholder {
    width: 100%;
    height: 240px;
    background: #f3f4f6;
    border-radius: 0;
}

.grid-content {
    padding: 1.5rem; /* Reduced from 2rem */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem; /* Reduced from 1.5rem */
}

.grid-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

.grid-title a {
    color: inherit;
    text-decoration: none;
}

/* Make entire grid card clickable */
.grid-title a::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.grid-summary {
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
}

/* Categories and Meta */
.article-categories {
    display: flex;
    gap: 0.5rem;
    margin: 0;
}

.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #e0f2fe;
    color: #0369a1;
}

.category-badge:nth-child(2) {
    background: #dcfce7;
    color: #15803d;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.meta-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary, #111);
}

.publish-date {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

/* Inline Newsletter */
.inline-newsletter {
    text-align: center;
    margin: 4rem 0;
    padding: 0 1rem;
}

.inline-newsletter h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.newsletter-rss-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

.inline-newsletter-form {
    display: flex;
    justify-content: center;
    flex: 1;
    border: 1px solid #111;
    border-radius: 2rem;
    padding: 0.25rem;
    background: #fff;
}

.rss-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.rss-button:hover {
    background: #e5e7eb;
    color: #111;
}

body[data-theme="dark"] .rss-button {
    background: #374151;
    color: #9ca3af;
}

body[data-theme="dark"] .rss-button:hover {
    background: #4b5563;
    color: #fff;
}

.inline-newsletter-form input {
    flex: 1;
    border: none;
    padding: 0.75rem 1.5rem;
    background: transparent;
    outline: none;
    font-family: inherit;
}

.inline-newsletter-form .btn-primary {
    background: #86C197;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.inline-newsletter-form .btn-primary:hover {
    background: #6ba87d;
}

/* Banner */
.founding-creators-banner {
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    padding: 4rem 2rem;
    border-radius: 1.5rem;
    text-align: center;
    margin: 6rem auto;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(134, 193, 151, 0.15);
}

.banner-content h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #111;
}

.banner-content p {
    color: #4b5563;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.banner-content .btn-primary {
    display: inline-block;
    background: #86C197;
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.banner-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(134, 193, 151, 0.3);
}

/* Single Article */
.single-article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}

.single-article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.single-article-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.single-article-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary, #4b5563);
    margin-bottom: 2rem;
}

.single-article-header .article-meta {
    justify-content: center;
}

.single-article-image {
    width: 100%;
    margin-bottom: 3rem;
    border-radius: 1rem;
    overflow: hidden;
}

.single-article-image img {
    width: 100%;
    height: auto;
}

.single-article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.single-article-content h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    margin: 3rem 0 1.5rem;
    color: #111;
}

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

.single-article-content blockquote {
    border-left: 4px solid #86C197;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4b5563;
}

/* Dark Mode Support */
body[data-theme="dark"] .articles-title,
body[data-theme="dark"] .featured-title,
body[data-theme="dark"] .grid-title,
body[data-theme="dark"] .author-name,
body[data-theme="dark"] .inline-newsletter h3,
body[data-theme="dark"] .single-article-title,
body[data-theme="dark"] .single-article-content h2 {
    color: #fff;
}

body[data-theme="dark"] .featured-article,
body[data-theme="dark"] .grid-article {
    background: #1f2937;
    border-color: #374151;
}

body[data-theme="dark"] .inline-newsletter-form {
    background: #111;
    border-color: #374151;
}

body[data-theme="dark"] .inline-newsletter-form input {
    color: #fff;
}

body[data-theme="dark"] .founding-creators-banner {
    background: #1f2937;
    box-shadow: none;
}

body[data-theme="dark"] .banner-content h2 {
    color: #fff;
}

body[data-theme="dark"] .banner-content p,
body[data-theme="dark"] .single-article-content {
    color: #d1d5db;
}

/* Additional Dark Mode Fixes */
body[data-theme="dark"] .articles-subtitle,
body[data-theme="dark"] .featured-summary,
body[data-theme="dark"] .grid-summary,
body[data-theme="dark"] .publish-date,
body[data-theme="dark"] .single-article-subtitle,
body[data-theme="dark"] .single-article-content blockquote {
    color: #9ca3af;
}

body[data-theme="dark"] .category-badge {
    background: #0f172a;
    color: #38bdf8;
}

body[data-theme="dark"] .category-badge:nth-child(2) {
    background: #064e3b;
    color: #4ade80;
}

body[data-theme="dark"] .featured-image-placeholder,
body[data-theme="dark"] .grid-image-placeholder {
    background: #374151;
}

/* Articles Search Bar */
.articles-search-container {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 2rem auto 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 2rem;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.articles-search-container:focus-within {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border-color: #86C197;
}

body[data-theme="dark"] .articles-search-container {
    background: #111;
    border-color: #374151;
}

.search-icon {
    color: #9ca3af;
    margin-right: 0.75rem;
}

.articles-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary, #111);
    outline: none;
    font-family: inherit;
}

body[data-theme="dark"] .articles-search-input {
    color: #fff;
}

/* Articles Pagination */
.articles-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 5rem;
    font-family: 'Inter', sans-serif;
}

.pagination-btn {
    text-decoration: none;
    color: #111;
    background: #e5e7eb;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.pagination-btn:hover {
    background: #86C197;
    color: #fff;
}

.pagination-info {
    font-weight: 500;
    color: #4b5563;
}

body[data-theme="dark"] .pagination-info {
    color: #9ca3af;
}

body[data-theme="dark"] .pagination-btn {
    background: #374151;
    color: #d1d5db;
}

body[data-theme="dark"] .pagination-btn:hover {
    background: #86C197;
    color: #fff;
}
