/* Layout Card */
.articles-feed.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .articles-feed.feed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.feed-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feed-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.feed-card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.feed-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-card-content {
    padding: 1.25rem;
}

.feed-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.feed-title a {
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Hero Image - Giảm chiều cao */
.hero-thumb {
    max-height: 150px !important;
}
.hero-thumb img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.sidebar-extra-nav {
    margin-top: auto; /* Push to bottom */
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* === Yêu cầu chỉnh layout === */

/* 1. app-container max-width */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 2. Ẩn page-icon trong post/page */
.page-icon {
    display: none !important;
}

/* 3. page-card padding responsive */
.page-card {
    padding: clamp(1rem, 8vw, 3rem);
}

/* 4. sidebar border 4 cạnh thay vì chỉ border-right */
.sidebar {
    border: 1px solid var(--border-color);
}

/* 5. Content typography - Reddit Sans */
body, .app-container,
.article-content, .page-content {
    font-family: 'Reddit Sans', sans-serif;
    font-weight: 400;
}

.sidebar-nav, .sidebar-nav a, nav a {
    font-family: 'Reddit Sans', sans-serif;
    font-weight: 500;
}

h1, h2, h3, h4, h5, h6,
.site-title,
.feed-title a,
.page-title,
.article-title {
    font-family: 'Reddit Sans', sans-serif;
    font-weight: 600;
}

.article-title { font-size: 2.8rem !important; }

/* 6. Article heading sizes */
.article-content h1 { font-size: 2.3rem !important; }
.article-content h2 { font-size: 2rem !important; }
.article-content h3 { font-size: 1.8rem !important; }
.article-content h4,
.article-content h5,
.article-content h6 { font-size: 1.5rem !important; }

/* 7. Hero card square shape - limit height to width */
.hero-bento { aspect-ratio: 1 / 1; max-height: 500px; }

/* 8. Markdown text styling */
.article-content strong { font-weight: 700; }
.article-content em { font-style: italic; }
.article-content del { text-decoration: line-through !important; opacity: 0.7; }
.article-content code { 
    background: rgba(100, 200, 100, 0.15);
    color: #4ade80;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* 8b. Article link color - green theme */
.article-content a { color: #2FBA21 !important; }

/* 9. Heading underlines - all levels get accent line */
.article-content h2::after,
.article-content h3::after,
.article-content h4::after,
.article-content h5::after,
.article-content h6::after {
    content: "";
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 3px;
    background: var(--accent-dark);
    border-radius: 2px;
}

/* 10. Heading color & H1 underline */
.article-content h1, .article-content h2,
.article-content h3, .article-content h4,
.article-content h5, .article-content h6 {
    color: #b7e2b3;
    position: relative;
    margin-top: 2rem !important;
    margin-bottom: 1.5rem !important;
}

.article-content h1::after {
    content: "";
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 3px;
    background: var(--accent-dark);
    border-radius: 2px;
}

/* 11. Article Title color */
.article-title { color: #2FBA21 !important; }

/* 12. List styling - Improved spacing & bullets */
.article-content ul,
.article-content ol {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-left: 2rem !important;
    line-height: 1.8 !important;
    color: var(--fg) !important;
}

.article-content ul {
    list-style-type: disc !important;
}

.article-content ul ul {
    list-style-type: circle !important;
}

.article-content ol {
    list-style-type: decimal !important;
}

.article-content li { 
    margin-bottom: 0.75rem !important;
}

/* 13. Code block transparent background */
.article-content .highlight,
.article-content pre,
.article-content .highlight pre {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.article-content pre code {
    background: transparent;
}

/* 14. Blockquote paragraph compact */
.article-content blockquote p { margin-bottom: 0 !important; }

/* 15. Homepage layout tweaks */
section.feed-section .section-header { margin-top: 0; }
main.main-content .home-bento { gap: 0rem; }

/* 16. Blockquote spacing */
blockquote { margin: 1rem; padding: 1.5rem; }