/* ============================================
   CSS-TRICKS INSPIRED HOMEPAGE STYLES
   Using TverdaSoft Brand Colors
============================================ */

/* Dark Theme Variables */
:root {
    /* TverdaSoft Brand Colors */
    --primary-color: #3B82F6;
    /* TVERDA Blue */
    --primary-dark: #2563EB;
    /* Darker Blue */
    --secondary-color: #F59E0B;
    /* Amber/Orange for accents */

    /* Light Theme Colors */
    --bg-dark: #F9FAFB;
    /* Main light background (Gray-50) */
    --bg-darker: #FFFFFF;
    /* Header/Footer/Sections (White) */
    --bg-card: #FFFFFF;
    /* Card backgrounds (White) */
    --bg-card-hover: #F3F4F6;
    /* Card hover state (Gray-100) */

    /* Text Colors */
    --text-white: #111827;
    /* Main headings (Gray-900) - inverted */
    --text-light: #374151;
    /* Body text (Gray-700) - inverted */
    --text-gray: #4B5563;
    /* Muted text (Gray-600) - inverted */
    --text-muted: #6B7280;
    /* Meta text (Gray-500) */

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 64px;
    --spacing-3xl: 96px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   GLOBAL DARK THEME
============================================ */

body.homepage {
    background: var(--bg-dark);
    color: var(--text-white);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.homepage-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER / NAVIGATION
============================================ */

.homepage-header {
    background: var(--bg-darker);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Lighter border for light theme */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    /* Add shadow for depth in light theme */
}

.homepage-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.homepage-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.homepage-logo:hover {
    color: var(--primary-color);
}

.homepage-nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

.homepage-nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
}

.homepage-nav-link:hover {
    color: var(--primary-color);
}

.homepage-search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.homepage-search-icon:hover {
    color: var(--primary-color);
}

/* ============================================
   HERO SECTION (FEATURED ARTICLE)
============================================ */

.hero-section {
    padding: var(--spacing-2xl) 0;
    margin-bottom: var(--spacing-xl);
}

.hero-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-md);
    /* Add shadow */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
}

.hero-card:hover {
    transform: translateY(-4px);
}

.hero-image {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.hero-content {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-tags {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-tag {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-white);
}

.hero-title a {
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.hero-title a:hover {
    color: var(--primary-color);
}

.hero-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: var(--spacing-lg);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 14px;
}

.hero-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ============================================
   POPULAR THIS MONTH CAROUSEL
============================================ */

.popular-section {
    margin-bottom: var(--spacing-2xl);
}

.popular-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-white);
}

.popular-carousel {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-card);
}

.popular-carousel::-webkit-scrollbar {
    height: 8px;
}

.popular-carousel::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

.popular-carousel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.popular-card {
    min-width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    top: 0;
    box-shadow: var(--shadow-sm);
    /* Add shadow */
}

.popular-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-12px) rotate(2deg) scale(1.05);
    box-shadow: var(--shadow-xl);
    /* Larger shadow on hover */
    z-index: 10;
}

.popular-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.popular-card-title a {
    color: var(--text-white);
    text-decoration: none;
}

.popular-card-title a:hover {
    color: var(--primary-color);
}

.popular-card-author {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   LATEST ARTICLES SECTION
============================================ */

.latest-section {
    position: relative;
    padding: var(--spacing-2xl) 0;
}

/* Large Background Text */
.latest-bg-text {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 120px;
    font-weight: 900;
    color: var(--text-white);
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

.latest-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
}

/* Article Cards */
.article-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.article-card {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    /* Add shadow */
}

.article-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    /* Larger shadow on hover */
}

.article-image {
    position: relative;
    overflow: hidden;
    background: var(--bg-darker);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-tags {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.article-tag {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-white);
}

.article-title a {
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: var(--spacing-md);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 13px;
}

.article-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* ============================================
   SIDEBAR - QUICK HITS
============================================ */

.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.quick-hits-header {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-white);
}

