:root {
    /* Colors - Modern 2026 Palette */
    --primary-color: #2D3142;
    --secondary-color: #4F5D75;
    --accent-color: #EF8354;
    --bg-color: #F8F9FA;
    --surface-color: rgba(255, 255, 255, 0.7);
    --text-primary: #1F2022;
    --text-secondary: #6B707B;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Effects */
    --glass-blur: blur(16px);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Layout & Glassmorphism --- */

.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    padding: 16px 0;
    transition: var(--transition-smooth);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1001;
}

.logo-accent {
    color: var(--accent-color);
}

.nav-links-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
    padding: 8px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition-fast);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    position: relative;
    padding: 8px 16px;
    border-radius: 100px;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: rgba(239, 131, 84, 0.08);
}

.special-link {
    color: var(--secondary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.special-link::after {
    content: '▼';
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform var(--transition-fast);
}

.dropdown:hover .special-link::after {
    transform: rotate(180deg);
}

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: 8px 0;
    z-index: 1000;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    margin: 4px 8px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(239, 131, 84, 0.08);
    color: var(--accent-color);
    transform: translateX(4px);
}

.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-coffee {
    background: linear-gradient(135deg, #FFDD00, #FFC107);
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-coffee:hover {
    background: linear-gradient(135deg, #FFEA4D, #FFD54F);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.glass-footer {
    margin-top: 80px;
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.02);
}

main {
    padding-top: 100px;
    min-height: calc(100vh - 150px);
}

/* --- Home Page --- */

.home-container {
    padding-bottom: 60px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

/* Featured Card spans full width or 2 columns */
.featured-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .featured-card {
        flex-direction: row;
        height: 400px;
    }
    .featured-card .card-image-wrapper {
        flex: 1.5;
        height: 100%;
    }
    .featured-card .card-content {
        flex: 1;
        padding: 48px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Article Cards */

.article-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    position: relative;
    top: 0;
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    top: -8px;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.article-card:hover .card-image {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
    line-height: 1.3;
}

.featured-card .card-title {
    font-size: 2.25rem;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    transition: var(--transition-fast);
}

.article-card:hover .read-more {
    color: var(--primary-color);
}


/* --- Article Page --- */

.article-hero {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 400px;
    margin-bottom: -60px; /* Overlap content */
}

.article-hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.article-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8));
}

.article-hero-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 100px;
    z-index: 2;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 800px;
    line-height: 1.2;
}

.article-body-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    padding: 60px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 3;
    max-width: 800px;
    margin: 0 auto;
}

/* Markdown Customization over Github CSS */
.markdown-body {
    font-family: var(--font-sans) !important;
    color: var(--text-primary) !important;
    font-size: 1.1rem;
    line-height: 1.8;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-serif);
    border-bottom: none !important;
    color: var(--primary-color);
}

.markdown-body img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* --- Animations --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Navigation */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        transition: right var(--transition-smooth);
        z-index: 1000;
        padding: 40px 20px;
        overflow-y: auto;
    }

    .nav-links-wrapper.active {
        right: 0;
    }

    .main-nav {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        width: 100%;
    }

    .nav-link {
        font-size: 1.25rem;
        display: inline-block;
        padding: 12px 24px;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 10px 0;
        display: block;
    }

    .special-link::after {
        display: none;
    }

    .dropdown-item {
        font-size: 1.1rem;
        text-align: center;
    }

    .nav-actions {
        margin-top: 32px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 2.25rem;
    }
    .article-title {
        font-size: 2.25rem;
    }
    .article-body-wrapper {
        padding: 30px 20px;
        margin-top: 0;
        border-radius: var(--radius-md);
    }
    .article-hero {
        margin-bottom: 0;
        height: 40vh;
    }
}

/* --- Image Loading Spinner --- */

.img-loading-wrapper {
    position: relative;
    display: block;
    width: 100%;
    min-height: 200px;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1em;
}

.img-loading-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.img-loading-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    opacity: 1;
    transition: opacity var(--transition-smooth);
    margin: 0 !important;
}

.img-loading-wrapper.loading img {
    opacity: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
