/* --------------------------------------------------- */
/* --- Global Styles & Variables --- */
/* --------------------------------------------------- */

:root {
    --primary-blue: #003366;
    --light-gray: #f4f4f4;
    --medium-gray: #e0e0e0;
    --dark-gray: #333333;
    --text-color: #212529;
    --link-hover-color: #0056b3;
    --font-family: 'Helvetica Neue', Arial, sans-serif;
    --header-height: 80px;
    --sidebar-width: 280px;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

/* --------------------------------------------------- */
/* --- Header & Top Navigation --- */
/* --------------------------------------------------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--medium-gray);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
}

.site-header .logo {
    position: absolute;
    left: 2rem;
}

.site-header .main-navigation {
    text-align: center;
}

.site-header .main-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    height: var(--header-height);
}

.site-header .main-navigation li {
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
}

.site-header .main-navigation a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0 15px;
    line-height: var(--header-height);
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-bottom-color 0.3s;
    display: flex;
    align-items: center;
}

.site-header .main-navigation a:hover,
.site-header .main-navigation a.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.site-header .header-actions {
    position: absolute;
    right: 2rem;
    text-align: right;
}

.header-actions .main-title {
    font-size: 1rem;
    font-weight: bold;
    display: block;
    line-height: 1.2;
}

.header-actions .sub-title {
    font-size: 0.6rem;
    display: block;
    line-height: 1.2;
}


/* --------------------------------------------------- */
/* --- Dropdown Navigation --- */
/* --------------------------------------------------- */

.main-navigation li.dropdown ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 180px;
    height: auto;
    background-color: #fff;
    border: 1px solid var(--medium-gray);
    border-top: none;
    border-radius: 0 0 8px 8px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


.main-navigation li.dropdown:hover > ul {
    display: block;
}

.main-navigation .dropdown ul li {
    margin: 0;
}

.main-navigation .dropdown ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--dark-gray);
    border-bottom: none;
    white-space: nowrap;
    font-size: 0.95rem;
}

.main-navigation .dropdown ul li:hover {
    background-color: var(--light-gray);
}

.main-navigation .dropdown ul li:hover a {
    color: var(--primary-blue);
}


/* --------------------------------------------------- */
/* --- Main Content Layout --- */
/* --------------------------------------------------- */

.site-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    padding-top: var(--header-height);
}

/* --------------------------------------------------- */
/* --- Left Sidebar Navigation (with Smooth Indicator) --- */
/* --------------------------------------------------- */

.sidebar {
    background-color: var(--light-gray);
    padding: 2rem;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    border-right: 1px solid var(--medium-gray);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--dark-gray);
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
    position: relative; /* Needed for the indicator */
    transition: background-color 0.3s, color 0.3s;
}

.sidebar-nav a:hover {
    background-color: var(--medium-gray);
}

/* Style for the active link text */
.sidebar-nav a.active {
    font-weight: bold;
    color: var(--primary-blue);
    background-color: transparent; /* No background color change */
}

/* The animated indicator bar */
.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: -2rem; /* Start outside the main padding */
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-blue);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0); /* Hidden by default */
    transition: transform 0.4s ease;
}

/* When a link is active, scale the indicator into view */
.sidebar-nav a.active::before {
    transform: scaleY(1);
}

/* --------------------------------------------------- */
/* --- Main Content Area --- */
/* --------------------------------------------------- */

.main-content {
    padding: 2rem 3rem;
    background-color: #fff;
}

.main-content h1, .main-content h2, .main-content h3 {
    color: var(--primary-blue);
    margin-top: 0;
}

/* --------------------------------------------------- */
/* --- Footer --- */
/* --------------------------------------------------- */

.site-footer {
    grid-column: 1 / -1;
    background-color: var(--dark-gray);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

/* --------------------------------------------------- */
/* --- Image Slider --- */
/* --------------------------------------------------- */

.slider-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 2rem auto;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.slider-wrapper {
    display: flex;
    transition: transform 0.6s ease-in-out;
}

.slide {
    min-width: 100%;
}

.slide img {
    width: 100%;
    display: block;
    object-fit: cover;
    height: 350px;
}

#focal-point-image {
    object-position: center 65%; /* Moves the focal point down */
}


