:root {
    --primary-color: #561407;
    --secondary-color: #ffffff;
    --text-color: #333;
    --link-color: #560724;
    --link-hover-color: #43051a;
}
@media (max-width: 768px) {
    section {
        margin: 20px auto;
        padding: 16px;
    }

    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        vertical-align: middle;
    }

    .profile-summary {
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
        vertical-align: middle;
    }

    .profile-summary img {
        display: inline-block;
        width: 70%;
        max-width: 280px;
        vertical-align: middle;
    }

    .profile-text {
        width: 100%;
    }

    .profile-text p {
        text-align: left; /* justified text is bad on mobile */
    }

    .publication-prj-item {
        flex-direction: column;
        margin: 20px 0;
    }

    .pub-img {
        flex: none;
        width: 100%;
    }

    .pub-img img {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-text .profile-icon {
        width: 28px;
        height: 28px;
        color: var(--primary-color)
    }

    body {
        font-size: 15px;
    }

    .pub-title {
        font-size: 1.05em;
    }
}

@media (max-width: 600px) {
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    nav a {
        margin: 0;
    }
}

.profile {
  display: flex;
  align-items: flex-start; /* Align top edges */
  justify-content: space-between;
  /* max-width: 900px; */
  margin: 40px auto;
  padding: 20px 20px;
  gap: 20px;
}

.profile-text {
  flex: 2; /* Takes remaining space */
}

.profile-text h1 {
  margin-top: 0;
}

.profile-text p {
  line-height: 1.6;
  font-size: 1rem;
  text-align: justify;  /* stretches text to both edges */
}

.profile-text a {
  color: var(--primary-color);
  text-decoration: none;
}

.profile-text .profile-icon {
  width: 32px;
  height: 32px;
  vertical-align: middle;
}

.profile-text .profile-icon:hover {
  transform: scale(1.1); /* grow slightly when hovered */
  cursor: pointer;
}

.profile-text image{
    width:10%; 
    height:auto; 
    vertical-align: top;
}

.profile-text a:hover {
    text-decoration: none;
}

.social-links {
  margin-top: 10px;
  font-size: 1rem;
}

.social-links a {
  margin-right: 10px;
}

.profile-summary { /* Width is 40% of the parent and locates on the right hand side*/
    /* flex: 0 0 50%; Fixed width */
    flex: 1;
    /* display: flex;
    justify-content: center; Center the image */
    /* Keep the content vertically middle */
    margin-top: 2%;
    text-align: center;
}

.profile-summary img{
    /* max-width: 15%; */
    width: 90%;
    /* vertical-align: middle; */
    border-radius: 2%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    vertical-align: middle;
}

body { 
    font-family: Arial, sans-serif; 
    line-height: 1.6; 
    margin: 0; 
    padding: 0; 
    background: #fdffff; 
    color: #333; 
}

a{
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

header, section { 
    /* max-width: 800px;  */
    /* max-width: 80%; */
    /* margin: 40px auto;  */
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

header { 
    text-align: center; 
    padding-top: 10px; 
}

h1 { 
    margin-bottom: 0; 
    color: var(--primary-color);
}

nav a { 
    margin: 0 10px; 
    color: var(--primary-color); 
    text-decoration: none; 
}

nav a:hover { 
    text-decoration: underline; 
}

section { 
    background: var(--secondary-color); 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    padding: 15px 25px; 
    margin-bottom: 20px; 
    /* max-width: 900px; */
    margin: 40px auto;
    gap: 20px;
}

ul { 
    list-style: none; 
    padding-left: 0; 
}

ul li { 
    margin-bottom: 10px; 
}

section h2{
    color: var(--primary-color);
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

.publication-prj-item {
  display: flex;
  align-items: flex-start;
  margin: 10px 40px;
  gap: 20px;
}

.publication-prj-item:not(:last-child) {
  border-bottom: 1px solid #ddd;  /* separation line */
  padding-bottom: 20px;
  margin-bottom: 40px;
}

.pub-img {
    flex: 0 0 180px;   /* fixed image width */
}

.pub-img img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pub-text {
    flex: 1;
}

.pub-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 6px;
}

.pub-authors {
    margin-bottom: 6px;
}

.pub-venue {
    margin-bottom: 6px;
    color: var(--text-color);
}

.pub-links a {
    margin-right: 10px;
    color: var(--primary-color);
    text-decoration: none;
}

.pub-links a:hover {
    text-decoration: underline;
}
