/* 1. CORE: VARIABLES & BASE */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  /* FOOTER SETTINGS */
  --footer-bg-start: #1c3f1c;
  --footer-bg-end: #1c3f1c;
  --footer-text-color: #ffffff;
  --footer-main-font-size: 1rem;
  --footer-heading-font-size: 1.4rem;
  --footer-heading-color: #ffffff;
  --footer-padding: 2.5rem 2rem 2.5rem;
  --footer-social-bg: rgba(255, 255, 255, 0.1);
  --footer-social-hover-bg: #8bc34a;
  --footer-accent-color: #ffffff;

  /* HERO & PAGE HEADER SETTINGS */
  --hero-title-size: 3.2rem;
  --hero-title-weight: 900;
  --hero-title-spacing: 5px;
  --hero-title-transform: uppercase;
  --hero-title-color: #ffffff;
  --hero-title-shadow:
    1px 1px 0px rgba(0, 0, 0, 0.8), 2px 2px 0px rgba(0, 0, 0, 0.8),
    3px 3px 0px rgba(0, 0, 0, 0.8), 4px 4px 15px rgba(0, 0, 0, 0.8);

  --hero-subtitle-size: 1.2rem;
  --hero-subtitle-weight: 600;
  --hero-subtitle-spacing: 1px;
  --hero-subtitle-color: #ffffff;
  --hero-subtitle-shadow:
    1px 1px 0px rgba(0, 0, 0, 1), 2px 2px 0px rgba(0, 0, 0, 0.5),
    2px 2px 0px rgba(0, 0, 0, 0.5), 2px 2px 15px rgba(0, 0, 0, 0.5);
  --hero-subtitle-margin-top: 1rem;

  --hero-lab-title-size: 1.2rem;
  --hero-lab-title-weight: 700;
  --hero-lab-title-spacing: 2px;
  --hero-lab-title-color: #ffffff;
  --hero-lab-title-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);

  --hero-quote-size: 1.1rem;
  --hero-quote-style: italic;
  --hero-quote-opacity: 0.9;

  /* Mobile Hero Settings */
  --hero-title-size-mobile: 2.2rem;
  --hero-subtitle-size-mobile: 1rem;

  /* Green Ecology Theme Palette */
  --primary-green: #2e7d32;
  --secondary-green: #558b2f;
  --dark-green: #1b5e20;
  --accent-green: #8bc34a;
  --light-green-bg: #f1f8e9;
  --pale-green: #dcedc8;
  --botanical-cream: #fdf7e4;
  --botanical-red: #b04a33;
  --botanical-orange: #e08e45;
  --midnight-blue: #2c3e50;
  --text-main: #050a05;
  --text-muted: #1b301c;
  --text-dark: #2c3e50;
  --white: #f3eed9;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.6);
  --gradient-main: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--secondary-green) 100%
  );
  --shadow-soft: 0 10px 40px rgba(46, 125, 50, 0.1);
  --shadow-hover: 0 15px 45px rgba(46, 125, 50, 0.2);

  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 3rem;
  --space-xl: 5rem;
  --section-padding-v: 4.5rem;
  --section-padding-h: 5%;

  --sig-bg-color: var(--light-green-bg);
  --sig-quote-color: #1b301c;
  --sig-quote-size: 1.45rem;
  --sig-quote-weight: 400;
  --sig-quote-font: "Crimson Text", serif;

  --sig-name-color: var(--primary-green);
  --sig-name-size: 0.95rem;
  --sig-name-weight: 700;
  --sig-name-font: "Outfit", sans-serif;
  --sig-icon-color: var(--accent-green);
  --sig-icon-opacity: 0.15;
}

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

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Text Highlight */
::selection {
  background-color: var(--accent-green);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--accent-green);
  color: #ffffff;
}

/* Utilities */
.cms-text {
  white-space: pre-line;
}

img {
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

/* =========================================
   2. NAVIGATION
   ========================================= */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  padding: 1.1rem 5%;
  z-index: 1000;
  transition: all 0.2s ease-in-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
}

nav.scrolled {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.7rem 5%;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(46, 125, 50, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1002;
  transition: transform 0.3s ease;
}

.nav-brand:hover {
  transform: scale(1.02);
}

.nav-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

nav.scrolled .nav-logo {
  filter: none !important;
}

.nav-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  display: block;
  transition: color 0.3s ease;
}

nav.scrolled .nav-title {
  color: #2d1b17 !important;
}

@media (min-width: 768px) {
  .nav-title {
    display: block;
  }
}

nav ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  align-items: center;
}

nav li {
  position: relative;
}

nav > ul > li > a {
  color: #ffffff;
  font-weight: 800;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  position: relative;
  transition: all 0.3s ease;
  text-shadow: none;
}

nav.scrolled > ul > li > a {
  color: #2d1b17 !important;
}

nav > ul > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  transition: width 0.3s ease;
}

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

nav > ul > li > a:hover {
  opacity: 0.8;
  background: none;
}

/* Profile Link Card */
.profile-link-card {
  margin: 1.5rem auto 2rem;
  background: #f1f8e9;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(46, 125, 50, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 450px;
  width: 100%;
  position: relative;
  overflow: hidden; /* Contains the jungle effect */
}

/* Jungle Leaf Effect: Top Right & Bottom Left */
.profile-link-card::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: var(--secondary-green);
  border-radius: 0 70% 0 70%;
  transform: rotate(15deg);
  opacity: 0.65;
  z-index: 0;
  pointer-events: none;
}

/* Jungle Leaf Effect: Bottom Left */
.profile-link-card::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 110px;
  height: 110px;
  background: var(--primary-green);
  border-radius: 70% 0 70% 0;
  transform: rotate(30deg);
  opacity: 0.65;
  z-index: 0;
  pointer-events: none;
}

/* Ensure text stays on top */
.profile-link-card * {
  position: relative;
  z-index: 1;
}

.profile-link-card .link-label {
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.profile-link-card .link-action {
  font-size: 1rem;
  font-weight: 700;
  color: #2e7d32;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.profile-link-card .link-action:hover {
  color: #1b5e20;
  transform: translateX(3px);
}

.profile-link-card .link-action i {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.profile-link-card .link-action:hover i {
  transform: translateX(3px);
}

/* Hamburger (Mobile) */
.mobile-menu-toggle {
  grid-column: 1; /* Left side on mobile */
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #ffffff;
  cursor: pointer;
  z-index: 1002;
}

nav.scrolled .mobile-menu-toggle {
  color: #2d1b17;
}

/* Dropdowns */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  min-width: 250px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-menu li {
  display: block;
  width: 100%;
}

.dropdown-menu a {
  padding: 0.8rem 1.5rem;
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  color: #2d1b17 !important;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background: var(--light-green-bg);
  color: var(--primary-green);
  padding-left: 1.8rem;
}

/* Desktop Hover Logic */
@media (min-width: 992px) {
  nav li:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
/*Mobile Navigation Styles*/
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: block;
  }

  nav ul {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  nav.mobile-open ul {
    right: 0;
  }

  nav li {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  nav > ul > li > a {
    font-size: 1.1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
  }

  /* Mobile Dropdowns */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin-top: 0;
    display: none;
    background: #f9f9f9;
    padding-left: 1rem;
  }

  /* Active class toggled by JS */
  li.active-dropdown > .dropdown-menu {
    display: block;
  }

  .sub-dropdown {
    background: #f0f0f0;
  }

  .has-submenu:hover > .sub-dropdown {
    display: none;
  }

  /* Using the same JS toggle logic, clicking "Previous members" will toggle its child ul if script supports nested */
  /* If script assumes only top level, we might need a specific rule. JS handles "nav li > a" so it should work for nested too */
  li.active-dropdown > .sub-dropdown {
    display: block;
  }
}

/* =========================================
   3. GLOBAL LAYOUT
   ========================================= */

/* Page Layout Consistency */
section {
  padding: var(--section-padding-v) var(--section-padding-h);
  max-width: 1240px;
  margin: 0 auto;
}

/* Global fix for any content containers */
[id$="-container"] {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure all sections with CMS content have proper constraints */
section[id$="-container"],
section:has([id$="-container"]) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Ensure all CMS content respects fixed width layout */
.cms-merged-content,
[id*="container"] .alternating-layout,
[id*="container"] .circle-item {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Prevent content overflow in CMS containers */
.cms-merged-content *,
[id$="-container"] * {
  box-sizing: border-box !important;
}

section > h2,
#research-overview > h2,
#news > h1,
#collaborators > h2 {
  text-align: center;
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: var(--header-margin-bottom);
}

section > h2::after,
.content-layer h2::after,
#research-overview > h2::after,
#news > h1::after,
#collaborators > h2::after {
  content: "";
  display: block;
  width: 70px;
  height: 5px;
  background: var(--accent-green);
  margin: var(--space-s) auto 0;
  border-radius: 3px;
}

/* Normalized Team Subtitles */
.team-subtitle {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--midnight-blue) !important;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.05) !important;
  letter-spacing: 0.5px;
  margin: 2rem 0 2rem; /* Base margin */
  width: 100%;
}

/* Large spacing between groups (Aggressive override for Previous Members) */
.alternating-layout + .team-subtitle,
.team-subtitle + .team-subtitle,
.team-role-group + .team-role-group,
.team-role-group + .team-subtitle,
.alternating-layout + .team-role-group,
.team-section > .team-subtitle:not(:first-child),
.team-section > .team-role-group:not(:first-child) {
  margin-top: 10rem !important;
}

