/* ============================================================
   blog.css — Alvasya Blog Styles
   Uses the existing design system: DM Sans, --primary-color (#8364e2)
   ============================================================ */

/* ── Hero Section ── */
.blog-hero-section {
    background-color: #fff;
    background-image:
        radial-gradient(at 0%   50%, hsla(190, 100%, 76%, 0.8) 0, hsla(190, 100%, 76%, 0) 60%),
        radial-gradient(at 100% 50%, hsla(260, 100%, 80%, 0.7) 0, hsla(260, 100%, 80%, 0) 60%),
        radial-gradient(at 50%  0%,  hsla(330, 100%, 85%, 0.4) 0, hsla(330, 100%, 85%, 0) 50%);
    padding: 130px 0 60px;
    text-align: center;
}

.blog-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #8364e2, #d396ff);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 18px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.blog-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    color: #1a1a1a;
    margin-bottom: 18px;
}

.blog-hero-subtext {
    font-size: 1.1rem;
    color: #7d7d7d;
    max-width: 580px;
    margin: 0 auto;
}

/* ── Category Filter Bar ── */
.blog-filter-bar {
    padding: 20px 0 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #7d7d7d;
    background: #f4f4f8;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-pill:hover {
    background: #ede8fa;
    color: #8364e2;
}

.category-pill.active {
    background: #8364e2;
    color: #fff;
    border-color: #8364e2;
}

.cat-count {
    background: rgba(255,255,255,0.3);
    border-radius: 50px;
    padding: 1px 7px;
    font-size: 0.7rem;
}

.category-pill:not(.active) .cat-count {
    background: #e0dcf5;
    color: #8364e2;
}

/* ── Blog Grid Section ── */
.blog-grid-section {
    padding: 60px 0 80px;
}

/* ── Blog Card ── */
.blog-card {
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(131,100,226,0.12);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-image-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0edf9;
}

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

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

.blog-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #c9b8f0;
    background: linear-gradient(135deg, #f0edf9, #e8e2f8);
}

.blog-card-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #8364e2;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: #7d7d7d;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: auto;
    flex-wrap: wrap;
}

/* ── Featured Post Card ── */
.blog-featured-card {
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 40px rgba(131,100,226,0.12);
    border: 1px solid rgba(131,100,226,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(131,100,226,0.18);
}

.blog-featured-link {
    text-decoration: none;
    color: inherit;
}

.blog-featured-image-wrap {
    height: 100%;
    min-height: 320px;
    overflow: hidden;
}

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

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

.blog-featured-placeholder {
    width: 100%;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: #c9b8f0;
    background: linear-gradient(135deg, #f0edf9, #e8e2f8);
}

.blog-featured-body {
    background: #fff;
}

.blog-featured-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 900;
    line-height: 1.2;
    color: #1a1a1a;
    margin-bottom: 14px;
}

.blog-featured-excerpt {
    font-size: 1rem;
    color: #7d7d7d;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #8364e2, #d396ff);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-featured-card:hover .blog-read-more-btn {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(131,100,226,0.35);
}

/* ── Category Badge ── */
.blog-cat-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(131,100,226,0.15);
    color: #8364e2;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border: 1px solid rgba(131,100,226,0.25);
}

/* ── Blog Meta ── */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #999;
    flex-wrap: wrap;
}

.blog-meta-author { font-weight: 600; }
.blog-meta-sep { opacity: 0.4; }

/* ── Pagination ── */
.blog-pagination-wrap {
    margin-top: 60px;
}

.blog-page-link {
    border-radius: 50px !important;
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    border-color: #eee;
    color: #7d7d7d;
    transition: all 0.2s;
}

.blog-page-link:hover {
    background: #8364e2;
    border-color: #8364e2;
    color: #fff;
}

.page-item.active .blog-page-link {
    background: #8364e2;
    border-color: #8364e2;
}

/* ============================================================
   Article / Single Post Styles
   ============================================================ */

.article-hero-section {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    padding-top: 100px;
    overflow: hidden;
}

.article-hero-image-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.article-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,5,30,0.85) 0%, rgba(10,5,30,0.3) 60%, rgba(10,5,30,0.1) 100%);
}

.article-hero-no-image {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8364e2 0%, #d396ff 100%);
    z-index: 0;
}

.article-hero-content {
    position: relative;
    z-index: 1;
    color: #fff;
}

.article-hero-section:not(:has(.article-hero-image-wrap)) .blog-cat-badge,
.article-hero-no-image ~ .article-hero-content .blog-cat-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.article-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
    max-width: 800px;
    margin-bottom: 18px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.article-cat-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

.article-cat-link:hover { color: #fff; }

/* ── Article Body ── */
.article-body-section {
    padding: 70px 0 60px;
}

.article-lead {
    font-size: 1.2rem;
    color: #555;
    line-height: 1.7;
    border-left: 4px solid #8364e2;
    padding-left: 20px;
    margin-bottom: 40px;
    font-style: italic;
}

/* ── Rich Text Content ── */
.blog-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #333;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5 {
    font-weight: 800;
    margin-top: 2em;
    margin-bottom: 0.6em;
    color: #1a1a1a;
}

.blog-content h2 { font-size: 1.6rem; }
.blog-content h3 { font-size: 1.3rem; }
.blog-content h4 { font-size: 1.1rem; }

.blog-content p { margin-bottom: 1.4em; }

.blog-content a {
    color: #8364e2;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content a:hover { color: #d396ff; }

.blog-content ul,
.blog-content ol {
    padding-left: 1.8em;
    margin-bottom: 1.4em;
}

.blog-content li { margin-bottom: 0.5em; }

.blog-content blockquote {
    border-left: 4px solid #8364e2;
    padding: 16px 24px;
    background: #f8f5ff;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
    font-style: italic;
    color: #555;
}

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

.blog-content code {
    background: #f4f0ff;
    color: #8364e2;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.9em;
}

.blog-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
}

.blog-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.blog-content hr {
    border: none;
    border-top: 2px solid #f0edf9;
    margin: 36px 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.blog-content table th,
.blog-content table td {
    padding: 12px 16px;
    border: 1px solid #eee;
}

.blog-content table th {
    background: #f8f5ff;
    font-weight: 800;
}

.blog-content table tr:nth-child(even) td {
    background: #fafafa;
}

/* ── Author Card ── */
.article-author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8f5ff;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid rgba(131,100,226,0.15);
}

.author-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8364e2, #d396ff);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Related Posts Section ── */
.related-posts-section {
    background: #f8f5ff;
    padding: 70px 0 80px;
    border-top: 1px solid rgba(131,100,226,0.1);
}

.related-posts-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 36px;
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .blog-hero-section { padding: 110px 0 50px; }
    .article-hero-section { min-height: 360px; }
    .blog-featured-image-wrap { min-height: 240px; }
    .blog-featured-body { padding: 28px; }
    .article-body-section { padding: 40px 0 40px; }
    .blog-filter-bar { top: 65px; overflow-x: auto; }
}
