/* 
   MAXARA PREMIUM BLOG THEME
   Style: Dark Glass, Neon Depth, Magazine Layout 
*/

:root {
    --glass-bg: rgba(40, 37, 78, 0.3);
    --glass-border: rgba(255, 255, 255, 0.08);
    --neon-accent: #00f2ea;
    --neon-secondary: #e9565e;
    --depth-bg: #010204;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Dynamic Author Avatars (CSS-Only Logic) */
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1.5px solid var(--glass-border);
    flex-shrink: 0;
    background-color: var(--glass-bg);
}

.author-avatar[data-author="disha"] {
    background-image: url('/static/images/disha.webp');
}

.author-avatar[data-author="kuldeep"] {
    background-image: url('/static/images/kuldeep.webp');
}

.author-avatar[data-author="punit"] {
    background-image: url('/static/images/punit.webp');
}

.author-avatar[data-author="maxara"] {
    background-image: url('/static/images/logo.webp');
}


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

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

@keyframes scaleReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 242, 234, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
    }

    100% {
        box-shadow: 0 0 5px rgba(0, 242, 234, 0.1);
    }
}

/* Global Overrides for Blog Pages */
body.blog-page {
    background-color: var(--depth-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
}

/* --- HERO SECTION (Index) --- */
.magazine-hero {
    height: 85vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding-bottom: 6rem;
}

.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 1s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    /* Parallax feel on load */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Deeper bottom-weighted gradient to keep top of image clear */
    background: linear-gradient(to top,
            rgba(1, 2, 4, 0.95) 0%,
            rgba(1, 2, 4, 0.4) 40%,
            transparent 80%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    animation: fadeUp 1s ease-out 0.2s backwards;
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 242, 234, 0.1);
    border: 1px solid var(--neon-accent);
    color: var(--neon-accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 1000px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* --- ARTICLE SPECIFIC HERO --- */
.article-hero {
    height: 75vh !important;
    min-height: 550px;
    align-items: flex-end !important;
    padding-bottom: 0 !important;
}

.article-hero .hero-content {
    animation: fadeUp 0.8s ease-out;
}

.article-hero .hero-title {
    font-size: clamp(2.0rem, 5vw, 2.8rem) !important;
    max-width: 900px;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.article-hero .hero-meta {
    margin-top: 2rem;
}

/* --- BENTO GRID (Index) --- */
.bento-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 450px;
    gap: 2rem;
}

/* Card Styles */
.bento-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

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

/* Sizes */
.card-large {
    grid-column: span 8;
}

.card-tall {
    grid-column: span 4;
    grid-row: span 2;
}

.card-standard {
    grid-column: span 4;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .card-large {
        grid-column: span 12;
    }

    .card-tall {
        grid-column: span 6;
    }

    .card-standard {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

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

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 2.5rem;
}

.card-cat {
    font-size: 0.75rem;
    color: var(--neon-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    display: block;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 500;
}

.card-large .card-title {
    font-size: 2.5rem;
}

.read-more-link {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    transition: gap 0.2s;
}

.bento-card:hover .read-more-link {
    gap: 1rem;
    opacity: 1;
    color: var(--neon-accent);
}

/* --- DETAIL PAGE --- */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9999;
    background: transparent;
}

.progress-bar {
    height: 100%;
    background: var(--neon-accent);
    width: 0%;
    box-shadow: 0 0 10px var(--neon-accent);
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
}

.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
}

.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Typography Polish */
.drop-cap::first-letter {
    font-family: var(--font-heading);
    font-size: 4rem;
    float: left;
    line-height: 0.8;
    padding-right: 1.5rem;
    padding-top: 0.5rem;
    color: var(--neon-accent);
}

.article-body p {
    margin-bottom: 1.8rem;
    color: #d0d0d0;
}

.article-body h2 {
    font-family: var(--font-heading);
    color: white;
    font-size: 2.2rem;
    margin-top: 3rem;
    border-left: 3px solid var(--neon-accent);
    padding-left: 1.5rem;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

/* Code Block Styling (Neon Terminal) */
pre {
    background: #0d0d12;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    /* Top padding for 'window' controls */
    margin: 2rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

pre::before {
    content: "TERMINAL";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    letter-spacing: 1px;
    font-family: var(--font-body);
}

pre::after {
    /* Mac-style traffic lights */
    content: "● ● ●";
    position: absolute;
    top: 6px;
    right: 15px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ff5f56, #ffbd2e, #27c93f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

code {
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #e0e0e0;
    font-size: 0.95rem;
}

/* Inline code (not in pre blocks) */
p code,
li code,
h1 code,
h2 code,
h3 code,
td code {
    background: rgba(0, 242, 234, 0.1);
    color: var(--neon-accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid rgba(0, 242, 234, 0.2);
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 70px;
    /* Left of dots */
    background: rgba(0, 242, 234, 0.1);
    border: 1px solid var(--neon-accent);
    color: var(--neon-accent);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.7;
}

.copy-btn:hover {
    background: var(--neon-accent);
    color: #000;
    opacity: 1;
}

[data-theme="light"] pre {
    background: #0d0d12;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] code {
    color: #e0e0e0;
}

/* Light mode inline code */
[data-theme="light"] p code,
[data-theme="light"] li code,
[data-theme="light"] h1 code,
[data-theme="light"] h2 code,
[data-theme="light"] h3 code,
[data-theme="light"] td code {
    background: rgba(0, 150, 150, 0.15);
    color: #008b8b;
    border-color: rgba(0, 150, 150, 0.3);
}

[data-theme="light"] pre::before {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.related-link {
    display: block;
    margin-bottom: 1rem;
    text-decoration: none;
    color: white;
    font-size: 0.95rem;
    transition: color 0.2s;
}

/* Scroll Reveal Class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: none;
    }

    /* Or move to bottom */
}

/* --- LIGHT MODE OVERRIDES --- */
[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(99, 39, 160, 0.15);
    --depth-bg: #f9f9fb;
    --text-primary: #0a0b10;
    --text-secondary: #4a4a4a;
    --neon-accent: #6327a0;
    /* Use brand purple for accent in light mode */
}

[data-theme="light"] body.blog-page {
    background-color: var(--depth-bg);
    color: var(--text-primary);
}

[data-theme="light"] .hero-overlay {
    background: linear-gradient(to top,
            rgba(249, 249, 251, 0.98) 0%,
            rgba(249, 249, 251, 0.6) 30%,
            transparent 70%);
}

[data-theme="light"] .hero-title {
    background: linear-gradient(90deg, #0a0b10 0%, #333 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Softer shadow for light mode */
}

[data-theme="light"] .bento-card {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

[data-theme="light"] .bento-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--neon-accent);
}

[data-theme="light"] .card-overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.0) 60%);
}

[data-theme="light"] .hero-tag {
    background: rgba(0, 143, 138, 0.1);
    color: var(--neon-accent);
    border-color: var(--neon-accent);
}

/* Article Body Overrides */
[data-theme="light"] .article-body p {
    color: #4a4a4a;
}

[data-theme="light"] .article-body h2 {
    color: #1a1a2e;
}

[data-theme="light"] .related-link {
    color: #333;
}

[data-theme="light"] .related-link:hover {
    color: var(--neon-accent);
}

/* --- FAQ Block Styles --- */
.faq-block {
    margin: 4rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    clear: both;
    /* Prevents squeezing by floated images */
    width: 100%;
}

.faq-card {
    background: rgba(40, 37, 78, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.faq-card:hover {
    border-color: rgba(99, 39, 160, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.faq-header {
    padding: 1.8rem 2.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: transparent;
    transition: background 0.3s;
}

.faq-header:hover {
    background: rgba(99, 39, 160, 0.05);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-body);
    padding-right: 2rem;
}

.faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(99, 39, 160, 0.2);
    color: var(--neon-accent);
    transition: transform 0.4s;
    flex-shrink: 0;
}

.faq-card.active .faq-icon {
    transform: rotate(180deg);
    background: var(--neon-accent);
    color: var(--depth-bg);
}

.faq-answer-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.faq-card.active .faq-answer-wrapper {
    max-height: 1000px;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 1rem;
}

/* Fix for detail page headings */
.article-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}