.team-section {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.content-layer h1,
.content-layer h2,
.content-layer h3 {
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Equalized Section Headings */
.content-layer h2,
section h2 {
  font-size: 2.4rem;
  line-height: 1.25;
  margin-bottom: 1rem;
  font-weight: 800;
  text-align: center;
}

@media (min-width: 992px) {
  .content-layer p,
  section p {
    font-size: 1.15rem;
    line-height: 1.7;
  }
}

.page-header {
  margin-top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* Aligned with Hero sections */
  padding: 1.4rem 10%;
  text-align: left; /* Aligned with Hero sections */
  background: url("images/backgrounds/heros/slide1.avif") no-repeat center
    center/cover;
  color: white;
  border-radius: 0;
  margin-bottom: 2.8rem;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, var(--hero-opacity, 0));
  z-index: 1;
}

.page-header > * {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: var(--hero-title-size);
  font-weight: var(--hero-title-weight);
  color: var(--hero-title-color) !important;
  text-shadow: var(--hero-title-shadow) !important;
  letter-spacing: var(--hero-title-spacing);
  text-transform: var(--hero-title-transform);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: var(--hero-subtitle-size) !important;
  font-weight: var(--hero-subtitle-weight);
  color: var(--hero-subtitle-color) !important;
  text-shadow: var(--hero-subtitle-shadow);
  letter-spacing: var(--hero-subtitle-spacing);
  opacity: 1;
  width: 100%;
  line-height: 1.5;
  margin-top: var(--hero-subtitle-margin-top);
}

/* =========================================
   4. UI COMPONENTS
   ========================================= */

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  background: transparent;
  color: #050a05 !important;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 10px 30px rgba(45, 27, 23, 0.15);
  border: 2px solid #0a0a0a;
}
.btn:hover {
  transform: translateY(-4px);
  background: #2d1b17;
  color: #f0f0f0 !important;
  box-shadow: 0 15px 35px rgba(45, 27, 23, 0.25);
}

.btn-outline {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border: 2px solid #0a0a0a;
  color: #0a0a0a !important;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: transparent;
}
.btn-outline:hover {
  background: #2d1b17;
  color: #f3eed9 !important;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(45, 27, 23, 0.2);
}

.btn-visual-record {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  border: 3px solid #000000;
  color: #000000 !important;
  background: transparent;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-align: center;
  user-select: none;
}

.btn-visual-record:hover {
  background: #000000;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.hidden-desc {
  display: none;
}

.modal-desc .hidden-desc {
  display: block;
  margin-top: 1rem;
}

.modal-desc p {
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes modalScale {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 750px;
  max-height: 85vh;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  animation: modalScale 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-body.no-image {
  grid-template-columns: 1fr;
}

.modal-body {
  display: grid;
  grid-template-columns: 40% 60%;
  width: 100%;
  max-height: 90vh;
}

/* Page Specific Scoping: About Page Modal Gallery Layout */
#about-page .modal {
  z-index: 9999 !important;
  align-items: center !important;
  justify-content: center !important;
}

#about-page .modal-content {
  margin: 0;
}

#about-page .modal-body {
  grid-template-columns: 45% 55%;
}

#about-page .modal-body.no-image {
  grid-template-columns: 1fr !important;
}

#about-page .modal-body.no-image .modal-left-pane {
  display: none !important;
}

#about-page .modal-left-pane {
  background: #f8f9f8;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-green) #f0f0f0;
}

#about-page .modal-left-pane::-webkit-scrollbar {
  width: 6px;
}
#about-page .modal-left-pane::-webkit-scrollbar-thumb {
  background: var(--primary-green);
  border-radius: 10px;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f4f4f4;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: block;
}

#about-page .modal-image {
  height: auto;
  min-height: 100%;
  border-right: none;
}

.modal-info {
  padding: 2.5rem 3rem;
  overflow-y: auto;
  background: var(--white);
  display: block;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-green) #f0f0f0;
}

/* Custom Scrollbar for Modal Text Area */
.modal-info::-webkit-scrollbar {
  width: 6px;
}
.modal-info::-webkit-scrollbar-track {
  background: #f9f9f9;
}
.modal-info::-webkit-scrollbar-thumb {
  background: var(--primary-green);
  border-radius: 10px;
}

.modal-info h3 {
  font-size: 2.3rem;
  color: #2d1b17 !important;
  margin: 0;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: none !important;
}

.modal-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1.5rem;
}

.modal-action-header .btn-outline {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  border-width: 1px;
}

.modal-role {
  font-size: 0.85rem;
  color: #ffffff !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 1.5rem;
  display: inline-block;
  background: var(--accent-green);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  text-shadow: none !important;
}

.modal-desc {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444 !important;
  border-top: 1px solid #eee;
  padding-top: 2rem;
}

.modal-desc p,
.modal-desc span,
.modal-desc div {
  color: #333333 !important;
  display: block;
  font-weight: 500;
  text-shadow: none !important;
}

.modal-desc .hidden-desc {
  display: block;
  margin-top: 1.2rem;
  font-weight: 700;
}

/* Modal Content Sectioning Layout */
.modal-text-section {
  background: #fdfaf0; /* Botanical cream background */
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2.5rem; /* Large spacing between sections */
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

.modal-text-section:last-child {
  margin-bottom: 0;
}

.modal-text-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--primary-green);
}

.modal-section-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-green);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 1.5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 0.5rem;
}

.modal-text-section p {
  margin: 0 !important;
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
  color: #333 !important;
  font-weight: 600 !important;
}

#about-page .modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.modal-gallery {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
  border-top: none;
  padding-top: 0;
  width: 100%;
}

#about-page .modal-gallery-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: filter 0.3s ease;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.modal-gallery-img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  cursor: pointer !important;
  transition: filter 0.3s ease;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

#about-page .modal-gallery-img:hover {
  filter: brightness(0.9);
}

/* Modal Placeholder (Option 2) */
.modal-placeholder-icon {
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--light-green-bg);
  color: var(--primary-green);
  gap: 1.5rem;
  padding: 3rem;
  text-align: center;
}

.modal-placeholder-icon i {
  font-size: 5rem;
  opacity: 0.3;
}

.modal-placeholder-icon span {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  opacity: 0.5;
  color: var(--dark-green);
}

#about-page .modal-body.no-image .modal-left-pane {
  display: none !important;
}

#about-page .modal-body.no-image {
  grid-template-columns: 1fr !important;
}

.modal-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  animation: fadeIn 0.3s ease;
}

.modal-zoom-overlay img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.modal-zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2.5rem;
  font-weight: 200;
  cursor: pointer;
  z-index: 101;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 2rem;
  cursor: pointer;
  color: #050a05;
  z-index: 10;
  font-weight: 800;
}

/* Mobile Modal */
@media (max-width: 991px) {
  .modal-content {
    max-height: 90vh;
    max-width: 500px;
  }
  .modal-body {
    grid-template-columns: 1fr;
    display: block;
    overflow-y: auto;
  }
  .modal-image {
    height: 250px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .modal-info {
    padding: 2rem;
    overflow-y: visible;
  }
}

.talk-card {
  background: var(--white);
  padding: 1.2rem 2rem;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.8rem;
  user-select: none;
}

.talk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.1);
  background: #fdfdfd;
}

.talk-card::after {
  content: "\f061"; /* Simple arrow */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #2d1b17;
  opacity: 0.2;
  transition: all 0.3s ease;
}

.talk-card:hover::after {
  opacity: 1;
  right: 15px;
}

.talk-icon {
  width: 40px;
  height: 40px;
  background: var(--light-green-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d1b17;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Modal Year-wise Content Styling */
.modal-year-section {
  margin-bottom: 2rem;
}

.modal-year-header {
  font-size: 1.2rem;
  color: #2d1b17 !important;
  font-weight: 800;
  border-bottom: 2px solid var(--pale-green);
  padding-bottom: 0.5rem;
  margin: 1.5rem 0 1rem 0;
  display: inline-block;
}

.modal-year-item {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
  text-align: left;
}

.modal-year-item::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 0.8rem;
  color: var(--accent-green);
}

/* Gallery Collage & Lightbox */
.gallery-category-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4/3;
  transition: transform 0.3s;
}
.gallery-category-card:hover {
  transform: scale(1.03);
}
.gallery-category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
}
.gallery-category-card:hover img {
  filter: brightness(0.7);
}

.category-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Cover whole area for gradient */
  padding: 1.5rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: none;
  z-index: 2;
}

.gallery-category-card:hover .category-overlay {
  opacity: 1;
}

.category-overlay h3 {
  margin-bottom: 0.5rem !important;
  font-size: 1.6rem !important;
  color: white !important;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.category-overlay p {
  font-size: 1rem !important;
  color: #ffffff !important;
  margin: 0 !important;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.1s;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.gallery-category-card:hover h3,
.gallery-category-card:hover p {
  transform: translateY(0);
}

/* Mobile Fallback: Visible on touch */
@media (hover: none) {
  .category-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  }
  .category-overlay h3,
  .category-overlay p {
    transform: translateY(0);
  }
}

/* Collage Modal */
.collage-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  overflow-y: auto;
  animation: fadeIn 0.4s ease;
}
.collage-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #eee;
}
.collage-header h2 {
  color: #2d1b17;
}

.collage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  padding: 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}
.collage-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.collage-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.collage-item:hover img {
  transform: scale(1.1);
}

.collage-metadata {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1.2rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    transparent 100%
  );
  color: white;
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

/* Hover-activated reveal */
.collage-item:hover .collage-metadata {
  opacity: 1;
}

