/* Blog, posts, comments, author and user profile pages. Loaded after base.css on those pages only. */

/* ================================================
   BLOG STYLES
   ================================================ */

/* Blog Featured Hero Section */
.blog-featured-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
}

.featured-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-featured-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.blog-featured-hero .featured-excerpt {
    font-size: 1.15rem;
    opacity: 0.9;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.blog-featured-hero .post-meta {
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.blog-featured-hero .btn {
    display: inline-block;
}

/* Blog Section */
.blog-section {
    padding: 3rem 0 5rem;
    background: #f8f9fa;
}

.blog-section-title {
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-magenta);
    display: inline-block;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.blog-main {
    min-width: 0;
}

/* Blog Controls */
.blog-controls {
    margin-bottom: 2rem;
}

.blog-search {
    display: flex;
    gap: 0.5rem;
}

.blog-filter-info {
    background: #f4f4f5;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.blog-filter-info p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-content h3 {
    font-size: 1.25rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* Post Meta */
.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.post-author {
    font-weight: 500;
}

/* Blog Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e4e4e7;
}

.pagination-info {
    color: var(--color-text-muted);
}

/* Blog Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Blog Empty State */
.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-radius: var(--radius-xl);
}

.blog-empty h3 {
    margin-bottom: 0.5rem;
}

/* ================================================
   BLOG POST PAGE STYLES
   ================================================ */

/* Post Header */
.blog-post-header {
    padding: 5rem 0 4rem;
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-dark) 100%);
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
}

.blog-post-header .post-category {
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
}

.blog-post-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.blog-post-header .post-meta {
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.draft-notice {
    background: #f59e0b;
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
}

/* Post Content */
.blog-post-content {
    padding: 3rem 0;
    background: #fff;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-body h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
}

.post-body h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body ul,
.post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e4e4e7;
}

