/* Notion-style CSS */
:root {
    --notion-bg: #ffffff;
    --notion-text: #37352f;
    --notion-text-light: #787774;
    --notion-border: #e9e9e7;
    --notion-hover: #f7f6f3;
    --notion-accent: #2383e2;
    --notion-card-shadow: rgba(15, 15, 15, 0.1);
    --notion-max-width: 900px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--notion-bg);
    color: var(--notion-text);
    line-height: 1.6;
    font-size: 16px;
}

.notion-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.notion-header {
    border-bottom: 1px solid var(--notion-border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    background: var(--notion-bg);
    z-index: 100;
}

.notion-header-content {
    max-width: var(--notion-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.notion-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--notion-text);
}

.notion-title a {
    color: var(--notion-text);
    text-decoration: none;
    transition: opacity 0.2s;
}

.notion-title a:hover {
    opacity: 0.7;
}

/* Main */
.notion-main {
    flex: 1;
    max-width: var(--notion-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Post List */
.notion-post-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notion-post-card {
    border: 1px solid var(--notion-border);
    border-radius: 3px;
    padding: 16px;
    text-decoration: none;
    color: var(--notion-text);
    transition: background-color 0.1s ease;
    display: block;
}

.notion-post-card:hover {
    background-color: var(--notion-hover);
}

.notion-post-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.notion-post-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.notion-post-card-content {
    flex: 1;
    min-width: 0;
}

.notion-post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notion-post-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: var(--notion-text-light);
    flex-wrap: wrap;
}

.notion-post-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notion-post-excerpt {
    margin-top: 8px;
    font-size: 14px;
    color: var(--notion-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notion-post-flair {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.notion-post-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--notion-border);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 8px;
    margin-right: 6px;
}

.notion-post-badge.nsfw {
    background: #ff4757;
    color: white;
}

.notion-post-badge.video {
    background: #5f27cd;
    color: white;
}

.notion-post-badge.image {
    background: #00d2d3;
    color: white;
}

/* Single Post */
.notion-post-single {
    margin-bottom: 40px;
}

.notion-post-single-header {
    margin-bottom: 24px;
}

.notion-post-single-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.notion-post-single-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--notion-text-light);
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--notion-border);
}

.notion-post-single-content {
    margin-top: 24px;
}

.notion-post-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 16px 0;
}

.notion-post-text {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.notion-post-video {
    width: 100%;
    max-width: 100%;
    border-radius: 3px;
    margin: 16px 0;
}

.notion-post-link {
    display: block;
    padding: 16px;
    background: var(--notion-hover);
    border-radius: 3px;
    margin: 16px 0;
    text-decoration: none;
    color: var(--notion-accent);
    word-wrap: break-word;
}

.notion-post-link:hover {
    text-decoration: underline;
}

.notion-back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--notion-text-light);
    text-decoration: none;
    font-size: 14px;
}

.notion-back-link:hover {
    color: var(--notion-text);
}

/* Footer */
.notion-footer {
    border-top: 1px solid var(--notion-border);
    padding: 20px 0;
    margin-top: 60px;
}

.notion-footer-content {
    max-width: var(--notion-max-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    font-size: 14px;
    color: var(--notion-text-light);
}

/* Pagination */
.notion-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.notion-pagination a,
.notion-pagination span {
    padding: 8px 16px;
    border: 1px solid var(--notion-border);
    border-radius: 3px;
    text-decoration: none;
    color: var(--notion-text);
    transition: background-color 0.1s ease;
}

.notion-pagination a:hover {
    background-color: var(--notion-hover);
}

.notion-pagination .current {
    background-color: var(--notion-accent);
    color: white;
    border-color: var(--notion-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .notion-main {
        padding: 24px 16px;
    }
    
    .notion-post-single-title {
        font-size: 24px;
    }
    
    .notion-post-card-header {
        flex-direction: column;
    }
    
    .notion-post-thumbnail {
        width: 100%;
        height: 200px;
    }
}

/* Loading State */
.notion-loading {
    text-align: center;
    padding: 40px;
    color: var(--notion-text-light);
}

/* Empty State */
.notion-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--notion-text-light);
}

.notion-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.notion-empty-text {
    font-size: 18px;
}

/* Subreddit Badge */
.notion-subreddit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--notion-hover);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    color: var(--notion-text);
    text-decoration: none;
}

.notion-subreddit:hover {
    background: var(--notion-border);
}

/* New Grid Layout Styles */
.text-posts-section,
.image-posts-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--notion-border);
}

/* Default grid for text posts - 2 columns on desktop */
.text-posts-section .posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

/* Grid for image posts - 4 columns on desktop */
.image-posts-section .posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.post-card {
    border: 1px solid var(--notion-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--notion-bg);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--notion-card-shadow);
}

.post-card .post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-card .post-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.post-card .post-date {
    font-size: 13px;
    color: var(--notion-text-light);
}

.post-card .post-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-card .post-title a {
    color: var(--notion-text);
    text-decoration: none;
    transition: color 0.2s;
}

.post-card .post-title a:hover {
    color: var(--notion-accent);
}

.post-card .post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--notion-text-light);
    margin-bottom: 16px;
    flex: 1;
}

.post-card .post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--notion-border);
}

.post-card .post-stats {
    display: flex;
    gap: 12px;
}

.post-card .stat-item {
    font-size: 13px;
    color: var(--notion-text-light);
}

.post-card .read-more {
    font-size: 14px;
    font-weight: 500;
    color: var(--notion-accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.post-card .read-more:hover {
    opacity: 0.7;
}

/* Partners Widget */
.partners-widget {
    margin-top: 48px;
    padding: 24px;
    background: var(--notion-hover);
    border-radius: 8px;
    border: 1px solid var(--notion-border);
}

.partners-widget h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.partners-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.partners-links a {
    padding: 8px 16px;
    background: var(--notion-bg);
    border: 1px solid var(--notion-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--notion-text);
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s;
}

.partners-links a:hover {
    background: var(--notion-accent);
    border-color: var(--notion-accent);
    color: white;
}

/* Responsive Grid */
@media (max-width: 768px) {
    /* Text posts: 1 column on mobile */
    .text-posts-section .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Image posts: 2 columns on mobile */
    .image-posts-section .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .post-card .post-thumbnail {
        height: 180px;
    }
    
    /* Smaller thumbnails for image posts on mobile */
    .image-posts-section .post-card .post-thumbnail {
        height: 120px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Text posts: 2 columns on tablet */
    .text-posts-section .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Image posts: 3 columns on tablet */
    .image-posts-section .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