.collage-metadata h4 {
  font-size: 1.1rem !important;
  margin-bottom: 0.4rem !important;
  font-weight: 700 !important;
  color: white !important;
  transform: translateY(10px);
  transition: transform 0.4s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.collage-metadata p {
  font-size: 0.85rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  transform: translateY(10px);
  transition: transform 0.4s ease 0.1s;
}

.collage-item:hover .collage-metadata h4,
.collage-item:hover .collage-metadata p {
  transform: translateY(0);
}

/* Mobile Fallback: Visible when hover is unavailable */
@media (hover: none) {
  .collage-metadata {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
    padding: 1rem;
  }
  .collage-metadata h4,
  .collage-metadata p {
    transform: translateY(0);
  }
}

.close-collage {
  font-size: 2.5rem;
  cursor: pointer;
  color: var(--text-main);
  background: none;
  border: none;
  padding: 0.5rem;
  line-height: 1;
}

/* Lightbox (Image Full View) - PREMIUM UPGRADE */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 85%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: premiumZoom 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  background: transparent;
  border: none;
  padding: 5px 10px;
  transition: opacity 0.3s ease;
  user-select: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  padding: 15px 10px;
  background: transparent;
  border: none;
  z-index: 10001;
  transition: opacity 0.3s ease;
  user-select: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 5px;
}
.lightbox-next {
  right: 5px;
}

/* Lightbox Caption for Gallery */
.lightbox-caption {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 200px;
  max-width: 85%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  color: #fff;
  text-align: center;
  display: none;
  z-index: 10002;
}
.lightbox-caption h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.lightbox-caption p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  opacity: 0.9;
}

/* Mobile responsive lightbox caption - smaller text to fit full content */
@media (max-width: 768px) {
  .lightbox-caption {
    bottom: 8px;
    max-width: 96%;
    padding: 0.4rem 0.6rem;
  }
  .lightbox-caption h3 {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
  }
  .lightbox-caption p {
    font-size: 0.6rem;
    line-height: 1.2;
  }
}

@keyframes premiumZoom {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .collage-header {
    padding: 1rem;
  }
  .collage-grid {
    padding: 1rem;
    grid-template-columns: repeat(2, 1fr);
  }
  .collage-item {
    height: 150px;
  }
  .lightbox-prev,
  .lightbox-next {
    font-size: 2rem;
    padding: 0.5rem;
  }
}

/* =========================================
   5. SHARED LAYOUT MODULES
   ========================================= */

/* Circle Layout (Research / Team) */
.alternating-layout {
  display: flex;
  flex-direction: column;
  gap: 6rem;
  padding: 0;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

/* Fix for CMS merged content containers */
.cms-merged-content {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.cms-merged-content .alternating-layout {
  max-width: 100%;
  margin: 0;
}

.cms-merged-content.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.cms-merged-content.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

/* Override video-styles.css to maintain consistent layout */
.cms-merged-content.video-grid,
#teaching-container.video-grid {
  max-width: 1240px !important;
  margin: 0 auto !important;
}

/* Specific teaching page layout fix */
#teaching-page #teaching-container {
  max-width: 1240px !important;
  margin: 40px auto !important;
  width: 100% !important;
}

#teaching-page .cms-merged-content.video-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
  gap: 32px !important;
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Override video-styles.css rules for teaching page */
#teaching-page .video-grid {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
  max-width: 1240px !important;
  margin: 40px auto !important;
  width: 100% !important;
}

/* Fix video cards within teaching page CMS containers */
#teaching-page .cms-merged-content .video-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.circle-item {
  display: flex;
  align-items: center;
  gap: 4rem;
  cursor: pointer;
  opacity: 0;
  animation: fadeInUp 0.6s forwards;
  padding: 1.5rem;
  transition: all 0.3s ease;
  border-radius: 20px;
  min-height: 250px; /* Standardize height for consistency */
  max-width: 100%;
  width: 100%;
}

/* Ensure CMS circle items maintain layout */
.cms-merged-content .circle-item {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.cms-merged-content .circle-img-container {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
}

.cms-merged-content .circle-text {
  flex: 1;
  min-width: 0; /* Prevent flex item from overflowing */
}

/* Automatic Alternating Logic:
   Ready for dynamic front-loading of new research topics */
.alternating-layout .circle-item:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}

.circle-img-container {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  background: var(--white);
}

/* Static Block Adjustments (for full-content scrollable pages) */
.circle-item.static-block {
  cursor: default;
}
.circle-item.static-block:hover {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.circle-item.static-block:hover .circle-img-container {
  transform: none !important;
}

/* Ensure full text visibility in static blocks (No truncation) */
.circle-item.static-block .circle-text .desc {
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: none !important;
  line-clamp: none !important;
}
.circle-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.circle-item.project-item .circle-img-container img {
  object-fit: contain;
  padding: 20px;
  background: #fff;
}

.circle-item:hover .circle-img-container {
  transform: scale(1.08) rotate(2deg);
  border-color: var(--accent-green);
  box-shadow: 0 15px 45px rgba(46, 125, 50, 0.25);
}

.circle-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Circle Layout Text Styling (Default) */
.circle-text h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  /* Line Clamping for Titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.circle-text .role,
.circle-text .project-meta,
.circle-text .team-year {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  opacity: 0.9;
}
.circle-text .team-year {
  color: var(--accent-color, #4facfe);
  margin-bottom: 0.5rem;
  display: block;
}
.circle-text .desc {
  font-size: 1.05rem;
  line-height: 1.6;
  /* Line Clamping for Descriptions */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile Circle Layout */
@media (max-width: 768px) {
  .circle-item,
  .circle-item.right {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .circle-img-container {
    width: 180px;
    height: 180px;
  }
}

/* Research Vision & Mission Block (Home) */
.research-vision-text {
  font-size: 1.5rem;
  line-height: 1.7;
  color: #ffffff;
  margin-bottom: 2.5rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  text-align: justify;
  opacity: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.signature-quote-block {
  position: relative;
  background: var(--sig-bg-color);
  padding: 2rem 3rem;
  border-radius: 24px;
  margin: 2rem 0;
  border: 1px solid rgba(46, 125, 50, 0.05);
  box-shadow: none;
  overflow: hidden;
}

.signature-quote-block::before {
  display: none;
}

.signature-quote-block .quote-icon {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-size: 2.5rem;
  color: var(--sig-icon-color);
  opacity: var(--sig-icon-opacity);
}

#home-page section .signature-quote-block p {
  font-family: var(--sig-quote-font) !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--sig-quote-color) !important;
  font-style: italic !important;
  line-height: 1.6 !important;
  position: relative;
  margin: 0;
  text-align: right;
  text-shadow: none !important;
  filter: none !important;
}

.signature-line {
  margin-top: 2rem;
  font-family: var(--sig-name-font);
  font-weight: var(--sig-name-weight);
  font-size: var(--sig-name-size);
  color: var(--sig-name-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: right;
  border-top: 1px solid rgba(46, 125, 50, 0.2);
  padding-top: 1rem;
  float: right;
}

/* PHILOSOPHY & MISSION LAYOUT */
.featured-mission-box {
  margin: 2.5rem 0 !important;
  width: 100%;
}

/* Featured Mission Box (About Page) */
.featured-mission-box {
  background: var(--light-green-bg);
  border: 4px solid rgba(46, 125, 50, 0.15);
  padding: 3rem;
  border-radius: 12px;
  margin: 1rem 0;
  position: relative;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.04),
    0 1px 8px rgba(0, 0, 0, 0.02);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.featured-mission-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 45px rgba(46, 125, 50, 0.1);
}

/* About Page Scholar Profiles (Premium Lifted Cards) */
.about-scholar-profiles-horizontal {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 3rem 0 0.5rem 0;
  border-top: 1px solid rgba(46, 125, 50, 0.1);
  flex-wrap: wrap;
}

.scholar-profile-item-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 2rem 1.5rem;
  min-width: 160px;
  max-width: 180px;
  background: white;
  border: 1px solid rgba(46, 125, 50, 0.15);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.scholar-profile-item-card:hover {
  transform: translateY(-15px);
  box-shadow: 0 25px 50px rgba(46, 125, 50, 0.2);
  border-color: var(--primary-green);
}

.profile-icon-circle-small {
  width: 70px;
  height: 70px;
  background: var(--text-dark);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  transition: all 0.4s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.scholar-profile-item-card:hover .profile-icon-circle-small {
  background: var(--primary-green);
  transform: rotate(15deg) scale(1.1);
}

.scholar-profile-item-card span {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-dark);
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.scholar-profile-item-card:hover span {
  color: var(--primary-green);
}

@media (max-width: 992px) {
  .about-flex-philosophy {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.featured-mission-box::after {
  content: "\f06c"; /* Leaf icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: var(--accent-green);
  opacity: 0.2;
}

.featured-mission-box h4 {
  color: var(--primary-green);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Mission Box Content Authority */
#about-page .featured-mission-box p,
#research-page .featured-mission-box p,
.featured-mission-box p {
  font-size: 1.1rem !important;
  line-height: 1.8 !important;
  color: #2d1b17 !important;
  margin: 0 !important;
  font-weight: 600 !important;
  font-style: italic !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

@media (max-width: 768px) {
  .signature-quote-block {
    padding: 2rem;
  }
  .signature-quote-block p {
    font-size: 1.2rem;
  }
}

/* Research Page Specific Overrides: Disable modal interactive cues */
#research-page .circle-item {
  cursor: default;
}

#research-page .circle-item:hover .circle-img-container {
  transform: none;
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

/* Research Updates Container Layout Fix */
#research-updates-container {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: 0 var(--section-padding-h) !important;
  box-sizing: border-box !important;
}

#research-updates-container .circle-item {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#research-updates-container .circle-img-container {
  flex-shrink: 0 !important;
  width: 220px !important;
  height: 220px !important;
}

#research-updates-container .circle-text {
  flex: 1 !important;
  min-width: 0 !important;
}

/* Gallery, News, Videos */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  width: 100%;
}
.gallery-item {
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.gallery-item:hover img {
  transform: scale(1.1);
}

/* Botanical Layout Classes (Reference Inspired) */
.botanical-section {
  padding: var(--section-padding-v) var(--section-padding-h) 2rem
    var(--section-padding-h);
  margin: 0 auto;
  max-width: 1350px;
  position: relative;
  overflow: visible;
}

.botanical-grid {
  display: grid;
  grid-template-columns: 500px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1.5rem;
  text-align: left;
  overflow: hidden;
}

.circular-profile {
  width: 450px;
  height: 450px;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  box-shadow: 0 30px 65px rgba(0, 0, 0, 0.15);
  background: white;
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.circular-profile:hover {
  transform: scale(1.02);
}

.circular-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.minimal-icon-bar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
  max-width: 450px;
  margin: 1rem auto 0;
}

.icon-link {
  font-size: 1.6rem;
  color: #2d1b17;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: rgba(176, 74, 51, 0.08);
  font-weight: 800;
}

.icon-label {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  line-height: 1;
}

.icon-link:hover {
  color: var(--white);
  background: var(--botanical-red);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(176, 74, 51, 0.3);
}

.botanical-content h4 {
  color: #2d1b17;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 2px;
  margin-bottom: 0.2rem;
}

.botanical-content h2 {
  font-size: 3.5rem;
  color: #2d1b17;
  margin-bottom: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  text-align: left;
}

.botanical-content .subtitle {
  color: #2d1b17;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1.7rem;
  display: block;
  opacity: 1;
}

.botanical-content p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  color: #1a1a1a !important; /* Solid charcoal for maximum clarity */
  font-weight: 500;
  text-shadow: none;
  opacity: 1 !important;
  text-align: justify;
  text-justify: inter-word;
}

.highlight-orange {
  color: var(--botanical-orange);
  font-weight: 700;
  text-decoration: underline;
}

.sidebar-action-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 450px;
  margin: 1.5rem auto;
}

