/* public/static/css/blog.css */

:root {
    --primary-purple: #331042;
    --accent-purple: #4d1963;
    --light-purple: #f8f4ff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --white: #ffffff;
    --card-shadow: 0 10px 30px rgba(51, 16, 66, 0.08);
    --card-shadow-hover: 0 20px 40px rgba(51, 16, 66, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scoped Grid System to replace Bootstrap without conflicts */
.blog-collection-container .container,
.single-blog-container .container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    max-width: 1200px;
}

.blog-collection-container .row,
.single-blog-container .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.blog-collection-container .col,
.single-blog-container .col {
    flex: 1 0 0%;
    padding-right: 15px;
    padding-left: 15px;
}

/* 3 column grid for collection */
.blog-collection-container #blog-grid .col {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-bottom: 30px;
}

/* 2 column grid for single blog (8/4 split) */
.single-blog-container .col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding-right: 15px;
    padding-left: 15px;
}

.single-blog-container .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Utilities */
.blog-collection-container .mt-3,
.single-blog-container .mt-3 {
    margin-top: 1rem !important;
}

.blog-collection-container .text-muted,
.single-blog-container .text-muted {
    color: #6c757d !important;
}

@media (max-width: 991px) {
    .blog-collection-container #blog-grid .col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .single-blog-container .col-lg-8,
    .single-blog-container .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .blog-collection-container #blog-grid .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.blog-collection-container {
    padding-bottom: 40px;
    background-color: #fbfaff;
}

/* Blog Hero */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-purple) 100%);
    padding: 60px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: -40px;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.blog-hero .hero-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
    position: relative;
    letter-spacing: -1px;
}

.blog-hero .hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9) !important;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative;
}

/* Blog Grid */
#blog-grid {
    position: relative;
    z-index: 10;
}

/* Blog Card */
.blog-card {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(51, 16, 66, 0.05);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(51, 16, 66, 0.1);
}

.blog-card-img-container {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

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

.blog-card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(51, 16, 66, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-card-img-overlay {
    opacity: 1;
}

.blog-category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--white);
    color: var(--primary-purple);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 5;
    transition: var(--transition);
}

.blog-card:hover .blog-category-tag {
    background: var(--primary-purple);
    color: var(--white);
}

.blog-card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 12px;
    transition: var(--transition);
}

.blog-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card:hover .blog-title {
    color: var(--accent-purple);
}

.blog-excerpt {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f1eff5;
}

.blog-read-more {
    color: var(--primary-purple);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.blog-read-more i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.blog-read-more:hover {
    color: var(--accent-purple);
}

.blog-read-more:hover i {
    transform: translateX(4px);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-gray);
    font-size: 13px;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Loader */
.loader {
    padding: 60px 0;
    text-align: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(51, 16, 66, 0.1);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

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

.no-results-icon {
    font-size: 64px;
    color: #e2e8f0;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 991px) {
    .blog-hero .hero-title {
        font-size: 38px;
    }
}

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

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

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

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

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    opacity: 0;
}

/* Single Blog Page */
.single-blog-container {
    background: #fbfaff;
    padding-bottom: 40px;
}

.blog-hero-section {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-purple) 100%);
    padding: 60px 0 60px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.blog-hero-section .blog-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: var(--white);
}

.blog-meta-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.meta-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(5px);
}

.meta-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.meta-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.blog-content-wrapper {
    background: var(--white);
    padding: 50px;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.blog-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-dark);
}

.blog-content p {
    margin-bottom: 25px;
}

.blog-content h2,
.blog-content h3 {
    color: var(--primary-purple);
    font-weight: 700;
    margin: 40px 0 20px;
}

.blog-content img {
    max-width: 100%;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.blog-sidebar {
    padding-top: 40px;
}

.sidebar-section {
    background: var(--white);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-purple);
}

.related-blog-card {
    display: flex;
    gap: 15px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: var(--transition);
}

.related-blog-card:hover {
    transform: translateX(5px);
}

.related-blog-image {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-blog-content h6 {
    font-size: 15px;
    font-weight: 650;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}

.related-blog-meta {
    font-size: 13px;
    color: var(--text-gray);
}

/* Share & Newsletter */
.social-share-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.social-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-btn {
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--white) !important;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.facebook-btn {
    background: #3b5998;
}

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

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

.social-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.newsletter-text {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.newsletter-form .form-control {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.btn-subscribe {
    width: 100%;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-subscribe:hover {
    background: var(--accent-purple);
}

@media (max-width: 991px) {
    .blog-content-wrapper {
        padding: 30px;
    }

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

@media (max-width: 767px) {
    .blog-hero-section {
        padding: 50px 0 40px;
    }

    .blog-meta-info {
        gap: 15px;
    }

    .meta-item {
        width: 100%;
        justify-content: center;
    }
}