/* ========================================
   KARMAVYAA — Blog CSS
   Blog listing (archive.php) + Single article (single.php)
   ======================================== */

/* Blog pages: slightly warm background (inherits font/smoothing from global.css) */
body {
    background: #FAFAFA;
}

/* ========================================
   BLOG LISTING — HERO
   ======================================== */
.hero {
    position: relative;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-top: clamp(80px, 10vh, 100px);
    padding-bottom: clamp(32px, 5vh, 56px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.7)), url('https://images.unsplash.com/photo-1515378960530-7c0da6231fb1?q=80&w=2670&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
    animation: fadeUp 1s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: clamp(20px, 3vh, 32px);
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: var(--text-5xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: clamp(28px, 4vh, 44px);
    color: var(--white);
}

.hero h1 span {
    font-style: italic;
    color: #F4C430;
}

.hero p {
    font-family: 'Inter', sans-serif;
    font-size: var(--text-xl);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: clamp(24px, 3vh, 36px);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   BLOG LISTING — CONTAINER & FILTER
   ======================================== */
.blog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 60px 40px;
}

.filter-heading {
    text-align: center;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.category-filter {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 24px;
    border-radius: 50px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.category-btn.active, .category-btn:hover {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ========================================
   BLOG LISTING — FEATURED POST
   ======================================== */
.featured-post {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    margin-bottom: 80px;
    border: 1px solid var(--gray-200);
    transition: transform 0.3s ease;
    text-decoration: none;
}

.featured-post:hover { transform: translateY(-5px); }

.featured-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
}

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

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

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

.post-tag {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(79, 70, 229, 0.1);
    padding: var(--space-2) var(--space-3);
    border-radius: 50px;
    margin-bottom: var(--space-4);
    width: fit-content;
}

.featured-title {
    font-size: var(--text-2xl);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--dark);
}

.featured-excerpt {
    color: var(--gray-600);
    font-size: var(--text-lg);
    margin-bottom: 30px;
    line-height: 1.6;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: 30px;
}

.author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    font-size: var(--text-base);
    display: flex;
    flex-direction: column;
}

.author-name { font-weight: 700; color: var(--dark); }
.post-date { color: var(--gray-500); }

.btn-read-featured {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    width: fit-content;
    transition: all 0.3s;
}

.btn-read-featured:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* ========================================
   BLOG LISTING — POST GRID
   ======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.post-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    text-decoration: none;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: rgba(79, 70, 229, 0.3);
}

.post-img-wrapper {
    height: 190px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    border-bottom: 4px solid transparent;
    transition: all 0.3s;
}

.post-card:hover .post-img-wrapper { border-bottom-color: var(--primary); }

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

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

.post-content {
    padding: 24px 8px 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    font-size: var(--text-xs);
}

.card-tag {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
    padding: 4px 10px;
    border-radius: 4px;
}

.card-date { color: var(--gray-400); }

.post-title {
    font-size: var(--text-xl);
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 700;
}

.post-excerpt {
    font-size: var(--text-md);
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.read-more {
    color: var(--dark);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--text-sm);
    text-transform: uppercase;
    border-radius: 6px;
    min-height: 36px;
    letter-spacing: 0.3px;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.read-more:hover {
    gap: var(--space-2);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

.read-more:active {
    background: rgba(79, 70, 229, 0.08);
}

/* No posts message */
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--gray-500);
    font-size: var(--text-lg);
}

/* ========================================
   BLOG LISTING — NEWSLETTER
   ======================================== */
.newsletter-section {
    background: var(--dark);
    padding: 60px 0 50px;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 24px;
}

.newsletter-content h2 {
    color: var(--white);
    font-size: clamp(38px, 4.5vw, 53px);
    margin-bottom: 16px;
}

.newsletter-content p {
    color: var(--gray-400);
    font-size: var(--text-lg);
    margin-bottom: 40px;
}

.newsletter-form {
    display: flex;
    gap: var(--space-3);
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex-grow: 1;
    padding: 16px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.newsletter-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.newsletter-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%);
    color: var(--white);
    border: none;
    padding: 13px 32px;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 600;
    font-size: var(--text-md);
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.28s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.24), 0 1px 3px rgba(79, 70, 229, 0.12);
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35), 0 3px 6px rgba(79, 70, 229, 0.15);
}

.newsletter-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.24);
}

/* ========================================
   SINGLE ARTICLE — HEADER
   ======================================== */
.article-header {
    padding-top: 140px;
    padding-bottom: 60px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.article-header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: var(--text-base);
    color: var(--gray-500);
}

.article-breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.3s;
}

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

