/* General styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e0e0e0; /* Gray background */
    display: flex;
    flex-direction: column; /* Stack navigation and content vertically */
    align-items: center; /* Center content horizontally */
}

/* Navigation styles */
nav {
    width: 100%; /* Make navigation span the full width */
    background-color: #f4f4f4;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 20px;
    border-radius: 5px; /* Rounded corners */
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center; /* Center navigation items */
    gap: 15px; /* Space between items */
}

nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

nav ul li a:hover {
    color: #007BFF;
}

/* Main content styles */
main {
    background-color: white; /* White paper-like background */
    padding: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px; /* Rounded corners */
    width: 80%; /* Adjust width to look like a sheet */
    max-width: 1000px; /* Maximum width for larger screens */
}

/* Hero section — overlay text on top of a full-width header image */
.hero {
    position: relative;
    background: none;
    color: inherit;
    text-align: center;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.hero .main-header-img {
    display: block;
    width: 100%;
    height: 100%;   /* 60vh; fixed fraction of viewport height */
    max-width: 100%;
    object-fit: cover; /* scale & crop to fill area while preserving aspect */
}

.hero .hero-content {
    position: absolute;
    left: 0;
    right: 0;
    top: 45%;
    transform: translateY(-50%);
    text-align: center;
    color: #fff;
    padding: 0 1rem;
    /* strong outline using multiple shadows to mimic stroke */
    text-shadow: -1.25px -1.25px 0 #000,
                  1.25px -1.25px 0 #000, 
                 -1.25px 1.25px 0 #000, 
                  1.25px 1.25px 0 #000, 
                  0 0 6px rgba(0,0,0,0.3);
}

.hero .hero-content h1 {
    font-size: 3em;
    margin: 0;
}

.hero .hero-content p {
    font-size: 1.2em;
    margin: 0.25rem 0 0;
}

/* Styled keywords as boxes */
.keywords a {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
}

.keywords a:hover {
    background-color: #e0e0e0;
}

.keywords a.active {
    background-color: #007BFF;
    color: white;
    border-color: #0056b3;
}

/* Adjusted paper graphic styles */
.papers {
    counter-reset: paper-counter; /* start counting from 0 */
}    

.paper {
    list-style: none; /* Disable bullet points */
    margin-left: 20px; /* Keep the indent */
    display: flex;
    align-items: flex-start; /* Align top of image with top of text */
    justify-content: space-between;
    gap: 1rem; /* space between text and image */
    margin-bottom: 2rem; /* Space between papers */
}

.paper a {
    text-decoration: none; /* Remove hyperlink highlighting */
    color: inherit; /* Inherit text color */
    font-style: normal; /* Ensure consistent text style */
    flex: 1;
}

.paper a:hover {
    text-decoration: none; /* Prevent underline on hover */
}

.paper p:first-of-type {
    display: block; /* Ensure the title appears on its own line */
    font-weight: normal; /* Highlight the title */
    font-size: large;
    margin-bottom: 5px; /* Decrease spacing between title and other information */
}

.paper p:not(:first-of-type) {
    display: inline; /* Keep authors, journal, and year on the same line */
    margin-right: 5px; /* Add minimal spacing between inline elements */
}

.paper p:nth-of-type(2) {
    font-style: normal; /* Authors remain normal */
}

.paper p:nth-of-type(3) {
    font-style: italic; /* Journal in italics */
}

.paper p:nth-of-type(4) {
    font-weight: bold; /* Set year to bold */
}

.paper p:nth-of-type(5) {
    font-weight: normal; /* Set pages to normal font */
}

.paper p:not(:first-of-type)::after {
    content: ','; /* Add a comma after every field */
    font-weight: normal; /* Ensure the comma is in normal font */
}

.paper p:last-of-type::after {
    content: ''; /* Remove the comma after the last field */
}

.paper img {
    display: none;
    max-height: 200px;
    max-width: 300px;
    object-fit: contain;
  }

/* removed automatic numbering pseudo-element to avoid stray '0' marker
.paper::before {
        content: counter(paper-counter) ".";
        position: absolute;
        left: 0;
        top: 1.2em;
        font-weight: normal;
        color: #333;
    }*/

/* Footer styles */
footer {
    display: block;
    text-align: center;
    padding: 12px 0;
    background-color: transparent;
    position: static;
    width: 100%;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 20px;
    color: #333;
}


.social-links a {
    display: inline-flex;
    flex-direction: column; /* icon above label */
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    text-decoration: none;
    color: inherit;
    font-family: inherit; /* use Roboto from body */
}

.social-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    /* ensure logos appear black-and-white; users can replace with BW SVGs */
    filter: grayscale(100%);
}

