/**
 * Premium Blog Redesign for MaxCloud Mart
 * Cyberpunk / Glassmorphism Editorial Theme
 */

/* ==========================================================================
   1. Reading Progress Bar
   ========================================================================== */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}
.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #28C7FF, #FF3EB5);
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   2. Cinematic Hero
   ========================================================================== */
.blog-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    height: 60vh;
    min-height: 450px;
    max-height: 650px;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
}
@media (max-width: 768px) {
    .blog-hero {
        height: 350px;
        min-height: 350px;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        padding-bottom: 2rem;
    }
}
.blog-hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 10s ease-out;
}
.blog-hero:hover .blog-hero-bg {
    transform: scale(1.1);
}
.blog-hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(9, 18, 33, 0.2) 0%, rgba(9, 18, 33, 0.95) 100%);
    z-index: 2;
}
.blog-hero-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none;
    /* Optional: add tiny white dots background with subtle parallax in JS or CSS */
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particlesDrift 60s linear infinite;
}
@keyframes particlesDrift {
    0% { background-position: 0 0; }
    100% { background-position: -500px -500px; }
}

.blog-hero-content {
    position: relative;
    z-index: 10;
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
    color: #F6F8FF;
}

.blog-hero-category {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(40, 199, 255, 0.15);
    border: 1px solid rgba(40, 199, 255, 0.3);
    color: #28C7FF;
    border-radius: 99px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}
.blog-hero-category:hover {
    background: rgba(40, 199, 255, 0.25);
    color: #fff;
}