.article-category {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(79, 70, 229, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.article-title {
    font-family: 'Playfair Display', serif;
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 24px;
}

.article-excerpt {
    font-size: var(--text-xl);
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 32px;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details { text-align: left; }

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

.article-date {
    color: var(--gray-500);
    font-size: var(--text-base);
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    font-size: var(--text-base);
}

/* ========================================
   SINGLE ARTICLE — FEATURED IMAGE
   ======================================== */
.article-featured-image {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 40px;
}

.article-featured-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   SINGLE ARTICLE — LAYOUT + TOC
   ======================================== */
.article-layout {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    gap: 60px;
    padding: 0 40px;
}

.toc-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc {
    padding: 24px 0;
    border-left: 2px solid var(--gray-200);
}

.toc-title {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    padding: 0 0 16px 20px;
    margin: 0;
}

.toc-list { list-style: none; padding: 0; margin: 0; }

.toc-link {
    display: block;
    padding: 6px 20px;
    font-size: var(--text-base);
    color: var(--gray-500);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: all 0.2s;
    line-height: 1.5;
}

.toc-link:hover { color: var(--primary); }
.toc-link.toc-h3 { padding-left: 36px; font-size: var(--text-sm); }
.toc-link.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* ========================================
   SINGLE ARTICLE — CONTENT
   ======================================== */
.article-content {
    max-width: 720px;
    min-width: 0;
    flex: 1;
    padding: 0 0 80px;
}

.article-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--dark);
    margin: 48px 0 24px;
    line-height: 1.3;
}

.article-content h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--dark);
    margin: 36px 0 16px;
}

.article-content p {
    font-size: var(--text-lg);
    line-height: 1.9;
    color: var(--gray-600);
    margin-bottom: 24px;
}

.article-content ul, .article-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

.article-content li {
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
}

.article-content blockquote {
    margin: 40px 0;
    padding: 32px 40px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 16px 16px 0;
}

.article-content blockquote p {
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--dark);
    margin-bottom: 0;
}

.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: #312E81; }
.article-content img { width: 100%; border-radius: 16px; margin: 32px 0; }

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: 40px;
    border-top: 1px solid var(--gray-200);
    margin-top: 40px;
}

.article-tag {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}

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

/* Share */
.share-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 40px;
}

.share-label { font-weight: 600; color: var(--dark); }
.share-buttons { display: flex; gap: var(--space-3); }

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.3s;
}

.share-btn:hover { background: var(--primary); color: var(--white); }

/* ========================================
   SINGLE ARTICLE — RELATED
   ======================================== */
.related-section { background: var(--gray-50); padding: 80px 0; }
.related-container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.related-title {
    font-family: 'Playfair Display', serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    margin-bottom: 48px;
}

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

.related-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    text-decoration: none;
}

.related-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); }

.related-card-image { height: 200px; overflow: hidden; }
.related-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.related-card:hover .related-card-image img { transform: scale(1.1); }

.related-card-content { padding: 24px; }
.related-card-tag { font-size: var(--text-xs); font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.related-card-title { font-size: var(--text-lg); font-weight: 700; color: var(--dark); margin: 12px 0; line-height: 1.4; }
.related-card-date { font-size: var(--text-sm); color: var(--gray-500); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .featured-post { grid-template-columns: 1fr; }
    .featured-img-wrapper { height: 300px; min-height: auto; }
    .featured-content { padding: 40px; }
    .posts-grid { grid-template-columns: 1fr 1fr; }

    .toc-sidebar { display: none; }
    .article-layout { padding: 0; }
    .article-content { max-width: 720px; margin: 0 auto; padding: 0 40px 80px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero { height: 100dvh; padding: clamp(100px, 14vh, 120px) 24px clamp(48px, 6vh, 64px); }
    .blog-container { padding: 36px 24px; text-align: center; }
    .posts-grid { grid-template-columns: 1fr; padding: 0; text-align: center; }
    .post-card { text-align: left; padding: 20px; }
    .newsletter-form { flex-direction: column; }
    .newsletter-btn { width: 100%; }
    .newsletter-section { padding: 36px 0 30px; }

    .article-header { padding-top: 120px; padding-bottom: 40px; }
    .article-header-container { padding: 0 24px; }
    .article-meta { flex-direction: column; gap: 16px; }
    .article-featured-image { padding: 0 24px; margin-bottom: 40px; }
    .article-featured-image img { height: 300px; }
    .article-content { padding: 0 24px 60px; }
    .article-content blockquote { padding: 24px; }
    .related-container { padding: 0 24px; }
    .related-grid { grid-template-columns: 1fr; gap: 24px; }
    .share-section { flex-direction: column; gap: 16px; }
}

@media (max-width: 480px) {
    .blog-container { padding: 24px 20px; }
    .posts-grid { gap: 20px; }
    .post-card { padding: 18px; }
    .newsletter-section { padding: 24px 0 20px; }
    .article-featured-image img { height: 220px; border-radius: 16px; }
    .article-content { padding: 0 20px 50px; }
    .related-container { padding: 0 20px; }
}

@media (max-width: 375px) {
    .blog-container { padding: 20px 16px; }
    .posts-grid { gap: 16px; }
    .article-header-container { padding: 0 16px; }
    .article-featured-image { padding: 0 16px; }
    .article-content { padding: 0 16px 40px; }
    .related-container { padding: 0 16px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .hero { height: auto; min-height: 100dvh; max-height: none; overflow-y: visible; padding-top: clamp(58px, 14vh, 72px); background-attachment: scroll; }
    .article-header { padding-top: 80px; padding-bottom: 32px; }
    .article-layout { flex-direction: column; gap: 32px; padding: 0 20px; }
    .toc-sidebar { width: 100%; position: static; max-height: none; display: block; }
}
