/* ═══════════════════════════════════════════════════════════════════════════
   QUANTOS Research Team - Main Stylesheet
   
   Table of Contents:
   1. Color Scheme & Variables
   2. Reset and Base Styles
   3. Typography
   4. Global Text Justification
   5. Buttons
   6. Header & Navigation
   7. Dark Mode Toggle
   8. Main Content & Layout
   9. Hero Section
   10. Highlights Slider
   11. News Feed & Posts Grid
   12. Post Page Styles
   13. Pagination
   14. Laboratory/Research Pages
   15. Team Section
   16. Publications
   17. About Page
   18. Contact Page
   19. Footer
   20. Dark Mode Styles
   21. Responsive Design
   22. Utility Classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   1. COLOR SCHEME & VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
/* 
   Color Scheme:
   Primary: #0091BE (teal blue)
   Secondary: #64C8EB (light blue)
   Dark: #000000 (black)
   Background: #FFFFFF (white)
   Text: #000000 (black)
   Gray: #f0f0f0 (light gray)
   Medium Gray: #666666
   Border Gray: #e0e0e0
*/

/* ═══════════════════════════════════════════════════════════════════════════
   2. RESET AND BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  line-height: 1.6;
  color: #000000;
  background-color: #FFFFFF;
  text-justify: inter-word;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

img {
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: #0091BE;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #007399;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. GLOBAL TEXT JUSTIFICATION
   ═══════════════════════════════════════════════════════════════════════════ */
html, body, p, li, a, span, blockquote, figcaption, .btn {
  text-align: justify;
}

/* Center-aligned exceptions */
.team-member .member-name,
.team-member .member-role {
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0091BE;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #007399;
  color: white;
}

.btn-secondary {
  background-color: #64C8EB;
}

.btn-secondary:hover {
  background-color: #42B8E5;
}

