/* General Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Montserrat', 'Poppins', 'SF Pro Display', 'Avenir Next', sans-serif;
  line-height: 1.6;
  color: #222;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Container Base Styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
}

/* Navigation Bar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  position: sticky;
  top: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  width: 100%;
  max-width: 100vw;
}

nav .nav-left {
  font-weight: bold;
  font-size: 1.2rem;
  color: #333;
}

nav .nav-right a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav .nav-right a:hover {
  color: #888;
}

/* Header Section */
.header {
  background: white;
  padding: 5rem 2rem 4rem 2rem;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.profile-image {
  width: 280px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #f0f0f0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  margin-right: 4rem;
  flex-shrink: 0;
}

.header-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header h1 {
  font-size: 4rem;
  margin: 0 0 0.5rem 0;
  font-weight: 400;
  color: #2c3e50;
  letter-spacing: -1px;
  line-height: 1.1;
}

.header .subtitle {
  font-size: 1.4rem;
  color: #666;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* About Section */
#about {
  padding: 4rem 0;
  background: 
    linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
    url('assets/images/telescope-observation-night.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
}

.about-container {
  width: 100%;
  /* two-column layout so the heading sits in the left half and content in the right */
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  column-gap: 4rem; /* use column gap instead of padding on the right column so left heading centers correctly */
}

#about h2 {
  font-size: 4rem;
  font-weight: 300;
  color: #333;
  margin: 0;
  letter-spacing: -2px;
  /* center the heading within the left grid column */
  grid-column: 1 / 2;
  justify-self: center;
  align-self: center;
  place-self: center; /* center both horizontally and vertically in the left grid cell */
  text-align: center;
  width: 100%;
}

.about-text {
  grid-column: 2 / 3;
  padding-left: 0; /* spacing provided by column-gap on .about-container */
  max-width: 100%;
  text-align: left;
}

#about p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  text-align: left;
  color: #333;
}

#about p:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  background: #fff;
  color: #333;
  border-top: 1px solid #eee;
}

footer p:first-child {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

footer .socials {
  margin: 1.5rem 0;
}

footer .socials a {
  margin: 0 15px;
  font-size: 1.8rem;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer .socials a:hover {
  color: #888;
}

footer p:last-child {
  font-size: 1rem;
  color: #666;
  margin-top: 1rem;
}



/* Research Page Styles */
.research-title-section {
  background: white;
  padding: 60px 0 40px 0;
}

.research-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.research-title-section h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  font-weight: 400;
  color: #2c3e50;
  margin: 0;
  line-height: 1.1;
}

.research-hero {
  position: relative;
  height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Left-side mirrored hero variant */
.research-hero-alt {
  position: relative;
  height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.research-hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
}

.research-hero-content {
  position: absolute;
  z-index: 2;
  right: 0;
  top: 0;
  height: 100%;
  width: 50%; /* keep content on right half */
  display: flex;
  align-items: center; /* center vertically */
  padding: 0 60px; /* space from right edge */
  box-sizing: border-box;
}

/* Content for left-side hero: place on left half */
.research-hero-alt-content {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  height: 100%;
  width: 50%;
  display: flex;
  align-items: center;
  padding: 0 60px;
  box-sizing: border-box;
}

.research-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* align text to left within right column */
  gap: 30px;
  max-width: 100%;
  margin: 0;
  padding-right: 0;
}

.research-description {
  width: 100%;
  text-align: left;
}

.research-description p {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #000;
  margin: 0;
}

.research-description strong {
  font-weight: 600;
  color: #000;
}

.advisor-info {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-shrink: 0;
}

.advisor-section {
  text-align: left;
}

.advisor-label,
.position-label,
.institution-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #333;
  margin: 0 0 5px 0;
}

.advisor-name,
.position-title,
.institution-name {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #000;
  margin: 0 0 15px 0;
}

.advisor-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 15px auto 0;
}

.advisor-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.position-section {
  text-align: left;
}

.position-section p {
  margin: 0 0 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    padding: 1rem;
    text-align: center;
  }
  
  nav .nav-right {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  nav .nav-right a {
    margin: 0.25rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .header {
    flex-direction: column;
    padding: 2rem 1rem;
    min-height: auto;
    text-align: center;
  }
  
  .profile-image {
    width: 200px;
    height: 250px;
    margin: 0 auto 2rem auto;
    display: block;
  }
  
  .header-text {
    text-align: center;
    width: 100%;
  }
  
  .header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .header .subtitle {
    font-size: 1.2rem;
  }
  
  #about {
    padding: 3rem 0;
  }
  
  .about-container {
    display: block;
    padding: 0 1.5rem;
    text-align: center;
    max-width: 100%;
  }
  
  #about h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
  }
  
  .about-text {
    padding: 0;
    text-align: left;
    max-width: 100%;
  }
  
  #about p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .research-hero {
    height: auto;
    padding: 2rem 0;
  }
  
  .research-hero-content {
    position: relative;
    width: 100%;
    right: auto;
    top: auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
  }
  
  .research-hero-alt-content {
    position: relative;
    width: 100%;
    left: auto;
    top: auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
  }
  
  .research-hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }
  
  .research-info {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }
  
  .advisor-info {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
  }
  
  .position-section {
    text-align: center;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.75rem;
  }
  
  nav .nav-right a {
    margin: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .header {
    padding: 1.5rem 1rem;
  }
  
  .header h1 {
    font-size: 2rem;
    line-height: 1.1;
  }
  
  .header .subtitle {
    font-size: 1.1rem;
  }
  
  .profile-image {
    width: 160px;
    height: 200px;
  }
  
  #about h2 {
    font-size: 2rem;
  }
  
  .about-container {
    padding: 0 1rem;
  }
  
  .research-hero-content h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .research-description p {
    font-size: 0.95rem;
  }
}

