﻿/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: #f5f7fa;
    background-image: url('/images/home-back-1.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

    /* Background image only for home page */
    body.home-page {

    }

        body.home-page::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(245, 247, 250, 0.85);
            z-index: -1;
            pointer-events: none;
        }


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 247, 250, 0.85);
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: #4a4a4a;
    transition: color 0.3s ease;
}

    a:hover {
        color: #000;
    }

/* Layout structure */
header, footer {
    width: 100%;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

header {
    top: 0;
}

footer {
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

main {
    flex: 1;
    padding: 2% 0;
    min-height: 0;
    margin: 1% 0;
}

.header-container, .footer-container, .main-container {
    width: 80%;
    margin: 0 auto;
}

.main-container {
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    border-top: 3px solid #0077b5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    height: auto;
    max-height: calc(94vh - 140px);
}

/* Only disable overflow on home page */
body.home-page .main-container {
    overflow: auto;
}

/* Ensure other pages can scroll normally */
body:not(.home-page) .main-container {
    overflow-y: auto;
}

/* Header styles */
header {
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

nav ul {
    display: flex;
    list-style: none;
}

    nav ul li {
        margin-left: 2rem;
    }

        nav ul li a {
            font-size: 1rem;
            font-weight: 500;
            padding-bottom: 2px;
            position: relative;
        }

            nav ul li a.active {
                color: #0077b5;
                font-weight: 600;
            }

                nav ul li a.active::after {
                    content: '';
                    position: absolute;
                    bottom: -8px;
                    left: 0;
                    width: 100%;
                    height: 2px;
                    background-color: #0077b5;
                }

/* Footer styles with LinkedIn integration */
footer {
    padding: 0.5rem 0;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    margin-left: 1rem;
    font-size: 0.9rem;
    position: relative;
}

    .social-links a:hover {
        color: #0077b5;
    }

.linkedin-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    border-radius: 2px;
    position: relative;
    margin-right: 5px;
    top: 3px;
}

    .linkedin-icon:before {
        content: '';
        position: absolute;
        width: 4px;
        height: 8px;
        background-color: white;
        top: 4px;
        left: 2px;
        border-radius: 1px;
    }

    .linkedin-icon:after {
        content: '';
        position: absolute;
        width: 8px;
        height: 4px;
        background-color: white;
        top: 4px;
        right: 2px;
        border-radius: 1px;
    }

/* Home page layout */
.home-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    height: 100%;
}

.left-column, .right-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.left-column {
    gap: 2rem;
}

/* About me section */
.about-me {
    background-color: #fafbfc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

    .about-me h2 {
        margin-bottom: 1rem;
        color: #2c3e50;
        font-weight: 600;
    }

.about-intro {
    line-height: 1.7;
}

    .about-intro p {
        margin-bottom: 1rem;
        font-size: 1rem;
        color: #444;
    }

        .about-intro p:last-of-type {
            margin-bottom: 1.25rem;
        }

/* Portfolio section */
.portfolio-section {
    background-color: #fafbfc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    flex: 1;
}

    .portfolio-section h2 {
        margin-bottom: 1rem;
        color: #2c3e50;
        font-weight: 600;
    }

.portfolio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.portfolio-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

    .portfolio-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    }

.portfolio-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.portfolio-card h3 {
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.portfolio-card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* Featured article */
.featured-article {
    background-color: #fafbfc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .featured-article h2 {
        margin-bottom: 1rem;
        color: #2c3e50;
        font-weight: 600;
    }

.article-preview.featured {
    border: 1px solid rgba(0, 119, 181, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .article-preview.featured:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    }

.article-image-container {
    position: relative;
    height: 300px;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.article-preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-preview-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

    .article-preview-content h3 {
        margin-bottom: 0.75rem;
        font-size: 1.3rem;
        line-height: 1.3;
    }

        .article-preview-content h3 a {
            color: #2c3e50;
            transition: color 0.3s ease;
        }

            .article-preview-content h3 a:hover {
                color: #0077b5;
            }

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
}

.article-excerpt {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    color: #555;
    flex: 1;
}

.read-more {
    display: inline-block;
    font-weight: 500;
    font-size: 0.95rem;
    color: #0077b5;
    position: relative;
    padding-bottom: 2px;
}

    .read-more:after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: #0077b5;
        transition: width 0.3s ease;
    }

    .read-more:hover:after {
        width: 100%;
    }

/* Responsive design */
@media (max-width: 768px) {
    .header-container, .footer-container, .main-container {
        width: 90%;
    }

    nav ul li {
        margin-left: 1rem;
    }

    .home-container {
        flex-direction: column;
    }

    .portfolio-cards {
        grid-template-columns: 1fr;
    }
}

/* Article preview image optimizations */
.article-preview {
    position: relative;
    height: auto;
}

.article-preview-image {
    width: 100%;
    height: 180px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 4px 4px 0 0;
    background-color: #f0f0f0;
    position: relative;
}

    .article-preview-image::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        display: none;
    }

    .article-preview-image.loading::before {
        display: block;
    }

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Articles page specific styles */
body:not(.home-page) .article-preview {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fff;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    will-change: transform, box-shadow;
}

    body:not(.home-page) .article-preview:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    }

    body:not(.home-page) .article-preview img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

body:not(.home-page) .article-preview-content {
    padding: 1.2rem;
}

body:not(.home-page) .article-preview h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

body:not(.home-page) .article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

body:not(.home-page) .article-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #555;
}
