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

:root {
    --bg-color: #fafafa;
    --text-color: #333;
    --header-bg: #35424a;
    --header-text: #ffffff;
    --nav-bg: #e3e3e3;
    --border-color: #dedede;
    --muted-color: #666;
    --section-bg: var(--bg-color);
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --link-color: #27658a;
    --link-hover: #194b6b;
}

[data-theme="dark"] {
    --bg-color: #202020;
    --text-color: #e0e0e0;
    --header-bg: #2c3e50;
    --header-text: #ffffff;
    --nav-bg: #34495e;
    --border-color: #393939;
    --muted-color: #aaa;
    --section-bg: var(--bg-color);
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    --link-color: #78b9df;
    --link-hover: #a4d6f3;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: all 0.3s ease;
}

/* Navigation bar at top */
/* Updated Navigation Styles for Left-Right Layout */
nav {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between; /* Push left and right sections apart */
    align-items: center;
}

/* Left section - Home button */
.nav-left {
    flex: 1;
}

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.home-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.home-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.home-icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
    background-color: rgba(255, 255, 255, 0.06);
}

.home-icon-button svg {
    display: block;
}

/* Right section - Navigation links and theme toggle */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-right ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.nav-right a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    font-size: 0.95rem;
}

.nav-right a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}


/* nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    font-size: 0.95rem; /* Added consistent font size */
/* } */

/* nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
} */ 

/* Theme toggle */
.theme-toggle {
    background: var(--header-text);
    color: var(--header-bg);
    border: none;
    padding: 0rem 0rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 2rem;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

/* Main content area */
main {
    flex: 1 0 auto;
    width: 100%;
    margin-top: 80px; /* Space for fixed nav */
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Profile and About section side by side */
.profile-about-section {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    background: transparent;
    padding: 1rem 0;
}

.profile-picture {
    width: 225px;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 5px; /* Square with slight rounding */
    flex-shrink: 0;
}

.about-content {
    flex: 1;
}

.about-content h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--header-bg);
}

.about-content .designation {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-content .bio {
    font-size: 1rem;
    line-height: 1.7;
}

[data-theme="dark"] .about-content h1 {
    color: var(--link-hover);
}


/* Contact details and compact profile icons beneath the introduction. */
.profile-contact {
    margin-top: 1rem;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    text-decoration: none;
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.social-links a:focus-visible {
    outline: 2px solid var(--link-hover);
    outline-offset: 3px;
}

footer {
    flex-shrink: 0;
    text-align: center;
    padding: 0.85rem 1rem;
    color: var(--muted-color);
    background: transparent;
    margin-top: 1.5rem;
    font-size: 0.8rem;
}
a {
    color: var(--link-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
}

/* Responsive design */
@media (max-width: 768px) {
    .profile-contact .social-links {
        justify-content: center;
    }

    nav {
        padding: 1rem;
        justify-content: center;
    }
    
    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .theme-toggle {
        margin-left: 1rem;
    }
    
    main {
        margin-top: 120px;
        padding: 1rem;
    }
    
    .profile-about-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .profile-picture {
        width: 125px;
        height: auto;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .about-content h1 {
        font-size: 1.8rem;
    }
    
    .about-content .designation {
        font-size: 1.1rem;
    }

    .news-section h2 {
        font-size: 1.6rem; /* Adjusted for mobile */
    }
}

/* News & Updates section */
.news-section {
    background: transparent;
    padding: 0;
    text-align: left; /* Ensure text is left-aligned */
}

.news-section h1,
.news-section h2 {
    color: var(--header-bg);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    width: 100%; /* Ensure full width */
}

.news-section h2 {
    font-size: 1.5rem;
}

[data-theme="dark"] .news-section h1,
[data-theme="dark"] .news-section h2 {
    color: var(--link-hover);
    border-bottom-color: var(--border-color);
}

.news-item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 0.35rem 0;
}

[data-theme="dark"] .news-item {
    border-bottom-color: #444;
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date {
    flex: 0 0 5.25rem;
    font-weight: bold;
    color: var(--header-bg);
    font-size: 0.95rem;
}

[data-theme="dark"] .news-date {
    color: var(--link-hover);
}

.news-content h3 {
    color: var(--header-bg);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

[data-theme="dark"] .news-content h3 {
    color: var(--link-hover);
}

.news-content p {
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.news-intro {
    margin-bottom: 1rem;
}

.news-navigation {
    margin-top: 1rem;
}

.past-news-button {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
}

.past-news-button:hover {
    text-decoration: underline;
}

.past-news-button:focus-visible {
    outline: 2px solid var(--link-hover);
    outline-offset: 3px;
}

/* Responsive design for news section */
@media (max-width: 368px) {
    .news-item {
        flex-direction: column;
        gap: 0.1rem;
    }
    
    .news-date {
        flex-basis: auto;
        font-size: 0.85rem;
    }
    
    .news-section h2 {
        font-size: 1rem;
    }
}

@media (max-width: 280px) {
    .news-section {
        padding: 1.5rem;
    }
    
    .news-content h3 {
        font-size: 1.2rem;
    }
}

/* Lecture notes: compact lists with section dividers. */
.lecture-page h1,
.lecture-page h2 {
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.65rem;
    margin-bottom: 1rem;
}

.lecture-page h1 {
    font-size: 2rem;
}

.lecture-page h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
}

.lecture-page ul {
    padding-left: 1.5rem;
}

.lecture-page li {
    padding: 0.15rem 0;
    overflow-wrap: anywhere;
}

.lecture-page a {
    color: var(--link-color);
    text-decoration: none;
}

.lecture-page a:hover {
    color: var(--link-hover);
}

.lecture-page a:hover,
.lecture-page a:focus-visible {
    text-decoration: underline;
}

.lecture-status {
    font-size: 0.9em;
    font-style: italic;
}
