/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+Pro:wght@300;400;600&display=swap');

/* General styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

:root {
  --dark-wood: #5e3a22;
  --medium-wood: #8b5a2b;
  --light-wood: #a67c52;
  --cream-white: #ffffff;
  --forest-green: #2c5e1a;
  --neutral-gray: #e0ddd7;
  --fa-style-family-brands: "Font Awesome 6 Brands";
  --fa-font-brands: normal 400 1em / 1 "Font Awesome 6 Brands";
  --text-color: #333333;
  --link-color: #5e3a22;
  --link-hover: #8b5a2b;
  --highlight-color: rgba(166, 124, 82, 0.3);
}

body {
  font-family: 'Source Sans Pro', sans-serif;
  color: var(--text-color);
  background-color: var(--cream-white);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
  /* Add zoom constraints */
  min-width: 320px;
  width: 100%;
}

.container {
  width: 68.4%; /* Reduced by 24% from 90% */
  max-width: 912px; /* Reduced by 24% from 1200px */
  margin: 0 auto;
  padding: 0 15px;
}

/* Zoom handling container - keeps layout proportional on zoom */
@media screen and (max-width: 1400px) {
  .container {
    width: min(68.4%, calc(100% - 40px));
  }
}

a {
  text-decoration: none;
  color: var(--dark-wood);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--medium-wood);
}

/* Header */
header {
  background-color: #fff;
  box-shadow: 0 1px 5px rgba(94, 58, 34, 0.2);
  /* padding: 0.75rem 0; */
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

header .container {
  display: flex;
  justify-content: space-between; /* Changed from flex-end to space-between */
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
}

.site-logo {
  height: 40px;
  width: auto;
  margin-right: 1rem;
}

nav ul {
  display: flex;
  list-style: none;
  justify-content: flex-end; /* Align nav items to the right */
}

nav ul.right-aligned-nav {
  margin-left: auto; /* Push nav to the right */
}

nav ul li {
  margin: 0 0.75rem;
}

nav ul li a {
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
}

nav ul li a:hover {
  border-bottom: 2px solid var(--dark-wood);
}

nav ul li a.active {
  font-weight: 700;
  border-bottom: none;
}

/* Main content */
main {
  flex: 1;
  padding: 1.5rem 0; /* Reduced from 3rem to 1.5rem (half) */
}

h2 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.1rem;
}