.quick-hits-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.quick-hit-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    /* Add shadow */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    border-left-width: 4px;
    /* Restore left border width */
}

.quick-hit-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.quick-hit-hashtag {
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.quick-hit-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    color: var(--text-white);
}

.quick-hit-title a {
    color: var(--text-white);
    text-decoration: none;
}

.quick-hit-title a:hover {
    color: var(--primary-color);
}

.quick-hit-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   FOOTER
============================================ */

.homepage-footer {
    background: var(--bg-darker);
    padding: var(--spacing-2xl) 0;
    margin-top: var(--spacing-3xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-newsletter {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.footer-newsletter h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-white);
}

.footer-newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto;
}

.footer-newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
}

.footer-newsletter-button {
    padding: 12px 24px;
    background: var(--bg-darker);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-newsletter-button:hover {
    background: var(--bg-dark);
    transform: translateY(-2px);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-white);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: var(--spacing-xs);
}

.footer-col a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: var(--primary-color);
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */

@media (max-width: 1200px) {
    .latest-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-card {
        grid-template-columns: 1fr;
    }

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

    .article-image {
        height: 200px;
    }

    .hero-title {
        font-size: 32px;
    }

    .article-title {
        font-size: 22px;
    }

    .latest-bg-text {
        font-size: 60px;
    }

    .homepage-nav-links {
        display: none;
    }

    .footer-newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .popular-card {
        min-width: 240px;
    }

    .hero-title {
        font-size: 28px;
    }

    .article-title {
        font-size: 20px;
    }
}

/* ============================================
   SINGLE POST STYLES
============================================ */

.single-header {
    margin-bottom: var(--spacing-xl);
}

.single-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    color: var(--text-muted);
}

.meta-date {
    color: var(--text-gray);
}

/* Single Article Layout */
.single-article-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Entry Content Typography */
.entry-content {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-light);
}

.single-title {
    font-size: 36px;
    /* Reduced from 42px */
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: var(--spacing-lg);
    color: var(--text-white);
}

.entry-content h2 {
    font-size: 26px;
    /* Reduced from 28px */
    font-weight: 700;
    color: var(--text-white);
    margin: var(--spacing-xl) 0 var(--spacing-md);
}

.entry-content p {
    margin-bottom: var(--spacing-md);
    color: var(--text-gray);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
    color: var(--text-gray);
}

.entry-content li {
    margin-bottom: var(--spacing-xs);
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.entry-content a:hover {
    color: var(--primary-dark);
}

.entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    font-style: italic;
    /* Keep italic or normal based on preference, keeping for now */
    color: var(--text-white);
    /* This is dark in light theme vars */
    background: rgba(59, 130, 246, 0.08);
    /* Solid light blue, very subtle */
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    /* Rounded all corners */
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.entry-content code {
    background: rgba(0, 0, 0, 0.05);
    /* Dark opacity for light theme */
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--secondary-color);
    /* Amber */
}

.entry-content pre {
    background: #000;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--spacing-lg) 0;
}

.entry-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-light);
}

/* CTA Block Overrides for Dark Mode */
.entry-content div[style*="background"] {
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-content div[style*="background"] p {
    color: var(--text-primary) !important;
    /* Keep original color if needed, or override */
}

@media (max-width: 768px) {
    .single-title {
        font-size: 32px;
    }

    .entry-content {
        font-size: 16px;
    }
}

/* Fix for Light Blue CTA Block text contrast */
.entry-content div[style*="dbeafe" i],
.entry-content div[style*="rgb(219, 234, 254)"] {
    border-color: rgba(59, 130, 246, 0.3);
}

.entry-content div[style*="dbeafe" i] p,
.entry-content div[style*="rgb(219, 234, 254)"] p,
.entry-content div[style*="dbeafe" i] h2,
.entry-content div[style*="rgb(219, 234, 254)"] h2,
.entry-content div[style*="dbeafe" i] h3,
.entry-content div[style*="rgb(219, 234, 254)"] h3 {
    color: #1e3a8a !important;
    /* Dark blue text for light background */
}