.slider-container input {
    display: none;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.slider-nav label {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    margin: 0 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: 1px solid rgba(0,0,0,0.2);
}

#slide1:checked ~ .slider-wrapper { transform: translateX(0%); }
#slide2:checked ~ .slider-wrapper { transform: translateX(-100%); }
#slide3:checked ~ .slider-wrapper { transform: translateX(-200%); }
#slide4:checked ~ .slider-wrapper { transform: translateX(-300%); }
#slide5:checked ~ .slider-wrapper { transform: translateX(-400%); }
#slide6:checked ~ .slider-wrapper { transform: translateX(-500%); }
#slide7:checked ~ .slider-wrapper { transform: translateX(-600%); }
#slide8:checked ~ .slider-wrapper { transform: translateX(-700%); }


#slide1:checked ~ .slider-nav label[for="slide1"],
#slide2:checked ~ .slider-nav label[for="slide2"],
#slide3:checked ~ .slider-nav label[for="slide3"],
#slide4:checked ~ .slider-nav label[for="slide4"],
#slide5:checked ~ .slider-nav label[for="slide5"],
#slide6:checked ~ .slider-nav label[for="slide6"],
#slide7:checked ~ .slider-nav label[for="slide7"],
#slide8:checked ~ .slider-nav label[for="slide8"], {
    background-color: var(--primary-blue);
    border-color: #fff;
}

/* --------------------------------------------------- */
/* --- Members Page Styles --- */
/* --------------------------------------------------- */

.members-section-title {
    font-size: 1.8rem;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 5px;
    margin-top: 4.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}


.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.member-card {
    background-color: #fff;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.07);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    padding: 1.5rem;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.member-card img {
    width: calc(100% + 3rem);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    height: 300px;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.member-card-content {
    text-align: left;
}

.member-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.member-card-info {
    font-size: 0.95rem;
    color: #333;
}

.member-card-info div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 0.6em;
    margin-bottom: 0.5rem;
}

.member-card-info dt {
    font-weight: bold;
    color: #111;
}

.member-card-info dd {
    margin: 0;
}

/* --------------------------------------------------- */
/* --- Profile Page Styles --- */
/* --------------------------------------------------- */

.profile-card {
    text-align: center;
    padding: 1rem;
}

.profile-card img {
    max-width: 180px;
    width: 100%;
    margin-bottom: 1rem;
}
.profile-card h3 {
    margin: 0.5rem 0;
    color: var(--primary-blue);
}

.profile-card .profile-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.address-block {
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.7;
}

.address-block p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.address-block i.fa {
    margin-right: 10px;
    margin-top: 4px;
    color: var(--primary-blue);
    width: 15px;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.profile-list {
    list-style: none; /* Keep default bullets hidden */
    padding-left: 0;
    margin-bottom: 2.5rem;
}

.profile-list li {
    padding: 1rem 0 1rem 1.5rem; /* Add left padding for the new marker */
    border-bottom: 1px solid var(--medium-gray);
    position: relative; /* Needed for the custom marker */
}

.profile-list li::before {
    content: '»'; /* You can change this to another character like '■' */
    position: absolute;
    left: 0;
    top: 1rem;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.6;
}

.profile-list li:last-child {
    border-bottom: none;
}

.profile-list p {
    margin: 0;
}

/* --------------------------------------------------- */
/* --- Publications Page Styles (UPDATED) --- */
/* --------------------------------------------------- */

/* --------------------------------------------------- */
/* --- Publications Page Styles (Corrected) --- */
/* --------------------------------------------------- */

/* --------------------------------------------------- */
/* --- Publications Page Styles (Corrected) --- */
/* --------------------------------------------------- */

.publication-list {
    list-style-type: none; 
    counter-reset: publication-counter 51; 
    padding-left: 0;
}

.graphical-abstract {
    display: block;
    max-width: 450px;
    width: 100%;
    height: auto;
    margin: 1rem auto 0 auto; /* Centers the image horizontally */
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
}

.publication-list li {
    position: relative;
    padding: 0.75rem 0 0.75rem 3rem; 
    line-height: 1.7;
    border-bottom: 1px solid var(--medium-gray);
    counter-increment: publication-counter -1;
}

.publication-list li::before {
    content: counter(publication-counter) ".";
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 2.5rem;
    text-align: right;
    font-weight: bold;
    color: var(--primary-blue);
}

.publication-list li:last-child {
    border-bottom: none;
}

.publication-list li.year-heading {
    padding: 0;
    margin: 0;
    border-bottom: none;
    counter-increment: none;
}

.publication-list li.year-heading::before {
    content: "";
}

.year-heading .section-title {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 1.8rem;
    /* ADD THIS LINE to fix the scroll position */
    scroll-margin-top: calc(var(--header-height) + 1rem); 
}

.publication-list li::marker {
    font-weight: bold;
    color: var(--primary-blue);
}

.publication-link-inline {
    margin-left: 8px;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-blue);
}