.social-label {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    line-height: 1;
    color: inherit;
}

/* CV table styling */
.cv-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.cv-table th,
.cv-table td {
    padding: 10px 8px;
    vertical-align: top;
    text-align: left;
    font-size: 0.98rem;
}
.cv-table tr {
    border-bottom: 1px solid #e0e0e0; /* gray separator between rows */
}
.cv-table tr:last-child {
    border-bottom: none;
}
.cv-table .degree {
    width: 30%;
    /* font-weight: 600; */
}
.cv-table .institution {
    width: 50%;
}
.cv-table .years {
    width: 20%;
    text-align: right;
    color: #666;
}

/* Awards / Funding — flex list (Option A) */
.awards {
    margin-top: 0.5rem;
    margin-left: 10px; /* small indent to match table content */
}
.award {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0; /* gray separator between rows */
    gap: 1rem;
}
.award:last-child {
    border-bottom: none;
}
.award-name {
    flex: 1;
}
.award-year {
    white-space: nowrap; /* keep year on one line */
    margin-left: 1rem;
    color: #666;
}

/* Profile header: name on the left, portrait on the right */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.profile-header .name {
    flex: 1 1 auto;
}
.profile-pic {
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: cover;
    /* border-radius: 6px; */
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.15); */
}

@media (max-width: 640px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .profile-pic {
        align-self: flex-start;
        max-width: 120px;
        max-height: 120px;
        margin-top: 0.5rem;
    }
}

/* Research interest block: text on the left, image on the right */
.research-interest {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin: 1rem 0 2rem;
}
.research-interest .ri-text {
    flex: 1 1 40%;
}
.research-interest .ri-text h3 {
    margin-top: 0;
}
.research-interest .ri-text p {
    text-align: justify;
    text-justify: inter-word;
}
.research-interest .ri-image {
    flex: 0 0 440px; /* fixed visual width for the image block */
    margin-top: 2.5rem; /* push image down below the heading */
}
.research-interest .ri-image img {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

@media (max-width: 800px) {
    .research-interest {
        flex-direction: column;
    }
    .research-interest .ri-image {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 640px) {
    .hero .main-header-img {
        height: 40vh; /* smaller header on small screens */
    }
}

/* Selected publications collapsible */
.selected-pubs {
    margin-top: 1rem;
}
.toggle-pubs {
    background: none;
    border: none;
    padding: 6px 0;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #333;
}
.toggle-pubs:focus {
    outline: 2px solid #007BFF;
    outline-offset: 2px;
}
/* SVG triangle replacement (rounded corners, precise control) */
.toggle-pubs .triangle-svg {
    display: inline-block;
    width: 16px;
    height: 12px;
    vertical-align: middle;
    transition: transform 180ms ease;
    transform: rotate(180deg); /* left when closed */
    flex-shrink: 0;
}
.selected-pubs.open .toggle-pubs .triangle-svg {
    transform: rotate(270deg); /* down when open */
}
.pub-list {
    display: none;
    margin-left: 10px; /* match indent of other sections */
    list-style: none; /* remove default bullets */
    padding-left: 0; /* remove default left padding */
    margin-top: 8px;
}
.selected-pubs.open .pub-list {
    display: block;
}
.pub-list li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.pub-list li:last-child { border-bottom: none; }
.pub-list a { color: inherit; text-decoration: none; }
.pub-list a:hover { text-decoration: underline; }

.social-icon:hover {
    opacity: 0.85;
}

ol.roman li::marker {
    content: counter(list-item, lower-roman) ") ";
}

.link-button {
  display: inline-block;
  padding: 2px 2px;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #f5f5f5;
  text-decoration: none;
  color: #333;
}
.link-button:hover {
  background-color: #e0e0e0;
}

/* Cover gallery styles */
.cover-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    justify-items: center;
}

.cover-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 200ms ease, box-shadow 200ms ease;
    width: 100%;
    max-width: 100%;
}

.cover-item:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cover-item img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
}

/* Cover modal styles */
.cover-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.cover-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.cover-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001;
}

.cover-modal-content img {
    width: auto;
    height: 90vh;
    display: block;
}

.cover-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
    z-index: 1002;
}

.cover-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
    .cover-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .cover-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}