.post-tags span {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Post Share */
.post-share {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.post-share span {
    font-weight: 600;
}

.share-link:hover {
    text-decoration: underline;
}

/* User Profile Page */
.user-profile-hero {
    padding: 4rem 0 3rem;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 C60 20, 80 20, 100 10 L100 0 Z' fill='%23ffffff' fill-opacity='0.03'/%3E%3Cpath d='M0 30 C20 50, 40 40, 60 50 C80 60, 90 50, 100 60 L100 100 L0 100 Z' fill='%23ffffff' fill-opacity='0.02'/%3E%3Ccircle cx='20' cy='20' r='2' fill='%23ffffff' fill-opacity='0.05'/%3E%3Ccircle cx='80' cy='40' r='3' fill='%23ffffff' fill-opacity='0.04'/%3E%3Ccircle cx='40' cy='70' r='2' fill='%23ffffff' fill-opacity='0.05'/%3E%3Ccircle cx='90' cy='80' r='1.5' fill='%23ffffff' fill-opacity='0.06'/%3E%3Ccircle cx='10' cy='60' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3Ccircle cx='60' cy='15' r='1.5' fill='%23ffffff' fill-opacity='0.04'/%3E%3Ccircle cx='75' cy='85' r='2' fill='%23ffffff' fill-opacity='0.03'/%3E%3Ccircle cx='30' cy='45' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--color-dark) 0%, var(--color-purple) 100%);
    background-size: 200px 200px, 100% 100%;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.user-profile-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.user-profile-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 50%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(190,49,142,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.user-profile-hero > * {
    position: relative;
    z-index: 1;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-avatar-large .avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.profile-info h1 {
    margin: 0 0 0.25rem;
    font-size: 2.5rem;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.profile-role {
    display: inline-block;
    background: var(--color-magenta);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-streak-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.profile-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-author-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.profile-author-badge svg {
    opacity: 0.8;
}

.profile-joined {
    color: rgba(255, 255, 255, 0.7);
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

.profile-bio {
    color: rgba(255, 255, 255, 0.85);
    margin: 1rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 500px;
}

.profile-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.profile-social .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all var(--transition-fast);
}

.profile-social .social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.profile-bio {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    max-width: 700px;
}

/* Profile Stats */
.profile-stats {
    padding: 3rem 0;
    background: var(--color-bg-subtle);
}

/* Profile Sections */
.profile-section {
    padding: 4rem 0;
}

.profile-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-section .section-header h2 {
    margin: 0;
}

.profile-section .comment-count {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Profile Comments */
.profile-comments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-comment {
    background: var(--color-card-bg);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.profile-comment .comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.profile-comment .comment-post-link {
    color: var(--color-magenta);
    text-decoration: none;
    font-weight: 500;
}

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

.profile-comment .comment-date {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.profile-comment .comment-excerpt {
    margin: 0;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Profile Responsive */
@media (max-width: 768px) {
    .profile-header {
            flex-direction: column;
            text-align: center;
        }
    .profile-info h1 {
            font-size: 1.75rem;
        }
    .profile-social {
            justify-content: center;
        }
    .profile-section .section-header {
            flex-direction: column;
            gap: 1rem;
            text-align: center;
        }
}

/* Blog Responsive */
@media (max-width: 900px) {
    .blog-featured-hero {
            min-height: 50vh;
        }
    .blog-layout {
            grid-template-columns: 1fr;
        }
    .blog-sidebar {
            order: -1;
            flex-direction: row;
            flex-wrap: wrap;
        }
}

@media (max-width: 600px) {
    .blog-featured-hero {
            min-height: 60vh;
        }
    .blog-featured-hero h1 {
            font-size: 1.75rem;
        }
}

/* Blog section */
[data-theme="dark"] .blog-section {
    background: var(--color-bg);
}

[data-theme="dark"] .blog-filter-info {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

[data-theme="dark"] .blog-search input {
    background: var(--color-input-bg);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

[data-theme="dark"] .blog-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .blog-card-content {
    color: var(--color-text);
}

[data-theme="dark"] .blog-card-content h3 {
    color: var(--color-text);
}

[data-theme="dark"] .blog-card-content p {
    color: var(--color-text-muted);
}

[data-theme="dark"] .post-meta {
    color: var(--color-text-muted);
}

[data-theme="dark"] .blog-pagination {
    border-top-color: var(--color-border);
}

[data-theme="dark"] .pagination-info {
    color: var(--color-text-muted);
}

[data-theme="dark"] .blog-empty {
    background: var(--color-bg-subtle);
}

[data-theme="dark"] .blog-empty p {
    color: var(--color-text-muted);
}

[data-theme="dark"] .post-tags {
    border-top-color: var(--color-border);
}

[data-theme="dark"] .post-tags span {
    color: var(--color-text-muted);
}

/* Blog post content */
[data-theme="dark"] .blog-post-content {
    background: var(--color-card-bg);
}

/* User profile dark mode */
/* User profile hero dark mode */
[data-theme="dark"] .user-profile-hero {
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 C60 20, 80 20, 100 10 L100 0 Z' fill='%23be318e' fill-opacity='0.15'/%3E%3Cpath d='M0 30 C20 50, 40 40, 60 50 C80 60, 90 50, 100 60 L100 100 L0 100 Z' fill='%23be318e' fill-opacity='0.08'/%3E%3Ccircle cx='20' cy='20' r='2' fill='%23be318e' fill-opacity='0.2'/%3E%3Ccircle cx='80' cy='40' r='3' fill='%239333ea' fill-opacity='0.15'/%3E%3Ccircle cx='40' cy='70' r='2' fill='%23be318e' fill-opacity='0.2'/%3E%3Ccircle cx='90' cy='80' r='1.5' fill='%239333ea' fill-opacity='0.25'/%3E%3Ccircle cx='10' cy='60' r='1' fill='%23be318e' fill-opacity='0.2'/%3E%3Ccircle cx='60' cy='15' r='1.5' fill='%239333ea' fill-opacity='0.15'/%3E%3Ccircle cx='75' cy='85' r='2' fill='%23be318e' fill-opacity='0.12'/%3E%3Ccircle cx='30' cy='45' r='1' fill='%239333ea' fill-opacity='0.2'/%3E%3C/svg%3E"),
        linear-gradient(135deg, #0a0a0c 0%, #1a1025 50%, #2d1f3d 100%);
    background-size: 200px 200px, 100% 100%;
}

[data-theme="dark"] .user-profile-hero::before {
    background: radial-gradient(ellipse, rgba(147,51,234,0.2) 0%, transparent 70%);
}

[data-theme="dark"] .user-profile-hero::after {
    background: radial-gradient(ellipse, rgba(190,49,142,0.25) 0%, transparent 60%);
}

[data-theme="dark"] .profile-stats {
    background: #09090b;
}

[data-theme="dark"] .profile-comment {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
}

/* Author link in regular content areas */
.post-author .author-link {
    font-weight: 500;
}