.publication-link-inline:hover {
    text-decoration: underline;
}


/* --------------------------------------------------- */
/* --- Research Page Styles --- */
/* --------------------------------------------------- */

/* --------------------------------------------------- */
/* --- Research Page Styles (Corrected) --- */
/* --------------------------------------------------- */

.research-section {
    margin-bottom: 2.5rem;
}

.research-section .section-title {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.research-section h4 {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.research-section p {
    text-align: justify;
    margin-bottom: 1rem;
}

.research-image {
    display: block;
    width: 100%; /* Force the image to take up the full width of its container */
    max-width: 600px; /* But don't allow it to become larger than 600px */
    height: auto; /* Let the height scale proportionally */
    object-fit: contain;
    margin: 1.5rem auto; /* Center the image horizontally */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--medium-gray);
}

/* Specific width for the Lewis Acid image */
#la-mg-image {
    object-fit: cover;
  
}

/* Specific width for the Base Metal image */
#bm-image {
    width: 100%;
    max-width: 600px;
}

#nb-image {
    max-width: 600px;
    width: 85%;
}

#bb-image {
    object-fit: cover;
    max-width: 450px;
    width: 50%;
}
/* Keep other images constrained to a smaller max-width */
#mg-image,
#pc-image {
    max-width: 450px;
    width: 30%;
}

.circular-image {
 border-radius: 50%; /* Makes the image circular */
 object-fit: cover; /* Ensures the image fills the circle without distortion */
 border: 1px solid var(--medium-gray); /* Optional: Adds a border */
}


/* --------------------------------------------------- */
/* --- Group News Page Styles --- */
/* --------------------------------------------------- */

.news-year-section .section-title {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.news-timeline {
    position: relative;
    padding: 1rem 0;
}

.news-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--medium-gray);
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    background-color: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--light-gray);
    z-index: 1;
}

.timeline-icon .fa {
    font-size: 1.2rem;
}

.news-card {
    background-color: #fff;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-left: 50px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.news-date {
    font-size: 1rem;
    font-weight: bold;
    color: #777;
    margin: 0 0 0.5rem 0;
}

.news-content {
    margin: 0;
    line-height: 1.7;
}

.news-image {
    object-fit: cover;
    display: block;
    max-width: 450px;
    width: 30%;
    height: contain;
    margin: 1rem auto 0 auto; /* Centers the image horizontally */
    border-radius: 4px;
}

/* --------------------------------------------------- */
/* --- Lab Facilities Page Styles --- */
/* --------------------------------------------------- */

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

.facility-card {
    background-color: #fff;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.facility-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.facility-card h3 {
    font-size: 1.1rem;
    color: var(--dark-gray);
    margin: 0;
}

/* --------------------------------------------------- */
/* --- Publications Section Styles (row-aligned) --- */
/* --------------------------------------------------- */

