/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 1200px; /* Changed from max-width to fixed width */
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box; /* Ensures padding is included in width */
}

/* Header */
header {
  background-color: white;
  color: #333;
  padding: 5px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.site-logo {
  display: inline-block;
  vertical-align: middle;
}

.site-logo img {
  max-height: 85px;
  width: auto;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
}

header a {
  color: #003366;
  text-decoration: none;
  font-weight: 500;
}

nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin-right: 20px;
}

nav li a {
  position: relative;
  padding: 5px 0;
}

nav li a:hover {
  color: #0056b3;
}

nav li a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #003366;
  transition: width 0.3s ease;
}

nav li a:hover:after {
  width: 100%;
}

/* Main content */
main {
  padding: 40px 0;
  flex: 1;
}

/* Team Section */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2%;
  margin-top: 40px;
}

.team-member {
  flex: 0 0 calc(25% - 1.5%);
  margin-bottom: 30px;
  text-align: center;
  background-color: #f9f9f9;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

.team-member img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

.team-member-profile .profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
}

.member-header {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
}

/* Publications */
.publication-item {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.publication-links a {
  display: inline-block;
  margin-right: 10px;
  background-color: #003366;
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  text-decoration: none;
}

.publication-filters {
  margin-bottom: 30px;
}

.filter {
  background-color: #f1f1f1;
  border: none;
  padding: 8px 16px;
  margin-right: 5px;
  cursor: pointer;
  border-radius: 4px;
}

.filter.active {
  background-color: #003366;
  color: white;
}

/* Publication detail page */
.publication-detail .citation {
  margin: 30px 0;
}

.publication-detail .citation pre {
  white-space: pre-wrap; /* Allow text to wrap */
  word-break: break-word;
  overflow-wrap: break-word;
  padding: 15px 20px;
  background-color: #f9f9f9;
  border-left: 4px solid #003366;
  font-style: italic;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95em;
  line-height: 1.6;
  color: #444;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* News/Blog */
.news-item {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.date {
  color: #666;
  font-style: italic;
}

.read-more {
  color: #003366;
  font-weight: bold;
  text-decoration: none;
}

/* Footer */
footer {
  background-color: #333;
  color: white;
  padding: 20px 0;
  text-align: center;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1000;
  position: relative;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background-color: #003366;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Modal for expandable images */
.img-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  text-align: center;
}
.img-modal-content {
  margin: 40px auto 0 auto;
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
  border-radius: 8px;
  background: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
  padding: 12px; /* Add a small margin inside the modal image */
}
.img-modal.show .img-modal-content {
  opacity: 1;
  transform: scale(1);
}
.img-modal-close {
  position: absolute;
  top: 24px;
  right: 40px;
  color: #fff;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2100;
  text-shadow: 0 2px 8px #000;
}
#img-modal-caption {
  color: #fff;
  margin: 24px 0 0 0;
  font-size: 1.2em;
  text-shadow: 0 2px 8px #000;
}

@media (max-width: 600px) {
  .img-modal-content {
    max-width: 98vw;
    max-height: 60vh;
  }
  .img-modal-close {
    top: 8px;
    right: 16px;
    font-size: 36px;
  }
  #img-modal-caption {
    font-size: 1em;
  }
}

/* Responsive */
@media (max-width: 1220px) {
  .container {
    width: 100%;
  }
}

@media (max-width: 992px) {
  .team-member {
    flex: 0 0 calc(33.333% - 1.33%);
  }
}

@media (max-width: 768px) {
  .team-member {
    flex: 0 0 calc(50% - 1%);
  }
  
  .member-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  /* Mobile Navigation with Animation */
  header .container {
    position: relative;
  }
  
  .hamburger-menu {
    display: block;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    z-index: 999;
    margin-top: 5px;
    
    /* Animation properties */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  }
  
  .main-nav.active {
    max-height: 400px;
    opacity: 1;
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 20px;
    transform: translateY(-10px);
    transition: transform 0.3s ease;
    margin-bottom: 10px;
  }
  
  .main-nav.active ul {
    transform: translateY(0);
  }
  
  .main-nav li {
    margin: 10px 0;
    width: 100%;
    text-align: center;
  }
  
  .main-nav li a {
    display: block;
    padding: 10px;
  }
  
  .main-nav li a::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .team-member {
    flex: 0 0 100%;
  }
}

/* Expandable Images */
.expandable-figure img {
  cursor: zoom-in;
  box-shadow: 0 0 0 0 rgba(0,51,102,0);
  transition: box-shadow 0.2s;
  position: relative;
}
.expandable-figure img:hover {
  box-shadow: 0 0 0 4px #00336644;
}
.expandable-figure {
  position: relative;
}
.expandable-figure::after {
  content: '\1F50D'; /* Unicode magnifying glass */
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 1.7em;
  color: #003366cc;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.expandable-figure:hover::after {
  opacity: 1;
}
