/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Modern Root Variables */
:root {
    --bg-color: #fefefe;
    --text-color: #242424;
    --heading-color: #1a1a1a;
    --mehrron-color: #800000; 
    --academic-blue: #0366d6; 
    --divider-color: #eaecef;
    --border-color: #d1d5da;
}

/* Core Typography using Lora */
body {
    font-family: 'Lora', Georgia, serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* Page Container Constraints and Spacing */
.container {
    max-width: 800px; 
    margin: 40px auto;
    padding: 0 20px;
}

/* --- Top Navigation Menu --- */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 25px; 
    margin-bottom: 50px; 
    justify-content: center;
    border-bottom: 1px solid var(--divider-color); 
    padding-bottom: 15px;
}

.top-nav a {
    color: #6a737d; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-nav a:hover, .top-nav a.active {
    color: var(--academic-blue); 
}

/* Profile Header Section with Picture */
.profile-section {
    display: flex;
    align-items: center; 
    gap: 30px;
    margin-bottom: 20px;
}

.profile-pic {
    width: 230px; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

.profile-info {
    flex: 1; 
}

.profile-info h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 600;
    color: var(--heading-color);
}

.profile-info p {
    margin-bottom: 10px;
    margin-top: 0;
}

.contact-line {
    font-size: 0.95rem;
    color: #444;
    margin-top: 15px;
}

/* Social and Mails */
a {
    color: var(--academic-blue);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

.social-links {
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    font-size: 0.95rem;
}

.social-links a {
    color: #242424;
    font-weight: 600;
}

.social-links a:hover {
    color: var(--academic-blue);
}

/* Colour Rule for Mehrron Text */
.mehrron-text {
    color: var(--mehrron-color);
}

/* Divider Line */
.divider {
    border: 0;
    height: 1px;
    background: var(--divider-color);
    margin: 30px 0;
}

/* Section Headings */
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color);
    border-bottom: 1px solid var(--divider-color);
    padding-bottom: 8px;
    margin-top: 35px;
    margin-bottom: 20px;
}

/* SIDE-BY-SIDE NEWS SECTION */
#news {
    display: flex;
    align-items: flex-start;
    gap: 30px; 
    margin-top: 35px;
    margin-bottom: 35px;
}

#news h2 {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 12px; 
    border-bottom: none; 
    white-space: nowrap; 
}

.news-container {
    height: 100px; 
    flex: 1; 
    overflow-y: scroll; 
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    margin: 0; 
    box-sizing: border-box;
}

/* Stylized Inner Scrollbar */
.news-container::-webkit-scrollbar {
    width: 6px;
}

.news-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.news-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

.news-container::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.news-item {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.news-item:first-child {
    padding-top: 0;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap; 
}

.news-content {
    padding-left: 5px;
}

/* Generic Item Formatting */
.item {
    margin-bottom: 20px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline; 
    margin-bottom: 2px;
}

.item h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading-color);
}

.date {
    font-size: 0.95rem;
    color: #6a737d;
    font-style: italic;
    white-space: nowrap; 
}

/* Lists and LI spacing */
ul {
    padding-left: 15px;
}

li {
    margin-bottom: 6px;
}

/* Clean Footer */
footer {
    text-align: center;
    padding: 10px 0;
    margin-top: 30px;
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid var(--divider-color);
}

/* Mobile and Small Screen Responsiveness */
@media (max-width: 650px) {
    /* 1. Fix the Top Navigation for Mobile */
    .top-nav {
        gap: 10px; 
        margin-bottom: 30px;
        padding-bottom: 10px;
    }

    .top-nav a {
        font-size: 0.85rem; 
    }

    /* 2. Fix the Profile Section */
    .profile-section {
        flex-direction: column; 
        align-items: center;
        text-align: center; 
    }
    
    .profile-pic {
        width: 150px; 
        margin-bottom: 5px;
    }

    .profile-info h1 {
        font-size: 1.7rem; 
    }

    .container {
        margin: 15px auto;
        padding: 0 15px;
    }

    /* 3. Fix the Lists and Dates */
    .item-header {
        flex-direction: column; 
        align-items: flex-start;
    }
    
    .date {
        margin-top: 2px;
        margin-bottom: 8px;
    }
    
    /* 4. Fix the News Section for Mobile */
    #news {
        flex-direction: column; 
        gap: 15px;
    }
    
    #news h2 {
        border-bottom: 1px solid var(--divider-color);
        width: 100%;
        padding-bottom: 8px;
    }
    
    .news-container {
        width: 100%;
        height: 150px; 
        max-height: 150px; /* STRICT HEIGHT LIMIT */
        overflow-y: scroll; /* FORCE SCROLL */
        box-sizing: border-box;
    }
}
