/* ============================================
   Blog Styles - CampusMint
============================================ */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
    padding: 120px 0 60px;
    text-align: center;
}

.blog-hero-content h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 12px;
}

.blog-hero-content p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* Search Bar */
.blog-search-bar {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 16px 48px;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 50px;
    background: white;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-lighter);
}

.search-clear {
    position: absolute;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--border);
    color: var(--text);
}

.search-clear svg {
    width: 14px;
    height: 14px;
}

/* Blog Main Layout */
.blog-main {
    padding: 60px 0;
    background: var(--bg);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.category-pill {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.category-pill:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.category-pill.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

/* Featured Post */
.featured-post {
    margin-bottom: 48px;
}

.featured-post-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.featured-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.featured-post-image {
    height: 100%;
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.featured-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: 50px;
}

.featured-post-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post-content .post-category {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.featured-post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.featured-post-content h2 a {
    color: inherit;
}

.featured-post-content h2 a:hover {
    color: var(--primary);
}

.featured-post-content .post-excerpt {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
}

.featured-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-lighter);
}

.featured-post-meta .author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-post-meta .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.blog-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-card-content {
    padding: 24px;
}

.blog-card-content .post-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.blog-card-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-content h3 a {
    color: inherit;
}

.blog-card-content h3 a:hover {
    color: var(--primary);
}

.blog-card-content .post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-lighter);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.blog-card-meta .reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-meta svg {
    width: 14px;
    height: 14px;
}

/* Loading Spinner */
.blog-loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.blog-loading p {
    color: var(--text-light);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results svg {
    width: 80px;
    height: 80px;
    color: var(--border);
    margin-bottom: 24px;
}

.no-results h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: var(--text-lighter);
}

/* Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-widget {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.widget-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-post-item {
    display: flex;
    gap: 14px;
}

.popular-post-item:hover h4 {
    color: var(--primary);
}

.popular-post-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.popular-post-content span {
    font-size: 12px;
    color: var(--text-lighter);
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    border-radius: var(--radius);
    transition: var(--transition);
}

.category-list li a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.category-list li a span {
    font-size: 12px;
    color: var(--text-lighter);
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 50px;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-light);
    border-radius: 50px;
    transition: var(--transition);
}

.tag-link:hover {
    color: white;
    background: var(--primary);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.newsletter-widget .widget-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.newsletter-widget .widget-title svg {
    color: white;
}

.newsletter-widget p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input {
    padding: 12px 16px;
    font-size: 14px;
    border: none;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.2);
    color: white;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-form .btn {
    background: white;
    color: var(--primary);
}

.newsletter-form .btn:hover {
    background: var(--bg-light);
}

/* ============================================
   Blog Post Page Styles
============================================ */

/* Loading Skeleton */
.post-loading {
    padding: 120px 0 60px;
}

.loading-skeleton {
    max-width: 800px;
    margin: 0 auto;
}

.skeleton-breadcrumb {
    width: 200px;
    height: 16px;
    background: var(--bg-dark);
    border-radius: 4px;
    margin-bottom: 24px;
}