.filter-btn {
  padding: 8px 16px;
  margin-right: 10px;
  margin-bottom: 10px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover, 
.filter-btn.active {
  background-color: #0091BE;
  color: white;
}

/* Special button sizing for sliders */
.highlight-content .btn,
.minimal-slide-content .btn,
.slide-content .btn {
  display: inline-block;
  width: auto !important;
  padding: 8px 16px;
  font-size: 0.9rem;
  max-width: fit-content;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
header {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo img {
  height: 50px;
  width: auto;
  display: block;
  margin: 0;
}

.logo-home-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

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

nav ul li {
  display: flex;
  align-items: center;
  height: 40px;
  margin-left: 1.5rem;
}

nav ul li a {
  display: flex;
  align-items: center;
  height: 100%;
  color: #000000;
  font-weight: 600;
  padding: 5px 0;
  position: relative;
}

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

nav ul li a:hover:after, 
nav ul li a.active:after {
  width: 100%;
}

nav ul li a.active {
  color: #0091BE;
}

.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. DARK MODE TOGGLE
   ═══════════════════════════════════════════════════════════════════════════ */
.dark-mode-btn {
  background: none;
  border: 2px solid #0091BE;
  color: #0091BE;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  margin: 0;
  vertical-align: middle;
}

.dark-mode-btn:hover {
  background-color: #0091BE;
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. MAIN CONTENT & LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
main {
  margin-top: 80px;
  min-height: calc(100vh - 80px - 100px);
  padding: 2rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.hero {
  background-color: #000000;
  color: white;
  padding: 4rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. HIGHLIGHTS SLIDER
   ═══════════════════════════════════════════════════════════════════════════ */
.minimal-slider {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
}

.minimal-slides-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.minimal-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  background-color: white;
  overflow: hidden;
}

.minimal-slide-content {
  width: 50%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.minimal-slide-image {
  width: 50%;
  overflow: hidden;
  border-radius: 12px;
  justify-content: center;
}

.minimal-slide-image img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.3s ease; 
}

.minimal-slide-image:hover img {
  transform: scale(1.05);
}

.minimal-slide h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.minimal-slide p {
  margin-bottom: 20px;
  line-height: 1.6;
}

.minimal-slider-dots {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.minimal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.5);
  cursor: pointer;
}

.minimal-dot.active {
  background-color: white;
}

.minimal-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.minimal-prev { left: 15px; }
.minimal-next { right: 15px; }

/* ═══════════════════════════════════════════════════════════════════════════
   11. NEWS FEED & POSTS GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.news-feed {
  margin-bottom: 3rem;
}

.news-filter {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

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

.post-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.post-image {
  height: 200px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.05);
}

.post-content {
  padding: 1.2rem;
}

.post-type {
  display: inline-block;
  padding: 3px 8px;
  font-size: 1rem;
  background-color: #64C8EB;
  color: white;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.post-date {
  font-size: 0.9rem;
  color: #64C8EB;
  margin-bottom: 1rem;
}

.post-excerpt {
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. POST PAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.post-header {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.post-header-content {
  background-color: rgba(0, 145, 190, 0.8);
  color: white;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
}

.post-header .post-lab {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-secondary, #ffffff);
  margin-bottom: 0.5rem;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  gap: 1rem;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-author img {
  width: 80px;
  height: 80px;
  border-radius: 80%;
  object-fit: cover;
  margin-right: 1rem;
}

.post-content {
  font-size: 1.125rem;
  max-width: min(90%, 1200px);
  margin: 0 auto;
  line-height: 1.7;
  margin-bottom: 3rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
}

.post-content ul {
  padding-left: 2rem;
  margin: 1rem 0;
}

.post-content ul li {
  position: relative;
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-content ul li .MathJax {
  display: inline;
  vertical-align: middle;
}

.post-tags {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tag {
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.related-posts {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

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

/* Figure grid for post content */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1400px;
}

.figure-grid figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.figure-grid .fig-label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.figure-grid figure img {
  max-width: 100%;
  height: auto;
}

.figure-grid figure figcaption {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.9rem;
  color: #666;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. PAGINATION
   ═══════════════════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  gap: 1rem;
}

.pagination-btn {
  padding: 8px 16px;
  background-color: #0091BE;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #007399;
}

.pagination-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 8px;
}

.page-numbers span, 
.page-numbers a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}

.page-numbers .current-page {
  background-color: #0091BE;
  color: white;
}

.page-numbers a:hover {
  background-color: #e0e0e0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. LABORATORY/RESEARCH PAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.lab-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 1rem;
  background-color: #f0f0f0;
  border-radius: 8px;
}

.lab-header h1 {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #0091BE;
}

.lab-header p {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text, #333333);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.lab-info {
  margin-bottom: 3rem;
}

.lab-overview .lab-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}

.lab-info-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.lab-info-list li {
  margin-bottom: 0.5rem;
}