.sidebar-action-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(46, 125, 50, 0.15);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.sidebar-action-card i {
  font-size: 1.2rem;
  color: var(--botanical-red);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(176, 74, 51, 0.08);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sidebar-action-card span {
  font-size: 1rem;
  font-weight: 700;
  color: #2d1b17;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-action-card:hover {
  background: white;
  transform: translateX(8px);
  border-color: var(--botanical-red);
  box-shadow: 0 10px 30px rgba(176, 74, 51, 0.1);
}

.sidebar-action-card:hover i {
  background: var(--botanical-red);
  color: white;
}

#modal-desc.modal-desc p strong {
  color: var(--botanical-red) !important;
  font-weight: 800;
}

@media (max-width: 991px) {
  .botanical-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .profile-sidebar {
    margin-bottom: 2rem;
  }
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
.news-tile {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.news-tile-img {
  height: 240px;
  overflow: hidden;
  background: #fff;
}
.news-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 15px;
  transition: transform 0.5s ease;
}
.news-tile:hover .news-tile-img img {
  transform: scale(1.05);
}
.news-tile-content {
  padding: 1.8rem;
  background: white;
  flex: 1;
}

.news-tile-content h3 {
  font-weight: 800 !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  color: var(--midnight-blue) !important;
  font-size: 1rem;
  line-height: 1.4;
}

.news-tile-content p {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.6;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  color: #444 !important;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-l);
}

@media (max-width: 991px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
.video-card {
  background: #55978c;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-caption {
  padding: 1.2rem;
  font-weight: 600;
  color: #2d1b17;
  font-size: 1.1rem;
  text-shadow: none !important;
}

/* Reference Card Design (Honors & Editorial) */
.awards-editorial-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-l);
  max-width: 900px;
  margin: var(--space-xl) auto;
  padding: 0 1rem;
}

.reference-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
  padding: 2.1rem 1.4rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  position: relative;
  overflow: hidden;
}

.reference-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 60%;
  background: var(--primary-green);
  border-radius: 0 4px 4px 0;
  opacity: 0.8;
}

.reference-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(46, 125, 50, 0.12);
}

.card-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1.5rem;
}

.card-left {
  flex: 1;
  text-align: right;
  padding-right: 0.5rem;
}

.card-left h3 {
  font-size: 2rem;
  line-height: 1.1;
  color: #1a1a1a !important;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: -0.5px;
  text-shadow: none !important;
}

.card-divider {
  width: 2px;
  height: 80px;
  background-color: var(--secondary-green);
  opacity: 0.5;
}

.card-right {
  flex: 1.2;
  text-align: left;
  padding-left: 0.5rem;
}

.card-right p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 500;
  margin: 0;
  text-shadow: none !important;
}

@media (max-width: 768px) {
  .card-content {
    flex-direction: row;
    gap: 1rem;
  }
  .card-left h3 {
    font-size: 1.5rem;
  }
  .card-divider {
    height: 60px;
  }
}

/* Circular Category Cards (Awards/Editorial Selection) */
.circle-card-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--white);
  box-shadow: var(--shadow-soft);
  transition: all 0.4s ease;
  z-index: 2;
  position: relative;
}

.gallery-category-card:hover .circle-card-img {
  transform: scale(1.08) rotate(2deg);
  border-color: var(--accent-green);
  box-shadow: var(--shadow-hover);
}

.circle-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Staggered Honors/Editorial Arrangement */
.alternating-circles-pane {
  background: transparent;
  padding: 2.8rem 5%;
  color: var(--text-main);
  overflow: hidden;
  margin: 0.7rem 0;
}

.alternating-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.5rem;
  max-width: 1300px;
  margin: 0 auto 4.5rem;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.alternating-item:last-child {
  margin-bottom: 0;
}

.alternating-item.reverse {
  flex-direction: row-reverse;
  text-align: right;
}

.large-circle-img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 3px solid var(--white);
  flex-shrink: 0;
}

.large-circle-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.alternating-item:hover .large-circle-img img {
  transform: scale(1.05);
}

.alternating-text-side {
  flex: 1;
  max-width: 600px;
}

.alternating-text-side h2 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #2d1b17 !important;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-shadow: none !important;
}

.alternating-text-side p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #1a1a1a !important;
  font-weight: 500;
  margin: 0;
  text-shadow: none !important;
}

/* Specific pane for About page selection */
.selection-pane {
  background: var(--light-green-bg);
  padding: var(--space-xl) var(--section-padding-h);
  border-radius: 30px;
  margin: var(--space-xl) 0;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}

.text-selection-item {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-green);
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.text-selection-item:hover {
  transform: translateX(10px);
  background: var(--light-green-bg);
}

/* PAGE SPECIFIC SECTIONS */

/* HOME PAGE */

/* Layout & Hero */
.fixed-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-image) no-repeat center center/cover fixed;
  z-index: -2;
}

.fixed-background::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, var(--bg-overlay-opacity, 0.35));
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  color: var(--white);
  padding: 1.4rem 10%;
  margin-top: 0;
  overflow: hidden;
  margin-bottom: 2.8rem;
}

.hero-slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--dark-green); /* Use theme color instead of black */
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  /* Cinematic Morph: Combine smooth opacity with a subtle scale-down and blur-to-focus */
  transition:
    opacity 1s ease-in-out,
    transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1),
    filter 1s ease;
  transform: scale(1.08);
  filter: blur(2px);
  will-change: opacity, transform;
}

.slide.active {
  opacity: 1;
  z-index: 3; /* Active slide on top */
  transform: scale(1);
  filter: blur(0);
}

/* Gapless Transition: The previous slide stays solid at mid-layer while the new one fades in */
.slide.last-active {
  opacity: 1;
  z-index: 2;
  transform: scale(1);
  filter: blur(0);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 20, 0, 0) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  animation: fadeInUp 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.hero-content h1 {
  font-size: var(--hero-title-size);
  line-height: 1.1;
  margin-bottom: 1rem;
  font-weight: var(--hero-title-weight);
  letter-spacing: var(--hero-title-spacing);
  text-transform: var(--hero-title-transform);
  color: #ffffff !important;
  text-shadow: var(--hero-title-shadow) !important;
}

.hero-content p.hero-quote {
  font-size: var(--hero-quote-size) !important;
  font-style: var(--hero-quote-style);
  opacity: var(--hero-quote-opacity);
  font-weight: 500;
  letter-spacing: 0.5px;
  max-width: 600px;
  margin-top: 0.5rem;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

.hero-lab-name {
  font-size: var(--hero-lab-title-size);
  font-weight: var(--hero-lab-title-weight);
  letter-spacing: var(--hero-lab-title-spacing);
  color: var(--hero-lab-title-color) !important;
  text-shadow: var(--hero-lab-title-shadow) !important;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-content p:not(.hero-quote):not(.hero-lab-name) {
  font-size: var(--hero-subtitle-size);
  font-family: inherit;
  font-style: normal;
  font-weight: var(--hero-subtitle-weight);
  letter-spacing: var(--hero-subtitle-spacing);
  max-width: 650px;
  line-height: 1.5;
  color: var(--hero-subtitle-color) !important;
  text-shadow: var(--hero-subtitle-shadow) !important;
  margin-top: var(--hero-subtitle-margin-top);
}

/* Slideshow Controls - Left Aligned & Minimalist */
.slideshow-controls {
  position: absolute;
  bottom: 5rem;
  left: 10%;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.slideshow-controls button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
  backdrop-filter: blur(2px);
  border-radius: 4px;
}

.slideshow-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
}

.slide-dots {
  position: absolute;
  bottom: 3.5rem;
  left: 10%;
  display: flex;
  gap: 1.5rem;
  z-index: 100;
}

.slide-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

/* 44px hit area for accessibility without altering visual layout */
.slide-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
}

.slide-dot.active {
  background: var(--accent-green);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(139, 195, 74, 0.5);
}

.slide-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.scroll-down {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.5rem;
  z-index: 100;
  animation: bounce 2s infinite;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.scroll-down:hover {
  opacity: 1;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Research Highlights (Home) */
.research-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .research-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .research-highlights {
    grid-template-columns: 1fr;
  }
}
#research-overview > h2 {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary-green);
  margin-bottom: var(--header-margin-bottom);
}

