:root {
    --primary-color: rgb(21, 21, 27);
    --border-color: rgb(85, 85, 85);
    --accent-color: rgb(140, 140, 255);
    --text-light: rgb(240, 240, 240);
    --text-gray: rgb(180, 180, 180);
    --text-dark-gray: rgb(115, 115, 115);
    --card-bg: rgb(30, 30, 36);
    --card-border: rgb(60, 60, 70);
}

html {
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--primary-color);
    color: white;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family:'Courier New', Courier, monospace;
    overflow-x: hidden;
}

main {
    flex: 1;
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1; /* Lower z-index for main content */
    justify-content: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 100vw;
}

.nav-logo {
    margin: 0.5rem 0;
}

.nav-logo img {
    max-height: 50px;
    width: auto;
}

.nav-buttons {
    display: flex;
    gap: 3rem;
    font-size: 1.1rem;
    align-items: center;
    font-family:'Courier New', Courier, monospace;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-buttons a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
}

.nav-buttons a:hover {
    text-decoration: underline;
}

.fontawesome {
    font-size: 1.6rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Higher z-index for header */
    padding: 0.5rem;
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

footer {
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 1000; /* Higher z-index for footer */
}

.footer-text {
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
    margin: 0;
    padding: 0.8rem;
    font-family:'Courier New', Courier, monospace;
}



/* Article Cards and Container */
.articles-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.article-card {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--card-border);
    position: relative;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: var(--accent-color);
}

.article-image {
    width: 40%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    max-width: 100%;
    max-height: 100%;
    transform-style: preserve-3d; /* Add this line */
    backface-visibility: hidden; /* Add this line */
    will-change: transform; /* Add this line */
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    width: 60%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.article-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.divider {
    border-top: 1px solid var(--text-dark-gray);
}

.article-date {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    /* Fix for text not wrapping properly */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    max-width: 100%;
    box-sizing: border-box;
}

/* Make entire card clickable */
.article-card a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative; /* Enable z-index */
    z-index: 1100; /* Higher than header */
}


@media screen and (max-width: 1400px) {
    .nav-logo img {
        width: 80%;
    }
    
    .nav-buttons {
        gap: 2rem;
    }
}

/* Responsive breakpoints */
@media screen and (max-width: 1024px) {
    .nav-buttons {
        gap: 1.5rem;
    }
    
    nav {
        padding: 0 1rem;
    }
}

/* Responsive styles */
/* For screens that are less than 900px wide */
@media screen and (max-width: 900px) {
    .articles-container {
        width: 95%;
    }
    
    .article-card {
        flex-direction: column;
    }
    
    .article-image, .article-content {
        width: 100%;
    }
    
    .article-image {
        height: 250px;
    }

    .articles-container {
        margin-top: 3rem;
        margin-bottom: 1rem;
    }
    
    .article-excerpt {
        word-break: normal;        /* Only break at natural word boundaries */
        overflow-wrap: break-word; /* Allow breaking only if a word is too long */
        hyphens: none;             /* Disable hyphenation completely */
        max-width: 100%;
        box-sizing: border-box;
        margin-top: 0;
    }
}

@media screen and (max-width: 840px) {
    /* Menu toggle button becomes visible */
    .menu-toggle {
        display: block;
    }
    
    /* Navigation buttons become a dropdown */
    .nav-buttons {
        position: fixed;
        top: var(--header-height, 0);
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        pointer-events: none;
        z-index: 999; /* High but below header and toggle */
    }
    
    .nav-buttons.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-buttons a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }
    
    nav {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}


@media screen and (max-width: 600px) {
    .article-title {
        font-size: 1.3rem;
    }
    
    .article-excerpt {
        font-size: 0.95rem;
        word-break: normal;        /* Only break at natural word boundaries */
        overflow-wrap: break-word; /* Allow breaking only if a word is too long */
        hyphens: none;             /* Disable hyphenation completely */
        box-sizing: border-box;
    }
    
    .article-content {
        padding: 1.2rem;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Fix for long words on small screens */
@media screen and (max-width: 480px) {
    .nav-logo img {
        width: 60%;
    }
    
    .article-excerpt {
        word-break: normal;        /* Only break at natural word boundaries */
        overflow-wrap: break-word; /* Allow breaking only if a word is too long */
        hyphens: none;             /* Disable hyphenation completely */
        box-sizing: border-box;
    }
    
    .article-title, 
    .article-excerpt {
        max-width: 100%;
    }
}