.research-topics {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.topic-card {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f0f0f0;
}

.topic-content {
  flex: 1;
  min-width: 300px;
  padding-right: 2rem;
}

.topic-image {
  flex: 0 0 400px;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.topic-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.topic-image:hover img {
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. TEAM SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.team-section {
  background-color: #f9f9f9;
  padding: 3rem 0;
  margin: 3rem 0;
  border-radius: 8px;
}

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

.team-member {
  text-align: center;
}

.member-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1rem;
  border: 4px solid #f0f0f0;
}

.member-image img,
.team-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.member-name {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.member-role {
  font-size: 0.9rem;
  color: #64C8EB;
  margin-bottom: 0.5rem;
}

.member-contact {
  font-size: 0.9rem;
}

.member-link {
  color: inherit;
  text-decoration: none;
}

.member-link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. PUBLICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.publications {
  margin-bottom: 3rem;
}

.publication-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.publication-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.publication-authors {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.publication-journal {
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.publication-year {
  font-size: 0.9rem;
  color: #64C8EB;
}

.publication-compact {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.publication-compact h4 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.publication-compact p {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.publications-container h3 {
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0091BE;
  color: #0091BE;
}

.publication-compact h4 a {
  text-decoration: none;
  margin-left: 5px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.publication-compact h4 a:hover {
  transform: scale(1.2);
}

.open-access-link {
  color: #64C8EB;
}

.publication-compact h4 a i {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   17. ABOUT PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.about-section {
  margin-bottom: 3rem;
}

.mission-vision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
  margin-top: 3rem;
}

.mission-box, .vision-box {
  padding: 2rem;
  background-color: #f0f0f0;
  border-radius: 8px;
  height: 100%;
}

.mission-box h3, .vision-box h3 {
  margin-bottom: 1rem;
  color: #0091BE;
}

.about-section img,
section[align-items="center"] img {
  display: block;
  margin: 0 auto;
}

.about-section figure {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  margin-bottom: 1rem;
}

.about-section figure img {
  display: inline-block;
  max-width: 100%;
}

.about-section figcaption {
  margin-bottom: 0.5rem;
  font-size: 240px !important;
  color: #555;
  margin-top: 0.75rem;
  color: #666;
  font-style: italic;
  font-size: 0.95rem;
}

.about-figure {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.about-figure figure {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.about-figure figure img {
  width: 100%;
  border-radius: 8px;
  height: auto;
}


/* ═══════════════════════════════════════════════════════════════════════════
   18. CONTACT PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.contact-info {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.contact-icon {
  margin-right: 1rem;
  color: #DA191F;
  font-size: 1.2rem;
}

.contact-icon .fas {
  color: #64C8EB;
}

.contact-form-container {
  background-color: #f0f0f0;
  padding: 2rem;
  border-radius: 8px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.map-section {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.map-wrapper {
  margin-top: 2rem;
  height: 400px;
  background-color: #f0f0f0;
  border-radius: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.map-iframe {
  width: 100%;
  max-width: 1200px;
  height: 400px;
  border-radius: 8px;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   19. FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
footer {
  background-color: #000000;
  color: white;
  padding: 3rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-logo img {
  height: 40px;
  margin-right: 10px;
}

.footer-social {
  display: flex;
  margin-top: 1rem;
}

.social-icon {
  display: inline-block;
  margin-right: 15px;
  font-size: 1.5rem;
  color: white;
  transition: color 0.3s ease;
}

.social-icon:hover {
  color: #64C8EB;
}

.footer-links h4, .footer-contact h4 {
  margin-bottom: 1.5rem;
  color: #64C8EB;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.5rem;
}

.footer-links ul li a {
  color: white;
}

.footer-links ul li a:hover {
  color: #64C8EB;
}

.footer-contact p {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   20. DARK MODE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Header */
body.dark-mode header {
  background-color: #2a2a2a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body.dark-mode nav ul li a {
  color: #e0e0e0;
}

body.dark-mode nav ul li a.active {
  color: #64C8EB;
}

body.dark-mode nav ul li a:hover {
  color: #64C8EB;
}

body.dark-mode nav {
  background-color: #2a2a2a;
}

/* Hero */
body.dark-mode .hero {
  background-color: #000; /*#0091BE;*/
  color: white;
}

/* Cards and boxes */
body.dark-mode .post-card,
body.dark-mode .mission-box,
body.dark-mode .vision-box,
body.dark-mode .team-section,
body.dark-mode .contact-form-container {
  background-color: #2a2a2a;
  color: #e0e0e0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .post-card:hover {
  box-shadow: 0 5px 15px rgba(100, 200, 235, 0.3);
}

/* Buttons */
body.dark-mode .filter-btn {
  background-color: #3a3a3a;
  color: #e0e0e0;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background-color: #0091BE;
  color: white;
}

body.dark-mode .btn {
  background-color: #00a5d4;
  color: white !important;
}

body.dark-mode .btn:hover {
  background-color: #0091BE;
  color: white !important;
}

/* Links */
body.dark-mode a {
  color: #64C8EB;
}

body.dark-mode a:hover {
  color: #42B8E5;
}

/* Footer */
body.dark-mode footer {
  background-color: #0a0a0a;
  border-top: 1px solid #2a2a2a;
}

/* Slider */
body.dark-mode .minimal-slide {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

body.dark-mode .minimal-slider {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Borders and dividers */
body.dark-mode .publication-compact,
body.dark-mode .topic-card {
  border-bottom-color: #3a3a3a;
}

body.dark-mode .publications-container h3 {
  color: #64C8EB;
  border-bottom-color: #64C8EB;
}

body.dark-mode .post-meta {
  border-bottom-color: #3a3a3a;
}

/* Forms */
body.dark-mode .form-control {
  background-color: #3a3a3a;
  color: #e0e0e0;
  border-color: #4a4a4a;
}

body.dark-mode .form-control:focus {
  border-color: #64C8EB;
  outline: none;
}

/* Post header */
body.dark-mode .post-header-content {
  background-color: rgba(0, 145, 190, 0.9);
}

/* Pagination */
body.dark-mode .pagination-btn:disabled {
  background-color: #3a3a3a;
  color: #666;
}

body.dark-mode .page-numbers a {
  color: #64C8EB;
}

body.dark-mode .page-numbers a:hover {
  background-color: #3a3a3a;
}

/* Misc */
body.dark-mode .topic-image {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .map-wrapper {
  background-color: #2a2a2a;
}

body.dark-mode pre,
body.dark-mode code {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Lab header dark mode styling */
body.dark-mode .lab-header {
  background-color: #2a2a2a;
}

body.dark-mode .lab-header h1 {
  color: #64C8EB; /* Keep the teal color for heading */
}

body.dark-mode .lab-header p {
  color: #e0e0e0; /* Light text for dark background */
}

/* Toggle icon change */
body.dark-mode .dark-mode-btn i::before {
  content: "\f185";
}

/* ═══════════════════════════════════════════════════════════════════════════
   21. RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

/* ========== Tablet (max-width: 992px) ========== */
@media (max-width: 992px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.5rem; }
  
  .hero h1 { font-size: 2.5rem; }
  
  .topic-card {
    flex-direction: column;
  }
  
  .topic-content {
    padding-right: 0;
    margin-bottom: 1.5rem;
  }
  
  .topic-image {
    flex: 1;
    width: 100%;
    max-width: 100%;
  }
  
  .figure-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Mobile (max-width: 768px) ========== */
@media (max-width: 768px) {
  /* Navigation */
  .mobile-menu-toggle {
    display: block;
  }
  
  nav {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: white;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  
  nav.active {
    left: 0;
  }
  
  nav ul {
    flex-direction: column;
    padding: 1rem;
  }
  
  nav ul li {
    margin: 0 0 1rem 0;
  }
  
  nav ul li a {
    display: block;
    padding: 0.5rem 0;
  }
  
  body.dark-mode nav {
    background-color: #2a2a2a;
  }
  
  .dark-mode-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  /* Header text */
  .logo {
    font-size: 1.2rem;
  }
  
  .logo-home-link,
  .logo-home-link span {
    font-size: 1.2rem !important;
  }
  
  /* Hero */
  .hero {
    padding: 3rem 0;
  }
  
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  
  /* Slider */
  .minimal-slider {
    height: auto;
    min-height: 500px;
  }
  
  .minimal-slide {
    flex-direction: column;
  }
  
  .minimal-slide-content,
  .minimal-slide-image {
    width: 100%;
    height: auto;
  }
  
  .minimal-slide-content {
    padding: 20px;
    min-height: 250px;
  }
  
  .minimal-slide-image {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 0 0 8px 8px;
  }
  
  .minimal-slide-image img {
    width: auto;
    max-width: 90%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
  }
  
  .minimal-slider-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .minimal-prev { left: 10px; }
  .minimal-next { right: 10px; }
  
  /* Grids */
  .mission-vision-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
  }
  
  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  /* Post page */
  .post-header-content {
    padding: 1.5rem;
  }
  
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Lab header */
  .lab-header {
    padding: 2rem 1rem;
  }
  
  .lab-header h1 {
    font-size: 2rem;
    word-wrap: break-word;
    hyphens: auto;
  }
  
  .lab-header p {
    font-size: 1rem;
    padding: 0;
  }
  
  /* Publications */
  .publication-compact h4 {
    font-size: 1rem;
    word-wrap: break-word;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-logo {
    justify-content: center;
  }
  
  /* About */
  .about-section figure {
    width: 100%;
    padding: 0 1rem;
  }
  
  .about-section figcaption {
    font-size: 1rem !important;
  }
}

/* ========== Small Mobile (max-width: 576px) ========== */
@media (max-width: 576px) {
  /* Typography */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }
  
  /* Layout */
  .container {
    padding: 0 15px;
  }
  
  main {
    margin-top: 60px;
  }
  
  nav {
    top: 60px;
    height: calc(100vh - 60px);
  }
  
  nav ul li a {
    padding: 0.75rem 0;
    font-size: 1.1rem;
  }
  
  /* Header */
  .header-container {
    padding: 10px 0;
  }
  
  .logo {
    font-size: 1rem;
    gap: 10px;
  }
  
  .logo img {
    height: 40px;
  }
  
  .logo-home-link,
  .logo-home-link span {
    font-size: 1rem !important;
  }
  
  .logo-home-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
  
  /* Hero */
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    word-wrap: break-word;
    padding: 0 1rem;
  }
  
  .hero p {
    font-size: 0.9rem;
    padding: 0 1rem;
  }
  
  /* Lab header */
  .lab-header h1 {
    font-size: 2.25rem;
  }
  
  .lab-header p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* Slider */
  .minimal-slider {
    min-height: 450px;
  }
  
  .minimal-slide h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .minimal-slide p {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  
  .minimal-slide-content {
    padding: 15px;
    min-height: 200px;
  }
  
  .minimal-slide-content .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  /* Posts */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .post-card {
    margin: 0 1rem;
  }
  
  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .pagination-btn {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
  
  .page-numbers {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  /* Team */
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  .member-image {
    width: 120px;
    height: 120px;
  }
  
  /* Research topics */
  .topic-card {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .topic-content {
    min-width: unset;
    padding: 0;
  }
  
  .topic-image {
    height: 200px;
  }
  
  /* Post page */
  .post-header {
    height: 150px;
  }
  
  .post-header-content {
    padding: 1rem;
  }
  
  .post-header-content h1 {
    font-size: 1.5rem;
  }
  
  .post-author img {
    width: 60px;
    height: 60px;
  }
  
  /* Contact */
  .contact-item {
    flex-direction: column;
    text-align: center;
  }
  
  .contact-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  /* Buttons */
  .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  
  /* Mission/Vision */
  .mission-box,
  .vision-box {
    padding: 1.5rem;
  }
  
  /* Publications */
  .publications-container h3 {
    font-size: 1.3rem;
  }
  
  .publication-compact {
    padding: 0 0.5rem;
  }
  
  .publication-compact h4 {
    font-size: 0.95rem;
  }
  
  .publication-compact p {
    font-size: 0.85rem;
  }
  
  /* Ensure no overflow */
  body {
    overflow-x: hidden;
  }
}

/* ========== Extra Small Mobile (max-width: 380px) ========== */
@media (max-width: 380px) {
  /* Typography */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  
  .hero h1 { font-size: 1.3rem; }
  
  /* Header */
  .logo { font-size: 0.9rem; }
  
  .logo-home-link,
  .logo-home-link span {
    font-size: 0.9rem !important;
  }
  
  .logo-home-link span {
    max-width: 150px;
  }
  
  /* Slider */
  .minimal-slider {
    min-height: 400px;
  }
  
  .minimal-slide h3 { font-size: 1.1rem; }
  .minimal-slide p { font-size: 0.85rem; }
  
  .minimal-slide-content {
    min-height: 180px;
  }
  
  .minimal-slide-image {
    height: 200px;
  }
  
  /* Force word wrap */
  * {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   22. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */
.custom-icon-color {
  color: #64C8EB;
}