/* blogpost.css */
:root {
    --bg-dark: #0f0f11;
    --bg-card: #1a1a1f;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b8;
    --accent: #2aa4f8;
    --accent-alt: #1ce0ea;
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    --code-bg: #1e1e2e;
    --code-text: #f8f8f2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(42, 164, 248, 0.03) 0%, rgba(42, 164, 248, 0) 20%),
                radial-gradient(circle at 90% 80%, rgba(28, 234, 51, 0.03) 0%, rgba(28, 234, 51, 0) 20%);
    z-index: -1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.blog-title {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.memoji-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
    position: relative;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: var(--transition);
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-text h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.header-text .blog-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 1.8rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

nav a:hover {
    color: var(--text-primary);
}

nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

nav a:hover::after {
    width: 100%;
}

/* Main Content */
main {
    max-width: 1000px;
    margin: 2rem auto 4rem;
    padding: 0 2rem;
    animation: fadeIn 0.5s ease forwards;
}

/* Article Styling */
article {
    margin-top: 2rem;
}

#main-img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin: 2rem 0 3rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: block;
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
    transition: var(--transition);
    position: relative;
}

#main-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(42, 164, 248, 0.3);
}

#main-img::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, 
        rgba(15, 15, 17, 0.9) 0%, 
        rgba(15, 15, 17, 0.5) 50%, 
        transparent 100%);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    pointer-events: none;
}

/* Optional caption styling if an image has figcaption */
#main-img + figcaption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
    margin-top: -2rem;
    margin-bottom: 3rem;
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 31, 0.7);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    position: relative;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

article h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

article h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 3rem 0 1.2rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(42, 164, 248, 0.2);
}

article h3 {
    font-size: 1.4rem;
    font-weight: 500;
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
}

article p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.7;
}

article ol, article ul {
    margin: 1.5rem 0 1.5rem 2rem;
    color: var(--text-secondary);
}

article li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    font-size: 1.125rem;
    padding-left: 0.5rem;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    border-radius: var(--border-radius);
    padding: 1.8rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow);
    position: relative;
}

pre::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--code-text);
}

.hljs-comment {
    color: #6272a4;
    font-style: italic;
}

.hljs-keyword {
    color: #ff79c6;
}

.hljs-number {
    color: #bd93f9;
}

.hljs-title {
    color: #8be9fd;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.invert-img {
    filter: invert(1);
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

/* Text Highlights */
mark.text-highlight {
    background: rgba(42, 164, 248, 0.15);
    color: var(--accent);
    padding: 0.2rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-alt);
    text-decoration: underline;
}

/* Share Section */
.a2a_kit {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.a2a_button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: var(--transition) !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.a2a_button:hover {
    background: rgba(42, 164, 248, 0.2) !important;
    transform: translateY(-3px) !important;
    border-color: var(--accent) !important;
}

/* Improved Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 3rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    align-items: center;
}

.links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
}

.links li {
    display: flex;
    align-items: center;
}

.links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.links a:hover {
    color: var(--accent);
    transform: translateX(5px);
}

.links a::before {
    content: "→";
    opacity: 0;
    transition: var(--transition);
    transform: translateX(-5px);
}

.links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    width: 150px;
    box-shadow: none;
    margin: 1rem;
    transition: var(--transition);
}

.footer-logo:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.footer-info h4 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-info a {
    color: var(--accent);
    font-weight: 500;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightPulse {
    0%, 100% {
        background: rgba(42, 164, 248, 0.15);
    }
    50% {
        background: rgba(42, 164, 248, 0.3);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        text-align: center;
    }
    
    .blog-title {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-text {
        text-align: center;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    main {
        padding: 0 1.5rem;
    }

    #main-img {
        max-height: 400px;
        margin: 1.5rem 0 2.5rem;
    }
    
    #main-img:hover {
        transform: translateY(-3px);
    }
    
    article h1 {
        font-size: 2.2rem;
    }
    
    article h2 {
        font-size: 1.8rem;
    }
    
    pre {
        padding: 1.2rem;
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .links ul {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .memoji-container {
        width: 45px;
        height: 45px;
    }
    
    .header-text h1 {
        font-size: 1.1rem;
    }

    #main-img {
        max-height: 300px;
        margin: 1rem 0 2rem;
        border-radius: calc(var(--border-radius) - 2px);
    }
    
    #main-img + figcaption {
        font-size: 0.85rem;
        max-width: 90%;
        padding: 0.4rem 0.8rem;
    }
    
    article h1 {
        font-size: 1.8rem;
    }
    
    article p, article li {
        font-size: 1rem;
    }
    
    .a2a_kit {
        gap: 0.5rem;
    }
    
    .a2a_button {
        width: 40px !important;
        height: 40px !important;
    }
}