/* ===== BLOG STYLES (Dark Mode) ===== */

/* Base settings */
body#blog {
    --menu-height: 72px;
}

main.container {
    margin-top: 0;
    padding-top: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero section overrides - consolidated for perfect centering */
body#blog .hero {
    margin: 24px auto 40px !important;
}

body#blog .hero-section {
    padding: 2rem 2rem !important;
    border-radius: 24px !important;
}

/* Section title overrides */
.blog-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title {
    text-align: center;
    margin: 0 0 0.25rem 0;
    font-size: 24px;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Blog Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    justify-content: center;
    padding: 2rem 0;
}

/* Blog Cards - Glassmorphism Dark Theme (Unified) */
.products-grid .card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: rgba(50, 50, 55, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    padding: 0;
    /* CSS variables for mouse position */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

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

/* Reflective spotlight effect (ReactBits inspired) */
.products-grid .card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(99, 102, 241, 0.12),
            rgba(139, 92, 246, 0.06) 25%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.products-grid .card:hover::after {
    opacity: 1;
}

/* Card hover glow border effect */
.products-grid .card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.4) 0%,
            rgba(139, 92, 246, 0.2) 50%,
            transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

.products-grid .card:hover::before {
    opacity: 1;
}

.products-grid .card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(99, 102, 241, 0.15);
}

/* Card thumbnail */
.products-grid .card .thumb {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: rgba(40, 40, 45, 1);
    position: relative;
    z-index: 2;
    border-radius: 0;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.products-grid .card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.products-grid .card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.products-grid .card:hover .thumb img {
    transform: scale(1.1);
}

/* Card body */
.products-grid .card .card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Tags */
.products-grid .card .tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    width: fit-content;
}

.tag-teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.tag-purple {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.tag-pink {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

/* Card typography */
.products-grid .card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    line-height: 1.35;
    color: var(--text-primary);
    font-weight: 600;
}

.products-grid .card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Card link */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Truncation */
.products-grid .card .card-body h3,
.products-grid .card .card-body p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-grid .card .card-body h3 {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.products-grid .card .card-body p {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Responsive */
@media (max-width: 780px) {
    .products-grid {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .products-grid .card {
        max-width: 100%;
    }
}


body#blog .hero-section h1 {
    font-size: 2.2rem !important;
    line-height: 1.1 !important;
    margin: 0 0 0.5rem 0 !important;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body#blog .hero-section p {
    margin: 0 !important;
    font-size: 1rem !important;
    color: var(--text-secondary) !important;
}

/* ===== POST PAGE STYLES ===== */
body.post,
body#blog {
    --menu-height: 72px;
}

.post-hero {
    max-height: 500px;
    overflow: hidden;
    border-radius: 24px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-hero img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

@media (max-width: 640px) {
    .post-hero {
        max-height: 280px;
    }
}

body.post main.container {
    padding-top: calc(var(--menu-height));
    padding-bottom: 60px;
}

/* Post title */
.post-title {
    text-align: center;
    margin: 1rem 0 1.5rem 0;
}

.post-title h1 {
    margin: 0;
    font-size: 2.2rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-size: 1.1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Article content */
article {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    color: var(--text-primary);
}

article h2 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

article p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

article ul,
article ol {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

article li {
    margin-bottom: 0.5rem;
}

article strong {
    color: var(--text-primary);
}

/* CTA Button */
.primary-cta {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-radius: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* Post navigation */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.post-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.post-nav a:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.post-nav .prev::before {
    content: '←';
    margin-right: 6px;
    opacity: 0.7;
}

.post-nav .next::after {
    content: '→';
    margin-left: 6px;
    opacity: 0.7;
}

.post-nav .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Post footer */
.post-meta {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2rem;
}

.post-meta p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Article images */
article img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    margin: 1.5rem 0;
}