.highlight-card {
  background: var(--white);
  border-radius: 20px;
  padding: 0; /* Removing padding to allow header to fill */
  box-shadow: var(--shadow-soft);
  /* border-top: 5px solid var(--secondary-green); - Removed for split layout */
  transition: transform 0.3s;
  text-align: center;
  overflow: hidden; /* Ensures header corners clip to border-radius */
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure equal height in grid */
}

.highlight-card h3 {
  background-color: #8bc34a; /* Lighter Jungle/Sage Green */
  color: #ffffff;
  margin: 0;
  padding: 2.5rem 1.5rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 0;
}

.highlight-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.highlight-card p {
  color: #3d2b27 !important;
  font-weight: 500;
  text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  margin: 0;
  flex-grow: 1; /* Pushes content to fill space */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stats Container (Home) */
.stats-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-l);
  margin-top: var(--space-xl);
  padding: var(--space-l);
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: #2d1b17;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 800;
}

/* Collaborators & Funders User-Scrollable Pane */
.scroll-container-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-top: var(--space-l);
}

.marquee-container {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  position: relative;
  width: 100%;
  scroll-behavior: smooth;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.marquee-container::-webkit-scrollbar {
  display: none;
}

.marquee-content {
  display: flex;
  gap: 2rem;
}
/* Global Page Header Refinement (applied to all subpages) */

.scroll-nav-btn {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--primary-green);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 10;
  flex-shrink: 0;
}

.scroll-nav-btn:hover {
  background: var(--primary-green);
  color: white;
  transform: scale(1.1);
}

.scroll-nav-btn i {
  font-size: 0.8rem;
}

.collaborator-card {
  flex: 0 0 200px;
  background: white;
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 130px;
}

.collaborator-card:hover {
  border-color: var(--accent-green);
  box-shadow: var(--shadow-soft);
  transform: translateY(-5px);
}

.collaborator-card.dark-logo-card {
  background: #5e8d4e !important;
  border-color: rgba(255, 255, 255, 0.1);
}

.collaborator-card.dark-logo-card h4 {
  color: white !important;
}

.collaborator-card.dark-logo-card .logo-container img {
  filter: none !important;
}

.logo-container {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  width: 100%;
}

.logo-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.collaborator-card:hover img {
  filter: grayscale(0%);
}

.collaborator-card h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bottom Hero (Lab Outcomes) - Mirrored from Primary Hero */
.bottom-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* Aligned with primary hero */
  padding: var(--space-xl) 10%; /* Matched primary hero padding */
  text-align: left; /* Aligned with primary hero */
  background: url("images/backgrounds/heros/slide4.avif") no-repeat center
    center/cover;
  color: white;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  margin-top: var(--space-xl);
}

.bottom-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10, 40, 10, 0.7) 0%,
    rgba(0, 0, 0, 0.9) 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.bottom-hero > * {
  position: relative;
  z-index: 2;
}

.bottom-hero h2 {
  font-size: var(--hero-title-size);
  font-weight: var(--hero-title-weight);
  margin-bottom: 1rem;
  letter-spacing: var(--hero-title-spacing);
  color: #ffffff !important;
  text-shadow: var(--hero-title-shadow);
  text-transform: var(--hero-title-transform);
}

.bottom-hero p {
  font-size: var(--hero-subtitle-size) !important;
  max-width: 800px;
  line-height: 1.5;
  font-weight: var(--hero-subtitle-weight);
  opacity: 1;
  color: #ffffff !important;
  text-shadow: var(--hero-subtitle-shadow);
}

.bottom-hero:hover::before {
  background: linear-gradient(
    to bottom,
    rgba(46, 125, 50, 0.7) 0%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

.bottom-hero .hidden-desc {
  display: none;
}

#about-page .bottom-hero {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: 300px;
  padding: 4rem 10%;
  justify-content: center;
}

#about-page footer {
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  #about-page .bottom-hero {
    min-height: 250px;
    padding: 3rem 5%;
  }
}

@media (max-width: 768px) {
  .bottom-hero {
    min-height: 350px;
    padding: 3rem 5%;
  }
  .bottom-hero h2 {
    font-size: 2.5rem;
    letter-spacing: -1px;
  }
  .bottom-hero p {
    font-size: 1.1rem;
    padding: 0 1rem;
  }
}

/* --- ABOUT PAGE --- */

/* Home & About Page Specifics */

/* Tighten spacing between Home sections */
#research-overview,
#news,
#collaborators {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

/* About Grid (PI Profile) */
.about-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 4rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.profile-img {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  background: white;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.profile-img:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.1);
}

/* About Page Extras */
.about-extra-section {
  margin-bottom: var(--space-l);
}

/* Redirecting to global .page-header logic */
#about-page .page-header {
  margin-bottom: 0 !important;
}

/* --- TEAM & PROJECTS --- */

/* Team Pages Global Background & Hero Settings */
.team-group .page-header {
  background-image: url("images/backgrounds/heros/bg-team.avif") !important;
  margin-bottom: 0 !important;
}

.team-group .fixed-background {
  --bg-image: url("images/backgrounds/team.avif");
  --bg-overlay-opacity: 0;
}

.team-group section h1,
.team-group section h2,
.team-group section h3,
.team-group section h4 {
  color: #ffffff !important;
  text-shadow:
    0 2px 15px rgba(0, 0, 0, 0.8),
    0 1px 5px rgba(0, 0, 0, 1) !important;
  font-weight: 800;
}

/* Projects Pages Global Background & Hero Settings */
.projects-group .page-header {
  background-image: url("images/backgrounds/heros/bg-project.avif") !important;
  margin-bottom: 0 !important;
}

.projects-group .fixed-background {
  --bg-image: url("images/backgrounds/project.avif");
  --bg-overlay-opacity: 0;
}

#gallery-page .fixed-background {
  --bg-image: url("images/backgrounds/gallery.avif");
  --bg-overlay-opacity: 0;
}

#gallery-page .page-header {
  background-image: url("images/backgrounds/gallery.avif") !important;
  margin-bottom: 0 !important;
}

#research-page .fixed-background {
  --bg-image: url("images/backgrounds/research.avif");
  --bg-overlay-opacity: 0;
}

#research-page .page-header {
  background-image: url("images/backgrounds/heros/bg-research.avif") !important;
  margin-bottom: 0 !important;
}

.projects-group section h1,
.projects-group section h2,
.projects-group section h3,
.projects-group section h4 {
  color: #ffffff !important;
  text-shadow:
    0 2px 15px rgba(0, 0, 0, 0.8),
    0 1px 5px rgba(0, 0, 0, 1) !important;
  font-weight: 800;
}

#about-page .about-layer-solid {
  background: var(--botanical-cream);
  padding: 0; /* Padding handled by child sections for uniform grid/max-width */
  position: relative;
  z-index: 1;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
}

#about-page .about-reveal-gap {
  height: 50vh; /* height for reveal effect */
  background: transparent;
  pointer-events: none;
}

#about-page .about-layer-solid section {
  max-width: 1400px;
  margin: 0 auto;
}

#about-page .botanical-content h2,
#about-page .botanical-content h3,
#about-page .botanical-content h4,
#about-page .subtitle {
  color: var(--midnight-blue) !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05) !important;
  letter-spacing: 0.5px;
  font-weight: 800;
}

/* Consolidated Team & Project Section Headings (On-Page Sections Only) */

.about-extra-section h3 {
  color: #2d1b17;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--pale-green);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.vision-mission-box p,
.vision-mission-box li {
  color: #2d1b17 !important;
  text-shadow: none !important;
  font-weight: 500;
}
.about-links {
  list-style: none;
  padding: 0;
}
.about-links li {
  margin-bottom: 0.8rem;
}
.about-links a {
  display: block;
  padding: 1rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.about-links a:hover {
  transform: translateX(5px);
  border-left-color: var(--accent-green);
  color: #2d1b17;
  box-shadow: var(--shadow-soft);
}

/* Global Responsiveness */
@media (max-width: 991px) {
  :root {
    --space-xl: 4rem;
    --section-padding-v: 3.5rem;
  }
  nav {
    padding: var(--space-s) var(--section-padding-h);
    display: flex;
    justify-content: space-between;
  }

  .nav-brand {
    order: 2;
  }

  .mobile-menu-toggle {
    display: block;
    order: 1;
  }

  nav ul {
    order: 3;
  }
}

@media (max-width: 768px) {
  :root {
    --space-m: 1.2rem;
    --space-l: 2rem;
    --space-xl: 3rem;
    --section-padding-v: 2.8rem;
    --section-padding-h: 1.25rem;
    --header-margin-bottom: 1rem;
  }
  .hero {
    padding: var(--section-padding-v) var(--section-padding-h);
    justify-content: center;
    text-align: center;
  }
  .hero-content h1 {
    font-size: var(--hero-title-size-mobile);
    letter-spacing: -1px;
  }
  .hero-content p {
    font-size: var(--hero-subtitle-size-mobile);
    margin: 0 auto;
  }

  .page-header {
    padding: 6rem var(--section-padding-h) var(--space-xl);
    text-align: center;
  }

  .page-header h1 {
    font-size: var(--hero-title-size-mobile);
  }

  nav {
    padding: var(--space-s);
  }

  .nav-title {
    display: none;
  }

  /* Restored responsive styles */
  .page-header h1 {
    font-size: var(--hero-title-size-mobile);
  }
  .about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-l);
  }

  section {
    padding: var(--section-padding-v) var(--section-padding-h);
  }

  .collaborator-grid {
    gap: var(--space-s);
  }
  .collaborator-card {
    width: calc(50% - var(--space-xs));
  }
}

/* Project Section Geometry (Square) */
#projects-section .circle-img-container,
.projects-group .modal-content,
.projects-group .modal-image,
#projects-section .circle-item:hover .circle-img-container,
#projects-section .domain-image,
#projects-section .domain-card {
  border-radius: 0 !important;
}