.blog-hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.blog-hero-excerpt {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(246, 248, 255, 0.8);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.meta-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.meta-avatar-badge {
    height: 40px;
    width: auto;
    max-width: 120px;
    border-radius: 12px;
    background: rgba(9, 18, 33, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.meta-avatar-badge img {
    height: 100%;
    width: auto;
    max-height: 28px;
    object-fit: contain;
}
.meta-author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.meta-author-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}
.meta-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   3. Main Grid Layout
   ========================================================================== */
.blog-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 1024px) {
    .blog-main-grid {
        grid-template-columns: minmax(0, 850px) 60px;
        justify-content: center;
    }
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Table of Contents */
.blog-toc-sticky {
    position: sticky;
    top: 120px;
}
.toc-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #28C7FF;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toc-nav a {
    font-size: 0.9rem;
    color: rgba(9, 18, 33, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}
.toc-nav a:hover {
    color: #28C7FF;
}
.toc-nav a.is-active {
    color: #7B3FFF;
    border-left-color: #7B3FFF;
    font-weight: 700;
}
.toc-nav .toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

/* Share Sticky */
.blog-share-container {
    display: flex;
    justify-content: flex-end;
}
.blog-share-sticky {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0.5rem;
    border-radius: 99px;
    background: rgba(9, 18, 33, 0.03);
    border: 1px solid rgba(9, 18, 33, 0.05);
}
@media (max-width: 1023px) {
    .blog-share-container {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 50;
        justify-content: center;
    }
    .blog-share-sticky {
        flex-direction: row;
        width: 100%;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        padding: 0.75rem;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }
}
.share-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #999;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-bottom: 0.5rem;
}
.share-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    color: #091221;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.2s;
    cursor: pointer;
}
.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.share-twitter:hover { color: #1DA1F2; border-color: #1DA1F2; }
.share-facebook:hover { color: #1877F2; border-color: #1877F2; }
.share-whatsapp:hover { color: #25D366; border-color: #25D366; }
.share-copy:hover { color: #7B3FFF; border-color: #7B3FFF; }


/* ==========================================================================
   4. Typography & Reading Experience
   ========================================================================== */
.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #111B33;
}
.entry-content > * {
    margin-bottom: 2rem;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
    color: #091221;
    font-weight: 800;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    scroll-margin-top: 120px;
}
.entry-content h2 { font-size: 2.25rem; }
.entry-content h3 { font-size: 1.75rem; }
.entry-content a:not(.dtc-product-card) {
    color: #7B3FFF;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: all 0.2s;
}
.entry-content a:not(.dtc-product-card):hover {
    color: #FF3EB5;
}
.entry-content img {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: zoom-in;
    transition: transform 0.3s;
    width: 100%;
    height: auto;
}
.entry-content img:hover {
    transform: scale(1.02);
}
.entry-content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}
.entry-content blockquote {
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
    color: #7B3FFF;
    border-left: 4px solid #7B3FFF;
    padding-left: 1.5rem;
    margin: 3rem 0;
    line-height: 1.5;
    background: linear-gradient(to right, rgba(123, 63, 255, 0.05), transparent);
    padding: 2rem;
    border-radius: 0 16px 16px 0;
}
.entry-content ul, .entry-content ol {
    padding-left: 1.5rem;
}
.entry-content li {
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   5. Author Box
   ========================================================================== */
.blog-author-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    background: #091221;
    color: #fff;
    padding: 3rem;
}
@media (min-width: 768px) {
    .blog-author-box {
        flex-direction: row;
        text-align: left;
    }
}
.author-avatar-wrap {
    position: relative;
    width: 130px;
    height: auto;
    flex-shrink: 0;
}
.author-logo-card {
    width: 100%;
    height: 70px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}
.author-logo-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.author-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    background: #7B3FFF;
    filter: blur(20px);
    opacity: 0.5;
    z-index: 1;
    border-radius: 50%;
}
.author-details {
    flex: 1;
}
.author-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #28C7FF;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}
.author-name {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #fff;
}
.author-bio {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.author-expertise {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.expertise-tag {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Products Mentioned Card */
.products-mentioned-wrapper {
    margin: 3rem 0;
    background: rgba(40, 199, 255, 0.05);
    border: 1px solid rgba(40, 199, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
}
.pm-title {
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #28C7FF;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}
.pm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.pm-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    text-decoration: none !important;
    display: block;
    border: 1px solid #e2e8f0;
}
.pm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.pm-img-wrap {
    aspect-ratio: 1;
    background: #f8fafc;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pm-img-wrap img {
    width: auto !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
.pm-info {
    padding: 1rem;
}
.pm-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #091221;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}
.pm-price {
    font-weight: 800;
    color: #7B3FFF;
}

/* Related Cards Category Badges */
.related-card-category a {
    display: inline-block;
    background: rgba(9, 18, 33, 0.8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    text-decoration: none !important;
    transition: all 0.2s;
}
.related-card-category a:hover {
    background: #7B3FFF;
}

/* ==========================================================================
   Mobile Responsiveness & Text Overflow Safety
   ========================================================================== */
.blog-redesign-article {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.blog-hero {
    max-width: 100vw;
    box-sizing: border-box;
}

.blog-hero-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 1.25rem !important;
    box-sizing: border-box !important;
    word-break: break-word;
    overflow-wrap: break-word;
}

.blog-hero-title {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.blog-content-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.entry-content {
    max-width: 100% !important;
    word-break: break-word;
    overflow-wrap: break-word;
}

.entry-content > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.entry-content pre,
.entry-content code,
.entry-content table {
    max-width: 100% !important;
    overflow-x: auto !important;
    word-break: normal;
}

.entry-content img,
.entry-content iframe,
.entry-content video {
    max-width: 100% !important;
    height: auto !important;
}

@media (max-width: 640px) {
    .blog-hero {
        height: auto;
        min-height: 280px;
        padding-top: 5rem;
        padding-bottom: 2.5rem;
    }
    
    .blog-hero-title {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .blog-hero-excerpt {
        font-size: 0.95rem !important;
        margin-bottom: 1.25rem !important;
    }

    .entry-content {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }

    .entry-content h2 {
        font-size: 1.5rem !important;
        margin-top: 2rem !important;
        margin-bottom: 1rem !important;
    }

    .entry-content h3 {
        font-size: 1.25rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .entry-content blockquote {
        font-size: 1.1rem !important;
        padding: 1rem 1.25rem !important;
        margin: 1.5rem 0 !important;
    }

    .blog-author-box {
        padding: 1.5rem 1.25rem !important;
        border-radius: 16px !important;
    }

    .author-avatar-wrap {
        width: 80px !important;
        height: 80px !important;
    }

    .author-name {
        font-size: 1.35rem !important;
    }

    .blog-main-grid {
        padding-top: 2rem !important;
        padding-bottom: 3rem !important;
    }
}
