/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #f7f7f7;
    border-bottom: 1px solid #e6e6e6;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #191919;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
}

.logo i {
    margin-right: 0.5rem;
    font-size: 2rem;
    color: #007acc;
}

/* Navigation Styles */
.nav {
    position: relative;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #191919;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #757575;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: Georgia, serif;
}

.nav-menu a:hover {
    background: #e8e8e8;
    color: #191919;
}

/* Code block style for Shelwyn */
.code-block {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace !important;
    background: #e8e8e8 !important;
    border: 1px solid #d0d0d0 !important;
    color: #007acc !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
}

.code-block:hover {
    background: #d8d8d8 !important;
    border-color: #007acc !important;
}

/* Main Content */
.main {
    margin-top: 100px;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    color: #333;
    border-bottom: 1px solid #e6e6e6;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #191919;
    font-family: Charter, Georgia, serif;
}

.hero p {
    font-size: 1.2rem;
    color: #757575;
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
    font-family: Georgia, serif;
}

/* Articles Section */
.articles-section {
    padding: 2rem 0;
}

.articles-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #191919;
    margin-bottom: 3rem;
    font-weight: 600;
    font-family: Charter, Georgia, serif;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

/* Article Cards */
.article-card {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #333;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007acc;
}

/* Article Thumbnail with Link */
.article-thumbnail-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.article-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-thumbnail img {
    transform: scale(1.05);
}

/* Article Content with Flex Layout */
.article-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Article Title with Link */
.article-title-link {
    color: #191919;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title-link:hover {
    color: #007acc;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: Charter, Georgia, serif;
}

.article-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #757575;
    font-family: Georgia, serif;
    flex: 1;
}

.article-link {
    display: inline-flex;
    align-items: center;
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 0.5rem;
    font-family: Georgia, serif;
    margin-top: auto;
    align-self: flex-start;
}

.article-link:hover {
    color: #005299;
    transform: translateX(3px);
}

/* More Articles Section (2 Column Grid with Special Handling for Odd Numbers) */
.more-articles-section {
    padding: 3rem 0;
    border-top: 1px solid #e6e6e6;
    margin-top: 2rem;
}

.more-articles-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #191919;
    margin-bottom: 2rem;
    font-weight: 600;
    font-family: Charter, Georgia, serif;
}

.more-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Special handling for grids with odd number of articles */
.more-articles-grid.has-odd-count {
    grid-template-columns: repeat(2, 1fr);
}

/* Horizontal Card for Last Odd Article */
.article-card.horizontal-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    max-width: 600px;
    margin: 0 auto;
    height: auto;
    border-radius: 8px;
    padding: 1rem;
}

.horizontal-card .article-thumbnail {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    margin-right: 1rem;
}

.horizontal-card .article-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.horizontal-card .article-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-family: Charter, Georgia, serif;
}

.horizontal-card .article-content p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #757575;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: Georgia, serif;
}

/* Category Tag for Horizontal Card */
.article-category-tag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #007acc;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: Georgia, serif;
}

.article-category-tag i {
    font-size: 0.7rem;
}

/* Inline Meta for Horizontal Card */
.article-meta-inline {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #999;
    margin-top: auto;
    font-family: Georgia, serif;
}

.article-meta-inline .read-time,
.article-meta-inline .date {
    display: flex;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    justify-content: center;
    font-family: Georgia, serif;
}

.pagination-btn:hover {
    background: #f5f5f5;
    border-color: #007acc;
    color: #007acc;
}

.pagination-btn.active {
    background: #007acc;
    color: #ffffff;
    border-color: #007acc;
}

.pagination-ellipsis {
    padding: 0.75rem 0.5rem;
    color: #999;
    font-family: Georgia, serif;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    color: #333;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1;
}

.close:hover {
    color: #007acc;
}

.about-content {
    padding: 2rem;
}

.about-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    font-size: 4rem;
    color: #007acc;
    margin-bottom: 1rem;
}

.about-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #191919;
    font-family: Charter, Georgia, serif;
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
    font-family: Georgia, serif;
}

.about-text strong {
    color: #007acc;
}

.about-text a {
    color: #007acc;
    text-decoration: none;
}

.about-text a:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e6e6e6;
}

.social-links a {
    color: #333;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    border: 1px solid #e6e6e6;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Georgia, serif;
}

.social-links a:hover {
    background: #007acc;
    color: #ffffff;
    border-color: #007acc;
    transform: translateY(-2px);
}

/* Error Banner */
.error-banner {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Georgia, serif;
}

/* No Articles */
.no-articles {
    text-align: center;
    padding: 3rem;
    color: #757575;
    grid-column: 1 / -1; /* Span all columns */
}

.no-articles i {
    font-size: 4rem;
    color: #007acc;
    margin-bottom: 1rem;
}

.no-articles h3 {
    margin-bottom: 1rem;
    color: #191919;
    font-family: Charter, Georgia, serif;
}

.no-articles p {
    font-family: Georgia, serif;
}

/* Footer */
.footer {
    background: #f5f5f5;
    border-top: 1px solid #e6e6e6;
    color: #757575;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    font-family: Georgia, serif;
}

.footer i {
    color: #e91e63;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: #f7f7f7;
        border: 1px solid #e6e6e6;
        border-radius: 8px;
        flex-direction: column;
        gap: 0;
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        margin-top: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-menu li {
        border-bottom: 1px solid #e6e6e6;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem;
        border-radius: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .more-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-card.horizontal-card {
        grid-column: 1;
        max-width: none;
        flex-direction: column;
    }
    
    .horizontal-card .article-thumbnail {
        width: 100%;
        height: 150px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .horizontal-card .article-content {
        padding: 0 1rem 1rem 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .article-card.horizontal-card {
        padding: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .more-articles-grid {
        max-width: 800px;
    }
}

/* Navigation toggle animation */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}