/* Research Page Responsive Design */
@media (max-width: 768px) {
  .research-container {
    padding: 0 1.5rem;
    max-width: 100%;
  }
  
  .research-title-section {
    padding: 2rem 0 1.5rem 0;
    text-align: center;
  }
  
  .research-title-section h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 0;
    padding: 0 1rem;
  }
  
  .research-hero {
    height: auto;
    min-height: 30vh;
    padding: 2rem 0;
  }
  
  .research-hero-content {
    position: relative;
    width: 100%;
    right: auto;
    top: auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    text-align: center;
  }
  
  .research-info {
    flex-direction: column;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    max-width: 100%;
  }
  
  .research-description {
    text-align: center;
    max-width: 100%;
  }
  
  .advisor-info {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  
  .advisor-section {
    text-align: center;
  }
  
  .position-section {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .research-container {
    padding: 0 1rem;
  }
  
  .research-title-section h1 {
    font-size: 1.8rem;
    padding: 0 0.5rem;
  }
  
  .research-hero-content {
    padding: 0 1rem;
  }
  
  .research-description p {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

/* Service / Mentorship Page Styles */
.service-hero {
  background: #fafafa;
  padding: 3rem 0 2rem 0; /* reduced bottom padding to pull up cards */
}

.service-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 0 2rem;
}

.service-copy p {
  max-width: 600px;
  color: #222;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1rem 0;
}

.service-title {
  font-size: 4rem; /* slightly smaller */
  font-weight: 300;
  text-align: left; /* heading on the left now */
  margin: 0;
  color: #222;
}

.mentor-grid-section {
  background: #fafafa;
  padding: 2rem 0 4rem 0; /* reduced top padding for tighter spacing */
}

/* Teaching Section (mirrored layout) */
.teaching-section {
  background: #ffffff;
  padding: 3rem 0 4rem 0;
}

.teaching-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 0 2rem;
}

.teaching-copy p {
  max-width: 600px;
  color: #222;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1rem 0; /* match .service-copy spacing so shorter copy still takes similar vertical space */
}

.teaching-copy {
  padding: 2rem 0; /* vertical padding only: top & bottom */
}

.teaching-title {
  font-size: 4rem;
  font-weight: 300;
  text-align: right;
  margin: 0;
  color: #222;
}

.teaching-gallery {
  max-width: 1200px;
  margin: 2rem auto 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 2rem;
}

.teaching-photo {
  margin: 0;
  text-align: center;
}

.teaching-gallery img {
  width: 100%;
  height: 260px;
  object-fit: contain; /* avoid cropping edges */
  background: #f7f7f7; /* neutral backdrop when using contain */
  padding: 8px; /* small inner padding so the image edges aren't flush against rounded corners */
  box-sizing: border-box;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.teaching-photo figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  font-weight: 400;
  text-align: center;
}

@media (max-width: 900px) {
  .teaching-inner {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0 2rem;
    gap: 2rem;
  }

  .teaching-title {
    text-align: center;
    font-size: 2.5rem;
    line-height: 1.2;
    order: -1; /* Move heading above the copy on mobile */
  }

  .teaching-copy {
    padding: 1rem 0;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    order: 0; /* Keep copy below heading on mobile */
  }

  .teaching-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .teaching-inner {
    padding: 0 1rem;
  }
  
  .teaching-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .teaching-title {
    font-size: 2rem;
  }
}

/* Extra small screens */
@media (max-width: 320px) {
  nav {
    padding: 0.5rem;
  }
  
  nav .nav-right a {
    margin: 0.125rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .header h1 {
    font-size: 1.6rem;
  }
  
  .header .subtitle {
    font-size: 1rem;
  }
  
  .profile-image {
    width: 140px;
    height: 175px;
  }
  
  #about h2 {
    font-size: 1.8rem;
  }
  
  .research-title-section h1 {
    font-size: 1.5rem;
  }
  
  .research-hero-content h1 {
    font-size: 1.5rem;
  }
  
  .service-title {
    font-size: 1.8rem;
  }
  
  .teaching-title {
    font-size: 1.8rem;
  }
}

.mentor-grid-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding: 0 2rem;
}

.mentor-card {
  background: #fff;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
  border-radius: 4px;
}

.mentor-photo {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  overflow: hidden;
}

.mentor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mentor-card h3 {
  margin: 0;
  font-weight: 500;
  color: #222;
}

@media (max-width: 900px) {
  .service-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 2rem;
    gap: 2rem;
  }

  .service-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 0;
    line-height: 1.2;
  }
  
  .service-copy {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
  }

  .mentor-grid-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .service-hero-inner {
    padding: 0 1rem;
  }
  
  .service-title {
    font-size: 2rem;
  }
  
  .mentor-grid-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .mentor-card {
    padding: 1.5rem;
  }
}