#projects-section .circle-img-container {
  border: 4px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.projects-group .modal-content {
  border-radius: 0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.projects-group .modal-image {
  border-radius: 0 !important;
}

#team-modal.centered-modal .modal-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#team-modal.centered-modal .modal-info {
  width: 100%;
  max-width: 800px;
}

#team-modal.centered-modal .modal-role {
  margin-left: 0 !important;
  margin-right: auto !important;
  display: inline-block !important;
}

/* BOOKS */

/* Books Grid */
/* Books Grid Header Fix */
#books-page section {
  max-width: 1240px !important;
  margin: 0 auto !important;
  padding: var(--section-padding-v) 2rem !important;
}

/* Books Grid: Responsive Logic */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .book-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 850px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .book-grid {
    grid-template-columns: 1fr;
  }
}

/* Book Tile: Fixed Height Immunity */
.book-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 520px; /* Locked height for all cards */
  max-width: 280px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

/* Book Cover: Fixed Dimension */
.book-cover {
  width: 100%;
  height: 380px; /* Locked height for all cover images */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  background: #1a1a1a; /* Background for small/transparent images */
}

.book-tile:hover .book-cover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  border-color: var(--accent-green);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mandatory aspect ratio handling */
  object-position: center;
  display: block;
}

/* Book Title: Wrapped and Limited */
.book-link {
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2; /* Standard property */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.8em; /* Force fixed height for title area */
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  width: 100%;
  padding: 0 0.5rem;
}
.book-link {
  font-weight: 700;
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  display: block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}
.book-link:hover {
  color: var(--accent-green) !important;
  transform: translateY(-2px);
}
.book-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9) !important;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.book-meta a {
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  display: block;
  margin-top: 0.3rem;
  transition: all 0.3s ease;
}
.book-meta a:hover {
  text-decoration: underline;
  color: #8bc34a !important;
}

/* PUBLICATIONS */

/* Year Filters */
.year-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 1rem;
}

.filter-btn {
  padding: 0.6rem 1.4rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--secondary-green);
  color: var(--midnight-blue);
  border-radius: 50px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
  background: var(--secondary-green);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
  background: var(--midnight-blue);
  border-color: var(--midnight-blue);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Publications List */
.year-group {
  margin-bottom: 4rem;
}
#publications-page .year-group > h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e08e45;
  text-shadow:
    2px 2px 5px rgba(0, 0, 0, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.5),
    2px 2px 5px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.8rem;
  margin-top: 0.5rem;
  font-weight: 800;
  border-bottom: 3px solid var(--pale-green);
  padding: 0.8rem;
  display: inline-block;
}
.publication-list {
  list-style: none;
  max-width: 850px;
  margin: 0 auto;
}
.publication-item {
  padding: 1.25rem 2.5rem; /* Taller vertically relative to width */
  background: #ffffff;
  border-radius: 6px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border-left: 3px solid var(--primary-green); /* Thinner accent line */
  transition: all 0.3s ease;
  position: relative;
}
.publication-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
#publications-page .pub-title {
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--midnight-blue); /* Changed to Midnight Blue for distinction */
  margin-bottom: 0.75rem;
  display: block;
}
.pub-authors {
  color: #444;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
}
.pub-journal {
  font-style: italic;
  color: #666;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}
.pub-link {
  color: #a0402a;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-decoration: none;
  opacity: 0.7;
  transition: all 0.2s ease;
}
.pub-link:hover {
  opacity: 1;
}

#pub-count-container {
  background: #ffffff;
  padding: 0.7rem 2.5rem;
  border-radius: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin: 0 auto 3.5rem auto; /* Vertical rhythm: space after filters, space before list */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 255, 81, 0.06);
  border-color: #2c3e50;
  position: relative;
  z-index: 5;
}

#pub-count {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a332a;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* THEME & REFINEMENTS */

/* High-Contrast Dark-Themed Modal Overrides */
.dark-selection-modal {
  background: rgba(10, 20, 10, 0.98) !important;
}

.dark-selection-modal .collage-header,
.dark-selection-modal .collage-grid {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-selection-modal .collage-header h2,
.dark-selection-modal .close-collage {
  color: white !important;
}

.dark-detail-modal .modal-content {
  background: #0a0a0a !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-detail-modal #modal-name {
  color: #ffffff !important;
}

.dark-detail-modal #modal-role,
.dark-detail-modal #modal-desc {
  color: rgba(255, 255, 255, 0.8) !important;
}

.dark-detail-modal .close-modal {
  color: white !important;
}

@media (max-width: 992px) {
  .alternating-item,
  .alternating-item.reverse {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .large-circle-img {
    width: 200px;
    height: 200px;
  }
}

/* Research Page Font Optimizations (After removing Key Focus) */
.direct-item-image {
  text-decoration: none !important;
  color: inherit !important;
}

.direct-item-image .circle-text h3 {
  font-size: 2.5rem !important;
  margin-bottom: 1.2rem !important;
}

/* --- High Precision Surface Refinement (Cream on Dark) --- */
body.pilot-surface-refinement h1:not(.hero-content h1):not(.page-header h1),
body.pilot-surface-refinement h2,
body.pilot-surface-refinement
  h3:not(.highlight-card h3):not(.news-tile-content h3),
body.pilot-surface-refinement .subtitle:not(.highlight-card h3) {
  color: #f0f0f0 !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
}

body.pilot-surface-refinement
  p:not(.hero-content p):not(footer p):not([class*="card"] p):not(
    [class*="-tile"] p
  ):not(.botanical-content p):not(.modal-desc p),
body.pilot-surface-refinement section:not(footer) li:not(footer li) {
  color: #ffffff !important;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8) !important;
}

body.pilot-surface-refinement p:not(footer p),
body.pilot-surface-refinement section li:not(footer p) {
  font-size: 1.25rem !important;
  line-height: 1.6 !important;
}

body.pilot-surface-refinement nav.transparent-nav:not(.scrolled) > ul > li > a,
body.pilot-surface-refinement nav.transparent-nav:not(.scrolled) .nav-brand,
body.pilot-surface-refinement nav.transparent-nav:not(.scrolled) span {
  color: #ffffff !important;
  text-shadow: none !important;
  font-weight: 800 !important;
  transition: all 0.3s ease;
}

body.pilot-surface-refinement nav.transparent-nav .nav-title {
  font-size: 0.85rem !important;
  font-weight: 800 !important;
}

body.pilot-surface-refinement nav.scrolled a,
body.pilot-surface-refinement nav.scrolled span {
  color: #2d1b17 !important;
  text-shadow: none !important;
}

/* TYPOGRAPHY */
/* HOME PAGE (#home-page) */
#home-page section h2,
#home-page section h3 {
  color: #ffffff;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  margin-top: 1rem;
  text-align: center;
  text-shadow:
    2px 2px 15px rgba(0, 0, 0, 0.6),
    2px 2px 15px rgba(0, 0, 0, 0.6);
}

/* Targeted About Header Styling */
#home-page #about > h2 {
  font-size: 3rem;
  margin-bottom: 0px;
  line-height: 1.1;
  padding-bottom: 0;
  text-align: right;
  text-align-last: right;
  font-weight: 700;
  text-shadow:
    2px 2px 15px rgba(0, 0, 0, 0.8),
    2px 2px 15px rgba(0, 0, 0, 0.5),
    2px 2px 15px rgba(0, 0, 0, 0.5);
}
#home-page #about > h2::after {
  content: none;
}
#home-page #about > h3 {
  font-size: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  position: relative;
  text-align: right;
  text-align-last: right;
  font-weight: 700;
  text-shadow:
    2px 2px 15px rgba(0, 0, 0, 0.8),
    2px 2px 15px rgba(0, 0, 0, 0.5),
    2px 2px 15px rgba(0, 0, 0, 0.5);
}
#home-page #about > h3::after {
  content: "";
  display: block;
  width: 70px;
  height: 5px;
  background: var(--accent-green);
  margin: 1rem 0 0 auto;
  border-radius: 3px;
}
#home-page section p,
#home-page section li {
  color: #ffffff !important;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.6;
  text-shadow:
    2px 2px 10px rgba(0, 0, 0, 0.8),
    2px 2px 10px rgba(0, 0, 0, 0.5),
    2px 2px 10px rgba(0, 0, 0, 0.5) !important;
}

/* CARDS & TILES: Reset text for readability on light backgrounds */
#home-page .highlight-card h3,
#home-page .news-tile-content h3 {
  color: #2c3e50 !important;
  text-shadow: none !important;
}

#home-page .highlight-card p,
#home-page .news-tile-content p,
#home-page .news-tile-content .news-date {
  color: #2d1b17 !important;
  text-shadow: none !important;
  font-weight: 500;
}

/* STATS: Green Numbers on Cream Card */
#home-page .stat-number {
  color: var(--primary-green) !important;
  text-shadow: none !important;
}
#home-page .stat-label {
  color: #2d1b17 !important;
  text-shadow: none !important;
}

/* About Page styles inherited from global .page-header */

#about-page section h2,
#about-page section h3 {
  color: #2d1b17 !important;
  text-shadow: none;
}
#about-page section p,
#about-page section li {
  color: #2d1b17;
  font-weight: 600;
}
#about-page .subtitle {
  color: var(--botanical-red);
}
#about-page .botanical-content h4 {
  color: var(--primary-green);
}
#about-page .talk-card h4 {
  color: #2d1b17 !important;
}

/* RESEARCH PAGE (#research-page) */
#research-page section h2,
#research-page section h3 {
  color: #ffffff;
  font-weight: 800;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.8);
}
#research-page section h2::after {
  background: #ffffff;
}
#research-page section p,
#research-page section li,
#research-page .desc {
  color: #ffffff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
#research-page .circle-text h3 {
  color: #ffffff;
}

