/* Load Inter from Google Fonts in HTML <head>:
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1.9.4/css/academicons.min.css">
*/

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

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #ffffff;
  color: #111;
}

a {
  text-decoration: none;
  color: #007acc;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
}

/* Header */
header {
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

header .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

header h1 {
  font-size: 1.4rem;
  flex: 1 0 100%;
  text-align: center;
  margin-bottom: 0.5rem;
}

header h1 a {
  color: #333;
  font-weight: 600;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

nav a {
  font-size: 0.95em;
  color: #333;
}

/* Main content */
main.container {
  padding-top: 120px;
  padding-bottom: 2rem;
}

section {
  margin-bottom: 2rem;
}

/* Profile photo */
.profile-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  float: right;
  margin: 0 0 1rem 1.5rem;
  border: 2px solid #ddd;
}

/* Clearfix */
section::after {
  content: "";
  display: table;
  clear: both;
}

/* Headings */
section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

section h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #555;
  margin-bottom: 1rem;
}

section p {
  margin-bottom: 1rem;
}

ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

ul li {
  margin-bottom: 1rem;
}

/* Contact and Info Boxes */
.contact-box,
.info-box {
  border: 1px solid #ddd;
  padding: 0.7rem 0.7rem 0.3rem 2.0rem;
  margin-top: 2rem;
  background-color: #fafafa;
  font-size: 0.85em;
  line-height: 1.4;
  border-radius: 5px;
  position: relative;
}

.contact-row {
  position: relative;
  margin-bottom: 0.4rem;
  padding-left: 1.8rem;
}

.contact-row i {
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.2rem;
  text-align: center;
  color: #555;
}

.box-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  position: relative;
  padding-left: 1.6rem;
}

.box-title i {
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.2rem;
  text-align: center;
  color: #555;
}

/* Social Icons */
.social-icons {
  margin: 2rem 0;
  text-align: center;
}

.social-icons ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.social-icons li {
  display: inline-block;
}

.social-icons a {
  color: #444;
  transition: color 0.2s ease;
  text-decoration: none;
}

.social-icons a:hover {
  color: #007acc;
}

.social-icons i {
  font-size: 3rem;
  vertical-align: middle;
}

/* Publications */
.pub-item {
  margin-bottom: 1.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 0.5px solid #eee;
}

.pub-item p:first-of-type {
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
}

.pub-item .eng-title {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.pub-tools {
  margin-top: 0rem;
}

.badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  color: #007acc;
  border: 1px solid #007acc;
  background-color: #f5faff;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.badge:hover {
  background-color: #e6f2ff;
}

.badge:focus {
  outline: none;
}

.badge[type="button"],
.badge:where(button) {
  appearance: none;
  background: #f5faff;
  border: 1px solid #007acc;
}

.badge-index {
  border-color: #888;
  color: #555;
  background-color: #f4f4f4;
}

.badge-index:hover {
  background-color: #e0e0e0;
}

.abstract-box {
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  background-color: #f9f9f9;
  border-left: 3px solid #ccc;
  font-size: 0.85em;
  line-height: 1.5;
  display: none;
}

/* Footer */
footer {
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.9em;
  color: #777;
  margin-top: 2rem;
}

/* Responsive layout */
@media (min-width: 600px) {
  header .container {
    flex-wrap: nowrap;
  }

  header h1 {
    flex: none;
    text-align: left;
    margin-bottom: 0;
  }

  nav {
    justify-content: flex-end;
    width: auto;
  }
}

@media (max-width: 500px) {
  .profile-photo {
    float: none !important;
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 140px;
    height: 140px;
  }

  section h2,
  section h3,
  section p,
  ul {
    text-align: center;
  }

  .social-icons i {
    font-size: 2.2rem;
  }
}

/* ---------------------
   CV-Specific Styles
---------------------- */
.edu-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.edu-list li {
  display: flex;
  margin-bottom: 1.2rem;
  align-items: flex-start;
}

.edu-icon {
  margin-right: 0.8rem;
  margin-top: 0.1rem;
  color: #777;
  flex-shrink: 0;
}

.edu-icon i {
  font-size: 1rem;
}

.edu-entry {
  flex-grow: 1;
}

.edu-sub {
  margin-top: 0.4rem;
}

.thesis-title {
  border-left: 3px solid #ccc;
  padding-left: 0.6rem;
  font-style: italic;
  color: #333;
  margin-bottom: 0.3rem;
}

.advisor {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.4rem;
}

/* Work/Other Boxes */
.info-box ul.icon-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.88rem;
}

.info-box ul.icon-list li {
  margin-bottom: 1rem;
  padding-left: 1.6rem;
  position: relative;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}

.info-box ul.icon-list li i {
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: #666;
  width: 1.2rem;
  text-align: center;
}

/* Nested list for sub-roles */
ul.nested-list {
  list-style: none;
  margin-top: 0.5rem;
  padding-left: 1.6rem;
  font-size: 0.85rem;
}

ul.nested-list li {
  margin-bottom: 0.4rem;
  padding-left: 1.4rem;
  position: relative;
  color: #555;
}

ul.nested-list li i {
  position: absolute;
  left: 0;
  top: 0.1rem;
  color: #888;
  width: 1.2rem;
  text-align: center;
}

/* Text */
.small-desc {
  font-size: 0.83rem;
  color: #666;
}

.years {
  font-size: 0.85em;
  color: #666;
  margin-left: 0.4rem;
}

.info-box ul.icon-list li a {
  text-decoration: none;
  color: #007acc;
  line-height: 1.5;
  word-break: break-word;
}

/* --- Fix Editorship box spacing --- */
.info-box ul.icon-list li {
  display: block;
  line-height: 1.6;
  margin-bottom: 1.1rem;
  padding-left: 1.6rem;
  position: relative;
  word-break: break-word;
}

.info-box ul.icon-list li i {
  position: absolute;
  left: 0;
  top: 0.25rem;
  color: #666;
  width: 1.2rem;
  text-align: center;
  font-size: 0.95rem;
}

.info-box ul.icon-list li a {
  line-height: 1.5;
  display: inline;
}

.info-box ul.icon-list li .years {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #666;
}