/* Flexbox guarantees equal height per row */
.publications-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
  align-items: stretch;          /* make items in a row equal height */
}

/* 3–4 cards per row depending on width; wraps cleanly */
.publication-card {
  flex: 1 1 320px;               /* base width ~320px, allowed to grow/shrink */
  max-width: 480px;              /* optional: prevents huge stretching on ultrawide */
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
  min-width: 0;                  /* important for flex overflow in Safari/Firefox */
}

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

/* Uniform image area across all cards */
.publication-image {
  width: 100%;
  aspect-ratio: 16 / 9;   /* keeps uniform block size */
  object-fit: contain;    /* show the whole image, no cropping */
  background: #fff;       /* ensures gaps look clean */
  display: block;
}

/* Text area fills remaining height and keeps source stuck to bottom */
.publication-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
}

/* Tidy title (2 lines max to keep rows neat) */
.publication-content h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--dark-gray);

  display: -webkit-box;
  -webkit-line-clamp: 2;         /* clamp title height */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.publication-authors {
  margin: 0;
  color: #555;
  font-size: 0.95rem;

  display: -webkit-box;
  -webkit-line-clamp: 2;         /* optional: keep authors line height consistent */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.publication-source {
  margin-top: auto;              /* pushes to the bottom of the card */
  padding-top: 1rem;
  border-top: 1px solid var(--light-gray);
  color: #666;
  font-size: 0.85rem;
}

/* Responsive breakpoints (optional) */
@media (max-width: 1024px) {
  .publication-card { max-width: none; } /* let them wrap naturally */
}
@media (max-width: 640px) {
  .publications-grid { gap: 1.25rem; }
}

/* --------------------------------------------------- */
/* --- Publication Card Links --- */
/* --------------------------------------------------- */

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;     /* prevent default blue/underline */
  height: 100%;       /* ensure link fills the card */
}

.card-link:hover .publication-card {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* --------------------------------------------------- */
/* --- Floating Page Navigation (NEW) --- */
/* --------------------------------------------------- */

/* --------------------------------------------------- */
/* --- Floating Page Navigation (Collapsible) --- */
/* --------------------------------------------------- */

/* --------------------------------------------------- */
/* --- Floating Page Navigation (Collapsible Tab) --- */
/* --------------------------------------------------- */

.page-nav {
    position: fixed;
    top: calc(var(--header-height) + 2rem);
    right: 3rem;
    width: 145px; /* Width of the collapsed tab */
    height: 40px;
    background-color: rgba(244, 244, 244, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--medium-gray);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    overflow: hidden;
    transition: width 0.4s ease, height 0.4s ease, background-color 0.4s ease;
}

/* Expanded state on hover */
.page-nav:hover {
    width: 220px;
    height: auto;
}

.page-nav h4 {
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: normal;
    cursor: pointer;
}

.page-nav ul {
    list-style: none;
    padding: 0 1rem 0.75rem 1rem;
    margin: 0;
    border-top: 1px solid var(--medium-gray);
    max-height: 0; /* Content is hidden by default */
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
}

/* Expanded list on hover */
.page-nav:hover ul {
    max-height: 500px; /* A large value to allow content to expand */
    opacity: 1;
    padding: 0.75rem 1rem;
}

.page-nav li a {
    text-decoration: none;
    color: var(--primary-blue);
    font-size: 0.95rem;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.page-nav li a:hover {
    color: var(--link-hover-color);
}

/* Hide the floating nav on smaller screens */
@media (max-width: 1200px) {
    .page-nav {
        display: none;
    }
}

/* --------------------------------------------------- */
/* --- Related Publication Link (NEW) --- */
/* --------------------------------------------------- */

.related-publication {
    font-size: 0.95rem;
    color: #333;
}

.related-publication strong {
    color: var(--primary-blue);
}

.related-publication a {
    text-decoration: underline;
    color: #333;
}

.related-publication a:hover {
    color: var(--link-hover-color);
}