.skeleton-title {
    width: 80%;
    height: 40px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.skeleton-meta {
    width: 300px;
    height: 20px;
    background: var(--bg-dark);
    border-radius: 4px;
    margin-bottom: 32px;
}

.skeleton-image {
    width: 100%;
    height: 400px;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.skeleton-content .skeleton-line {
    height: 16px;
    background: var(--bg-dark);
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-breadcrumb,
.skeleton-title,
.skeleton-meta,
.skeleton-image,
.skeleton-line {
    background: linear-gradient(90deg, var(--bg-dark) 25%, var(--bg-light) 50%, var(--bg-dark) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Post Not Found */
.post-not-found {
    padding: 120px 0;
    text-align: center;
}

.not-found-content svg {
    width: 100px;
    height: 100px;
    color: var(--border);
    margin-bottom: 24px;
}

.not-found-content h1 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 12px;
}

.not-found-content p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Breadcrumb */
.breadcrumb-section {
    padding: 100px 0 0;
    background: var(--bg-light);
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

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

.breadcrumb .separator {
    margin: 0 10px;
    color: var(--border);
}

/* Post Header */
.post-header {
    padding: 32px 0;
    background: var(--bg-light);
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.post-categories a {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-categories a:hover {
    background: var(--primary);
    color: white;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 24px;
    max-width: 800px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.author-details {
    display: flex;
    flex-direction: column;
}

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

.post-date {
    font-size: 14px;
    color: var(--text-lighter);
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-light);
}

.post-stats svg {
    width: 18px;
    height: 18px;
}

/* Featured Image */
.post-featured-image {
    padding: 0 0 48px;
    background: linear-gradient(to bottom, var(--bg-light) 50%, white 50%);
}

.post-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Post Body Layout */
.post-body {
    padding: 48px 0;
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
}

/* Post Content */
.post-content {
    max-width: 100%;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--secondary);
    margin: 2em 0 0.75em;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.75rem;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.post-content h3 {
    font-size: 1.375rem;
}

.post-content h4 {
    font-size: 1.125rem;
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
}

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

.post-content img {
    border-radius: var(--radius);
    margin: 2em 0;
    box-shadow: var(--shadow);
}

.post-content ul,
.post-content ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.post-content li {
    margin-bottom: 0.75em;
}

.post-content ul li {
    list-style: disc;
}

.post-content ol li {
    list-style: decimal;
}

.post-content blockquote {
    margin: 2em 0;
    padding: 24px 32px;
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}

.post-content pre {
    margin: 2em 0;
    padding: 24px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-content code {
    padding: 2px 6px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875em;
}

.post-content pre code {
    padding: 0;
    background: transparent;
}

.post-content table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--bg-light);
    font-weight: 600;
}

.post-content hr {
    margin: 3em 0;
    border: none;
    border-top: 2px solid var(--border);
}

/* Post Sidebar */
.post-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* TOC Widget */
.toc-widget h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc a {
    font-size: 14px;
    color: var(--text-light);
    padding: 6px 12px;
    border-left: 2px solid transparent;
    transition: var(--transition);
}

.toc a:hover,
.toc a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(34, 197, 94, 0.05);
}

.toc a.toc-h3 {
    padding-left: 24px;
    font-size: 13px;
}

/* Share Widget */
.share-widget h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.whatsapp {
    background: #25d366;
    color: white;
}

.share-btn.copy {
    background: var(--bg-dark);
    color: var(--text);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Post Tags Section */
.post-tags-section {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tags a {
    padding: 8px 18px;
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-light);
    border-radius: 50px;
    transition: var(--transition);
}

.post-tags a:hover {
    color: white;
    background: var(--primary);
}

/* Author Bio */
.author-bio-section {
    padding: 48px 0;
    background: var(--bg-light);
}

.author-bio {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 700px;
}

.author-bio-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.author-bio-content h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.author-bio-content h3 span {
    color: var(--secondary);
}

.author-bio-content p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Related Posts */
.related-posts-section {
    padding: 60px 0;
}

.related-posts-section .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 32px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: var(--secondary);
    color: white;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   Responsive Styles
============================================ */

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .post-sidebar > * {
        flex: 1 1 200px;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 100px 0 40px;
    }

    .blog-hero-content h1 {
        font-size: 2rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

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

    .featured-post-image {
        min-height: 200px;
    }

    .blog-sidebar {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .category-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .category-pill {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .blog-hero-content h1 {
        font-size: 1.75rem;
    }

    .featured-post-content {
        padding: 20px;
    }

    .featured-post-content h2 {
        font-size: 1.25rem;
    }

    .blog-card-content {
        padding: 16px;
    }

    .post-featured-image img {
        border-radius: var(--radius);
    }

    .share-buttons {
        justify-content: center;
    }
}
