html {
  scroll-behavior: smooth;
}

:root {
  --sidebar-width: 300px;
  --sidebar-bg: #1c222b;
  --sidebar-text: #94a3b8;
  --sidebar-heading: #ffffff;
  --accent: #49bf9d;
  --accent-hover: #38a885;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #334155;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
}

/* Base Responsive Image Constraint */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Full Screen App Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Sidebar Avatar */
img.sidebar-avatar,
.sidebar-avatar {
  width: 130px !important;
  height: 130px !important;
  min-width: 130px !important;
  min-height: 130px !important;
  max-width: 130px !important;
  max-height: 130px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto 1.25rem auto !important;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#sidebar h1 {
  color: var(--sidebar-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

#sidebar h1 a {
  color: inherit;
  text-decoration: none;
}

#sidebar .role-title {
  font-size: 0.88rem;
  color: var(--sidebar-text);
  margin-bottom: 2rem;
}

.nav-links {
  list-style: none;
  width: 100%;
  margin-bottom: 2rem;
}

.nav-links li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-links li:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-links a {
  display: block;
  padding: 0.75rem 0;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover, 
.nav-links a.active {
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  padding-top: 1.5rem;
}

.social-icons {
  list-style: none;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.social-icons a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.88rem;
}

.social-icons a:hover {
  color: var(--accent);
}

.copyright-text {
  font-size: 0.8rem;
  color: #64748b;
}

/* Main Content Area */
#main {
  flex: 1;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

@media (min-width: 980px) {
  #app {
    flex-direction: row;
  }

  #sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
  }

  #main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 3.5rem 4rem;
  }
}

.content-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

section {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 10px;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

h2 {
  font-size: 1.8rem;
  color: #0f172a;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.35rem;
  color: #0f172a;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.1rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.2rem;
  font-size: 1.02rem;
  text-align: justify;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

/* 1. Banner Headers */
.hero-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
}

/* 2. Scientific Diagrams & Standalone Figures */
.center-media,
div[style*="text-align: center"] {
  text-align: center;
  margin: 1.5rem auto;
}

.center-media img,
div[style*="text-align: center"] > img {
  max-width: 650px !important;
  max-height: 400px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;
}

/* 3. Image Galleries (Outreach & Telescope photos) */
.gallery,
.image-gallery {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.gallery img,
.image-gallery img {
  max-height: 200px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 6px;
}

.caption {
  font-size: 0.88rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
}

/* 4. Research Interest Features (Homepage) */
.features {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.feature-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feature-img {
  width: 100%;
  max-width: 220px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 6px;
}

@media (min-width: 680px) {
  .feature-item.has-image {
    flex-direction: row;
    align-items: flex-start;
  }

  .feature-item.has-image .feature-img {
    width: 200px;
    height: 140px;
    flex-shrink: 0;
  }
}

/* Team Grid - Wider cards to allow more text room */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

img.avatar-circle,
.avatar-circle {
  width: 150px !important;
  height: 150px !important;
  min-width: 150px !important;
  min-height: 150px !important;
  max-width: 150px !important;
  max-height: 150px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto 1.25rem auto !important;
  border: 3px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.team-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem 0;
}

.team-card p {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
  text-align: center;
}

/* Buttons & Video Wrappers */
.btn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  width: 100%;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #ffffff !important;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s;
  text-align: center;
}

.btn:hover {
  background: var(--accent-hover);
}

.video-box {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.video-box iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}