/* TEAM PAGES (.team-group) - covers postdoctoral, phd, associates, interns etc */
.team-group section h2,
.team-group section h3 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.team-group section h2::after {
  background: #ffffff;
}
.team-group .circle-text h3 {
  color: #ffffff;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  font-weight: 700;
}
.team-group .circle-text .role {
  color: #ffffff;
  opacity: 1;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.9);
}
.team-group .circle-text .desc {
  color: #ffffff;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 1);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.9);
}
.team-group .team-subtitle {
  color: #ffffff;
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.9);
}

/* PROJECTS PAGES (.projects-group) - covers ongoing and completed */
.projects-group section h1,
.projects-group section h2,
.projects-group section h3 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.projects-group section h2::after {
  background: #ffffff;
}
.projects-group .desc,
.projects-group .project-meta {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-weight: 600;
}

/* NEWS PAGE (#news-page) */
#news-page section h2,
#news-page section h3 {
  color: var(--primary-green);
  text-shadow: none;
}
#news-page .news-event-content h3 {
  color: var(--midnight-blue);
}
#news-page .news-event-content p {
  color: #444444;
  font-weight: 500;
}
#news-page .news-event-date {
  color: #666666;
}

/* BOOKS PAGE (#books-page) */
#books-page section h2,
#books-page section h3 {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
}

#books-page section h2::after {
  background: #ffffff !important;
}

#books-page .book-tile h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: #ffffff;
}

#books-page .book-tile p {
  font-size: 0.9rem;
  color: #ddd;
}

/* TEACHING PAGE (#teaching-page) */
#teaching-page section h2,
#teaching-page section h3 {
  color: var(--primary-green);
  text-shadow: none;
}
#teaching-page .video-caption {
  color: #050a05;
  font-weight: 600;
  margin-top: 1rem;
}
#teaching-page section p {
  color: #050a05;
  font-weight: 600;
}

/* PUBLICATIONS PAGE (#publications-page) */
#publications-page section h2,
#publications-page section h3 {
  text-shadow: none;
}
#publications-page .pub-item p {
  color: #2d1b17;
}
#publications-page #pub-count {
  color: var(--primary-green);
  font-weight: 600;
  font-size: 1.1rem;
}

/* GALLERY PAGE (#gallery-page) */
#gallery-page section h2,
#gallery-page section h3 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
#gallery-page section h2::after {
  background: #ffffff;
}
#gallery-page .category-overlay h3 {
  color: #ffffff;
}

.page-header h1,
.hero-content h1 {
  color: #ffffff !important;
  text-shadow: var(--hero-title-shadow) !important;
}

.page-header p,
.hero-content p {
  color: #ffffff !important;
  text-shadow: var(--hero-subtitle-shadow) !important;
}

/* BOOKS PAGE GALLERY CAROUSEL */
.books-gallery-section {
  padding: 6rem 5%;
  background: transparent;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-align: center;
}

.books-gallery-section .section-title,
.books-gallery-section .section-subtitle {
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.books-gallery-section .section-subtitle {
  opacity: 0.9;
}

.books-carousel-wrapper {
  position: relative;
  margin: 3rem auto 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 1200px;
}

.books-carousel-track-container {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.05);
}

.books-carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  gap: 20px;
  padding: 10px;
}

.carousel-item {
  width: 300px;
  height: 300px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.carousel-item:hover img {
  transform: scale(1.05);
}

.carousel-nav {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 10;
  color: white;
  font-size: 1.2rem;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .books-carousel-wrapper {
    gap: 1rem;
  }

  .carousel-item {
    width: 260px;
    height: 260px;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
  }
}

/* FOOTER */

/* FOOTER VARIABLES */
footer {
  background: linear-gradient(
    135deg,
    var(--footer-bg-start) 0%,
    var(--footer-bg-end) 100%
  );
  color: var(--footer-text-color) !important;
  padding: var(--footer-padding);
  margin-top: auto;
  text-align: center;
  font-size: var(--footer-main-font-size);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-info p {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.8rem 0 1.8rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--footer-social-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s;
}

.social-icon:hover {
  background: var(--footer-social-hover-bg);
  color: var(--dark-green);
  transform: translateY(-3px);
}

.copyright {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* This block is at the bottom to ensure it overrides all theme or surface refinement rules */
footer,
footer p,
footer span,
footer div,
footer i,
footer strong,
.copyright {
  color: var(--footer-text-color);
  font-size: var(--footer-main-font-size);
  text-shadow: none;
  line-height: 1.6;
  opacity: 1;
}

footer strong {
  color: var(--footer-heading-color) !important;
  font-size: var(--footer-heading-font-size) !important;
  font-weight: 800 !important;
}

.copyright {
  opacity: 0.7;
  font-size: 0.85rem !important;
  margin-top: 1.5rem !important;
}

.footer-disclaimer:hover {
  text-decoration: underline !important;
  opacity: 0.8;
}

footer {
  position: relative !important;
  width: 100% !important;
  clear: both !important;
  margin-top: 4rem !important;
  background: linear-gradient(
    135deg,
    var(--footer-bg-start) 0%,
    var(--footer-bg-end) 100%
  );
  z-index: 10;
}

/* Specific fix for Research and Gallery pages where footer appears to "float" due to short content */
#research-page,
#gallery-page {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}

#research-page .page-header,
#research-page section,
#gallery-page .page-header,
#gallery-page section {
  position: relative;
  z-index: 1;
}

#research-page footer,
#gallery-page footer {
  margin-top: auto !important;
}

/* =========================================
   VIDEO STYLES (Migrated from video-styles.css)
   ========================================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* strictly equal 50/50 */
  gap: 32px;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
}

.video-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: #000;
}

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

.video-caption {
  padding: 24px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  text-align: center;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video Mobile Styles */
@media (max-width: 850px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* =========================================
   5. MOBILE REMEDIATION (CORRECTIVE PASS)
   ========================================= */
@media (max-width: 900px) {
  /* 1. Global Spacing & Typography */
  section {
    padding: 3rem 1.5rem;
  }

  .content-layer h2,
  section h2,
  #research-overview > h2,
  #news > h1,
  #collaborators > h2 {
    font-size: 2rem;
  }

  .team-subtitle {
    font-size: 1.8rem;
    margin-top: 3rem !important;
  }

  /* 2. Navigation Menu Polish */
  nav ul {
    width: 85%;
    padding-top: 6rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
  }

  nav > ul > li > a {
    font-size: 1.1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: block;
    width: 100%;
    color: var(--text-dark) !important;
  }

  /* Hamburger Toggle Visibility */
  .mobile-menu-toggle {
    z-index: 1005;
    font-size: 1.8rem;
    color: var(--midnight-blue);
  }

  nav .nav-logo {
    filter: none;
  }

  /* 3. Hero Adjustments */
  .page-header {
    padding: 0 1.5rem;
    min-height: 50vh;
    justify-content: center;
  }

  .page-header h1 {
    font-size: 2.2rem !important;
    word-wrap: break-word;
    line-height: 1.2;
  }

  .page-header p {
    font-size: 1rem !important;
  }

  .modal-content {
    width: 92%;
    max-height: 85vh;
    border-radius: 16px;
    flex-direction: column;
  }

  .modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 80vh;
  }

  .modal-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .close-modal,
  .close-collage,
  .lightbox-close {
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    z-index: 1001;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: absolute;
  }

  .modal-info {
    padding: 1.5rem;
    overflow-y: visible;
  }

  .modal-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* 5. About Page Specifics */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .profile-img {
    max-width: 100%;
    margin: 0 auto;
  }

  .about-grid > div {
    width: 100%;
  }

  /* 6. Gallery Grid Mobile */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .collage-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
    columns: auto !important; /* Reset columns for mobile */
  }

  /* 7. Footer Stacking */
  .footer-content {
    flex-direction: column;
  }
}