/* Social icons in main content */
.social-container {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.social-icons.main-social {
  margin-bottom: 0;
}

.social-icons.main-social a {
  color: #420707;
  font-size: 3.6rem;
  margin: 0 0.8rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons.main-social a:hover {
  color: var(--medium-wood);
  transform: translateY(-3px);
}

/* Academic icons styling */
.social-icons.main-social a .ai {
  font-size: 3.6rem;
  vertical-align: middle;
  position: relative;
  top: -0.2rem;
  display: inline-block;
}

/* X (Twitter) icon styling */
.x-icon {
  font-weight: bold;
}

/* Home page */
.hero {
  position: relative;
  margin-bottom: 2rem;
  overflow: hidden;
  min-width: 300px; /* Minimum width to prevent collapse */
}

.hero-content {
  text-align: justify;
  margin-right: 0%; /* Leave space for image container */
}

.hero-image-container {
  float: right;
  width: 35%;
  margin-left: 3%;
  margin-bottom: 1%;
  position: relative;
}

.hero-image {
  width: 100%;
  max-width: 100%;
  margin-top: 4%;
  height: auto;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 0; /* Remove bottom margin to connect with address */
}

.work-address {
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  color: #74690d;
  line-height: 1.6;
}

.work-address p {
  margin-bottom: 0;
  font-family: 'Courier New', Courier, monospace;
  /* margin-bottom: %; */
}

.intro-title {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 1.9rem;
  margin-bottom: 0.03rem;
}

.highlight {
  color: var(--dark-wood);
}

.btn {
  display: inline-block;
  background-color: var(--medium-wood);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  font-weight: 500;
  margin-top: 1rem;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: var(--dark-wood);
  color: white;
}

/* About page */
.about-content {
  background-color: #fff;
  padding: 2rem;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Research page */
.research-item {
  background-color: #fff;
  padding: 2rem;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  overflow: hidden;
}

.research-item:last-child {
  border-bottom: none;
}

.research-image-container {
  float: right;
  width: 30%;
  max-width: 250px;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.research-image {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  height: auto;
  display: block;
}

.research-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Publications page */
.publications-container {
  margin-bottom: 2rem;
}

.publication-entry {
  display: flex;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.publication-tag {
  min-width: 160px;
  /* padding: 8px 10px; */
  text-align: center;
  background-color: #34495e;
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 15px;
  margin-top: 4px;
}

.publication-tag.under-review {
  background-color: #34495e;
}

.publication-tag.conference {
  background-color: #2980b9;
}

.publication-tag.journal {
  background-color: #27ae60;
}

.publication-tag.workshop {
  background-color: #f39c12;
}

.publication-tag.preprint {
  background-color: #95a5a6;
}

.publication-content {
  flex: 1;
}

.publication-title {
  font-size: 1rem;
  color: #0b3964;
  font-weight: 500;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.publication-title a {
  color: #da9515;
  text-decoration: none;
}

.publication-title a:hover {
  text-decoration: underline;
}

.publication-authors {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #333;
}

.publication-venue {
  font-style: italic;
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.publication-links {
  margin-top: 0.5rem;
}

.publication-link {
  display: inline-block;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  color: #333;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.publication-link:hover {
  background-color: #e0e0e0;
  color: #333;
  text-decoration: none;
}

/* CV page */
.cv-section {
  margin-bottom: 2rem;
}

.cv-item {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.cv-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cv-item-title {
  font-weight: 500;
}

.cv-item-date {
  color: #666;
}

.cv-item-subtitle {
  color: #555;
  margin-bottom: 1rem;
}

.cv-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-download {
  background-color: #27ae60;
}

.btn-download:hover {
  background-color: #219653;
}

/* Footer */
footer {
  background-color: #2a2e33;
  color: #ffffff;
  padding: 0.4rem 0;
  text-align: center;
  height: 3.75vh;
  margin-top: auto;
  width: 100%;
}

footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

footer p {
  margin: 0;
  padding: 0;
  font-weight: 300; /* Lighter font weight */
  font-size: 0.85rem; /* Slightly smaller font size */
  line-height: 3.75vh; /* Match the footer height */
}

#lastUpdated {
  font-style: normal; /* Changed from italic to normal */
  opacity: 1; /* Changed from 0.8 to 1 for full opacity */
}

/* Adjust the body and html to fix the footer */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Responsive design */
@media screen and (max-width: 768px) {
  header .container {
    flex-direction: column;
    align-items: center;
  }
  
  .header-logo {
    margin-bottom: 0.5rem;
  }
  
  .site-logo {
    height: 35px;
  }
  
  nav ul {
    margin-top: 0.5rem;
    justify-content: center;
  }
  
  nav ul.right-aligned-nav {
    margin-left: 0;
  }
  
  nav ul li {
    margin-left: 0.4rem;
    margin-right: 0.4rem;
  }
  
  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }
  
  .hero-image {
    margin-left: 0;
    margin-bottom: 2rem;
    width: 300px;
    height: 200px;
  }

  .social-icons.main-social a {
    font-size: 3rem;
    margin: 0 0.8rem;
  }

  .research-image-container {
    float: none;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-bottom: 1.5rem;
  }
}

/* Add zoom handling for extreme zoom in */
@media screen and (max-width: 500px) {
  .hero-image-container {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 1rem;
  }
  
  .hero-content {
    margin-right: 0;
    width: 100%;
  }
  
  body, html {
    min-width: 320px;
    overflow-x: auto;
  }
  
  .container {
    width: calc(100% - 30px);
    padding: 0 15px;
  }
  
  .news-table th {
    min-width: 80px;
  }
}

/* Ensure proportional scaling at very high zoom levels */
@media screen and (max-width: 400px) {
  body {
    zoom: 0.9;
  }
  
  .container, main, header, footer, .hero, .news-section, .home-content {
    min-width: 300px;
    width: 100% !important;
  }
}

/* News section */
.news-section {
  margin-bottom: 1rem;
}

.news-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: .8rem;
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-table th,
.news-table td {
  padding: .5rem;
  text-align: left;
  border-bottom: 1px solid var(--neutral-gray);
}

.news-table th {
  width: 20%;
  color: var(--dark-wood);
  font-weight: 500;
  vertical-align: top;
  text-align: center;
  vertical-align: middle;
}

.news-table tr:last-child th,
.news-table tr:last-child td {
  border-bottom: none;
}

.news-table tr:hover {
  background-color: rgba(166, 124, 82, 0.05);
}

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

.full-news-table {
  margin-bottom: 0.5rem;
}

/* Life page */
.life-intro {
  font-size: 1.1rem;
  color: var(--dark-wood);
  margin-bottom: 2rem;
}

.life-section {
  margin-bottom: 3rem;
}

.life-section h3 {
  color: var(--dark-wood);
  border-bottom: 2px solid var(--neutral-gray);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.photo-item {
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.photo-caption {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--dark-wood);
  margin-bottom: 0;
}

.travel-log {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.travel-entry {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.travel-entry h4 {
  color: var(--dark-wood);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.reading-list {
  list-style-type: none;
  padding: 0;
}

.reading-list li {
  background-color: #fff;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.reading-list li strong {
  color: var(--dark-wood);
}

/* Utility Classes */
.text-right {
  text-align: right;
}


/* Interactive World Map Styles */
.interactive-world-map {
  width: 65%;
  height: 400px;
  border: 2px solid var(--neutral-gray);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 2rem auto 1rem auto;
  position: relative;
  overflow: hidden;
}

/* Smooth transitions for map interactions - removed to fix hover color issues */

/* Leaflet map legend styling */
.map-legend {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--neutral-gray);
}

.map-legend .legend-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--dark-wood);
  text-align: center;
}




/* Map popup styling */
.map-popup h4 {
  margin: 0 0 6px 0;
  color: var(--dark-wood);
  font-size: 1.1rem;
}

.map-popup p {
  margin: 4px 0;
  font-size: 0.2rem;
}

/* Leaflet zoom controls */
.leaflet-control-zoom a {
  background-color: var(--dark-wood) !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--medium-wood) !important;
}

/* Compact OpenStreetMap attribution */
.leaflet-control-attribution {
  font-size: 10px !important;
  padding: 2px 4px !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  border-radius: 3px !important;
  margin: 2px !important;
}

.leaflet-control-attribution a {
  color: #666 !important;
  text-decoration: none !important;
}

.leaflet-control-attribution a:hover {
  color: var(--dark-wood) !important;
}






.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--neutral-gray);
}

.legend-color.visited {
  background-color: var(--dark-wood);
}

.legend-color.not-visited {
  background-color: var(--neutral-gray);
}

/* Map tooltip customization */
.jvectormap-tip {
  background-color: var(--dark-wood) !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Map zoom controls */
.jvectormap-zoomin, .jvectormap-zoomout {
  background-color: var(--dark-wood) !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.jvectormap-zoomin:hover, .jvectormap-zoomout:hover {
  background-color: var(--medium-wood) !important;
} 