/* 8. Text Readability & Contrast (Mobile Only + Centering) */
@media (max-width: 900px) {
  .page-header::before {
    background: rgba(0, 0, 0, 0.4) !important;
  }

  .page-header h1,
  .page-header p {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
  }

  /* 9. Center Hero Text */
  .page-header {
    text-align: center !important;
    align-items: center !important;
  }

  .page-header p {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* 10. About Page - Horizontal Overflow Fix */
  #about-page {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  #about-page .fixed-background,
  #about-page .page-header {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  #about-page .about-grid {
    width: 100% !important;
    padding: 0 1rem !important;
  }

  #about-page section {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  /* 11. Modal Content Stacking Fix */
  .modal-body.no-image {
    display: flex !important;
    flex-direction: column !important;
  }

  #about-page .modal-body {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: 100% !important;
    overflow-y: auto !important;
  }

  #about-page .modal-left-pane {
    width: 100% !important;
    min-height: 250px !important;
    max-height: 400px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: block !important; /* Ensure it is visible if it has content */
  }

  #about-page .modal-body.no-image .modal-left-pane {
    display: none !important;
  }

  /* 12. Publications Page - Initial Load Stability */
  #publications-page {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .publication-list,
  .year-group,
  .pub-year-list {
    width: 100%;
    max-width: 100%;
  }

  .publication-item {
    width: 100% !important;
    padding: 1rem !important;
  }

  /* Publications - mobile fixes: reduce hero height and prevent fixed-bg gaps */
  @media (max-width: 900px) {
    #publications-page .page-header {
      min-height: 36vh !important;
      padding: 1.2rem 5% !important;
      align-items: center !important;
      text-align: center !important;
    }

    #publications-page .page-header h1 {
      font-size: 1.8rem !important;
      line-height: 1.2 !important;
      margin-bottom: 0.4rem !important;
    }

    #publications-page .page-header p {
      font-size: 0.95rem !important;
      margin: 0 auto 0.6rem !important;
      max-width: 100% !important;
    }

    /* On mobile, switch to scroll attachment to prevent gaps; keep position fixed for proper layering */
    .fixed-background {
      background-attachment: scroll !important;
      position: fixed !important;
      height: 100vh !important;
    }

    /* Force publication list to be normal block flow (UL contains DIVs in markup)
       and tighten spacing to avoid large empty areas */
    #publications-page .publication-list,
    #publications-page .year-group,
    #publications-page .pub-year-list {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      padding: 0 0.5rem !important;
    }

    #publications-page .publication-item {
      padding: 0.9rem 1rem !important;
      margin-bottom: 1rem !important;
      border-radius: 8px !important;
    }

    /* Publications page - adjust fixed background for mobile without obstruction */
    #publications-page .fixed-background {
      pointer-events: none !important;
      opacity: 0.3;
    }
  }

  /* 13. Books Page - Gallery Scroller Improvement */
  .carousel-container {
    padding: 0 1rem !important;
  }

  .carousel-item {
    min-width: 200px !important;
    max-width: 200px !important;
  }

  .carousel-item img {
    object-fit: contain !important;
    height: 280px !important;
  }

  /* Books carousel: make touch-friendly and provide snap/zoom visuals */
  .books-gallery-section .books-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .books-gallery-section .books-carousel-track-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
  }

  .books-gallery-section .books-carousel-track {
    display: flex;
    gap: 1rem;
    transition: transform 300ms ease;
    will-change: transform;
  }

  .books-gallery-section .carousel-item {
    min-width: 260px;
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    scroll-snap-align: center;
  }

  .books-gallery-section .books-carousel-track-container {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .books-gallery-section .carousel-item img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 220ms ease;
  }

  .books-gallery-section .carousel-item:active img,
  .books-gallery-section .carousel-item:focus img {
    transform: scale(0.995);
  }

  @media (max-width: 900px) {
    .books-gallery-section .carousel-item img {
      height: 240px;
    }
    .books-gallery-section .carousel-item {
      min-width: 70%;
    }
    .books-gallery-section .books-carousel-wrapper .carousel-nav {
      display: none; /* rely on touch scroll on mobile */
    }
  }

  /* 14. Gallery Page - Full Width Sections */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
  }

  .gallery-category-card {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  /* 15. Gallery Image Loading Optimization */
  .collage-grid img,
  .gallery-category-card img {
    max-width: 100%;
    height: auto;
  }

  /* 16. Global Overflow Prevention */
  body,
  html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  /* Scope responsive constraints to media/content elements only to avoid breaking
     fixed-width UI (buttons, inputs, icons, positioned elements). */

  img,
  video,
  iframe,
  svg,
  canvas,
  embed,
  object,
  .responsive-media {
    max-width: 100%;
    height: auto;
  }

  /* 17. Team Page Modal Background Fix */
  .team-group .modal-body {
    background: var(--white) !important;
  }

  .team-group .modal-image {
    background: #f4f4f4 !important;
  }
}

@media (max-width: 900px) {
  /* Additional About Page Fixes */
  .about-grid > div {
    width: 100%;
    max-width: 100%;
  }

  .profile-img {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto 2rem auto;
  }

  /* Fix background image overflow on About page */
  .fixed-background {
    left: 0;
    right: 0;
    width: 100vw;
    margin: 0;
  }

  /* Team modal specific fixes */
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }

  .modal-info h3 {
    font-size: 1.8rem !important;
    word-wrap: break-word !important;
  }

  /* Publications filter buttons */
  .year-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Gallery collage modal */
  .collage-modal {
    padding: 0 !important;
  }

  .collage-grid {
    padding: 1rem;
    gap: 0.5rem;
  }

  .collage-grid > div {
    margin-bottom: 0 !important;
  }

  /* Prevent media/content elements from causing horizontal scroll */
  section img,
  section video,
  section .responsive-media {
    max-width: 100%;
    height: auto;
  }

  .content-layer {
    overflow-x: hidden;
  }

  /* Fix for education/training lists on About page */
  .about-grid ul,
  .about-grid ol,
  .about-grid p {
    width: 100%;
    padding-right: 0;
    margin-right: 0;
  }
}

/* Mobile-only stability & performance refinements
   - Keep all fixes scoped to max-width:900px so desktop is untouched */
@media (max-width: 900px) {
  /* Ensure about page content is centered and contained */
  #about-page {
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Hero adjustments to prevent text spill on small viewports */
  .hero-content {
    max-width: 92vw !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    text-align: center !important;
  }

  .hero-content h1 {
    font-size: 2rem !important;
    line-height: 1.05 !important;
    margin-bottom: 0.6rem !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .hero-content p,
  .hero-content p.hero-quote,
  .hero-lab-name,
  .hero-content p:not(.hero-quote):not(.hero-lab-name) {
    max-width: 92vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
  }

  .page-header,
  .page-header * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-header {
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .about-grid {
    display: block;
  }

  .about-grid > div {
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Research vision and signature spacing adjustments */
  .research-vision-text,
  .signature-quote-block p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
    text-align: left !important;
    hyphens: auto !important;
    overflow-wrap: break-word !important;
  }

  /* Modal stacking: force vertical stacking and readable content */
  .modal-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 80vh !important;
  }

  .modal-body img,
  .modal-left-pane,
  .modal-right-pane,
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Publications: stabilise first paint and avoid layout flash */
  #publications-page,
  #publications-page .publication-list {
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
    min-height: 200px;
  }

  /* Books carousel: clearer covers and less cropping on mobile */
  .carousel-item {
    min-width: 160px !important;
    max-width: 160px !important;
  }

  .carousel-item img {
    width: 100% !important;
    height: auto !important;
    max-height: 260px !important;
    object-fit: contain !important;
    image-rendering: auto;
  }

  /* Gallery: mobile-only layout override to full-width vertical blocks */
  .gallery-grid {
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 1.5rem !important;
    align-items: start !important;
  }

  .gallery-item,
  .gallery-category-card {
    width: 100% !important;
    margin: 0 auto !important;
  }

  /* Reserve space to avoid layout shifts and improve perceived loading */
  .gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }

  .gallery-item img,
  .collage-grid img,
  .gallery-category-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  /* Hide gallery on mobile to preserve modal-only interaction for policy/talk images */
  .about-extra-section .hidden-gallery {
    display: none !important;
  }

  /* What We Do spacing adjustments */
  .about-extra-section > div p {
    line-height: 1.75 !important;
    margin-bottom: 1.25rem !important;
    font-size: 1rem !important;
  }

  /* Prioritise smoother scrolling on mobile */
  section,
  .content-layer,
  .modal-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Avoid accidental horizontal scroll from wide elements */
  html,
  body {
    overflow-x: hidden !important;
  }

  /* Team & Project pages: center entries vertically for mobile only */
  /* Preserve existing desktop alternating layouts by scoping to mobile */
  .team-card,
  .project-card,
  .project-item,
  .team-list,
  .project-list,
  .circle-item,
  .circle-item.right,
  .circle-item.project-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 1rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Override alternating reverse flow on mobile so entries stack consistently */
  .alternating-layout .circle-item:nth-child(even) {
    flex-direction: column !important;
    text-align: center !important;
  }

  .circle-img-container {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 160px !important;
    height: 160px !important;
  }

  .circle-text {
    width: 100% !important;
  }
}

/* =========================================
   CMS LAYOUT FIXES - Ensure consistent fixed width
   ========================================= */

/* Global CMS container constraints */
.cms-merged-content,
[id$="-container"] {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Fix sections with inline styles that contain CMS containers */
section[style*="padding"]:has([id$="-container"]) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: var(--section-padding-v) var(--section-padding-h) !important;
}

/* Specifically target the research updates section */
section:has(#research-updates-container) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: var(--section-padding-v) var(--section-padding-h) !important;
}

/* Ensure all CMS content respects fixed width layout */
.cms-merged-content *,
[id$="-container"] * {
  box-sizing: border-box !important;
}

/* Specific fixes for alternating layouts in CMS containers */
.cms-merged-content .alternating-layout,
[id$="-container"] .alternating-layout {
  max-width: 100% !important;
  margin: 0 !important;
  width: 100% !important;
}

.cms-merged-content .circle-item,
[id$="-container"] .circle-item {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.cms-merged-content .circle-img-container,
[id$="-container"] .circle-img-container {
  flex-shrink: 0 !important;
  width: 220px !important;
  height: 220px !important;
}

.cms-merged-content .circle-text,
[id$="-container"] .circle-text {
  flex: 1 !important;
  min-width: 0 !important;
}

/* Mobile responsive fixes for CMS containers */
@media (max-width: 768px) {
  .cms-merged-content .circle-img-container,
  [id$="-container"] .circle-img-container {
    width: 180px !important;
    height: 180px !important;
  }

  /* Teaching page mobile fixes */
  #teaching-page .cms-merged-content.video-grid,
  #teaching-page #teaching-container.video-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    max-width: 100% !important;
    padding: 0 1rem !important;
  }

  #teaching-page .video-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Override any conflicting styles for CMS grids */
.cms-merged-content.book-grid,
.cms-merged-content.video-grid,
#book-grid-container,
#teaching-container {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Aggressive fix for any parent elements of CMS containers */
[id$="-container"] {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Force all sections containing CMS containers to respect layout */
section:has([id$="-container"]),
section:has(.cms-merged-content) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Override inline styles on sections with CMS content */
section[style]:has([id$="-container"]) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Ultimate fix for research-updates and similar containers */
#research-updates-container,
.alternating-layout[id$="-container"] {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: 0 !important;
}

/* Force proper layout for all circle items in any container */
.alternating-layout .circle-item {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure parent sections of alternating layouts respect constraints */
section:has(.alternating-layout) {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* Teaching page section fix */
#teaching-page section {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding: var(--section-padding-v) var(--section-padding-h) !important;
}

/* Teaching page content layer fix */
#teaching-page .content-layer {
  max-width: 1240px !important;
  margin: 0 auto !important;
  width: 100% !important;
}
