@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@700&display=swap');

/* Color Palette */
:root {
    --main-bg: #222831; 
    --text-light: #FFFFFF;
    --text-dark: #333;
    --accent-green: #B2D8B4;
    --dark-slate-gray: #2F3B42;
    /* Removed duplicate white variable */
    --off-white: #f8f9fa;
    --medium-gray: #6c757d;
    --light-gray: #ced4da;
    --border-gray: #dee2e6;
}

/* Basic Reset & Body */
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, form, button, input, textarea, div, section, nav, footer, main, img, video {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Optional: Smooth scrolling */
}

body {
    /* No body background image */
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-light); /* Default text color for dark background */
    background-color: var(--main-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Layout --- */
.page-wrapper {
    display: flex;
    flex: 1; /* Make wrapper take remaining height */
    width: 100%;
    min-height: 100vh; /* Ensure middle section can fill viewport */
}

.main-content {
    flex: 1; /* Main content takes most space */
    padding: 40px;
    overflow-y: auto; /* Allow content scrolling if needed */
}

.side-navigation {
    width: 200px; /* Fixed width for side nav */
    background-color: var(--main-bg); /* Solid background */
    padding: 40px 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.side-navigation ul {
    list-style: none;
}

.side-navigation li {
    margin-bottom: 1rem;
}

.side-navigation a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    display: block; /* Make links block level */
}

.side-navigation a:hover,
.side-navigation a.active {
    color: var(--accent-green);
}

/* --- Homepage Specific Styles --- */
.home-section {
    min-height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative; /* For overlay */
    color: var(--text-light);
    width: 100%;
    box-sizing: border-box; /* Include padding/border in height */
}

/* --- Visualizations Page Styles --- */
.page-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header p {
    color: var(--light-gray);
    font-size: 1.1rem;
    margin-top: 10px;
}

.section-title {
    margin: 40px 0 20px;
    color: var(--accent-green);
    font-family: 'Montserrat', sans-serif;
}

/* ─── removed: legacy visualisation grid no longer used ──
.visualization-container { ... }
.visualization-item      { ... }
.visualization-item h3   { ... }
.visualization-item video,
.visualization-item img  { ... }
.visualization-item p    { ... }
────────────────────────────────────────────────────────── */

/* All gallery and image-related styles removed */

/* Gallery hover and caption styles removed */

.home-section#top-image {
    background-image: url('imageandvideo/home_images/image1.jpg'); /* Re-apply background here */
    background-attachment: fixed; /* Make it fixed */
    /* z-index: 0; */ /* Keep default z-index */
    /* Align overlay to bottom-left */
    justify-content: flex-start;
    align-items: flex-end;
    text-align: left;
}

.home-section#bottom-image {
    background-image: url('imageandvideo/home_images/image2.jpg');
    background-attachment: fixed; /* Make bottom image fixed like the top one */
}

.home-overlay-content {
    background-color: rgba(47, 59, 66, 0.85); /* Less transparent */
    padding: 1.5rem 2.5rem; /* Adjust padding */
    border-radius: 8px;
    max-width: 550px; /* Adjust max width */
    margin: 3rem; /* Position away from edge */
}

.home-overlay-content .title {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
    font-size: 3rem;
    font-weight: 700;
}

.home-overlay-content .subtitle {
    color: var(--light-gray);
    font-size: 1.2rem;
    font-weight: normal;
    font-family: 'Lato', sans-serif;
}

.home-middle-content {
    /* This wrapper contains the main content and side nav for the middle section */
    background-color: transparent; /* Make container transparent */
    position: relative; /* Needed for z-index stacking */
    z-index: 2; /* Ensure text content is above fixed background */
}

/* Ensure homepage middle section content has large bottom padding for gap effect */
.home-middle-content .main-content {
     padding-top: 80px; /* Increase top padding */
     padding-bottom: 40px; /* Standard bottom padding */
     background-color: var(--main-bg); /* Give content area solid background */
     max-width: 780px; /* Center the main content block */
     margin-left: auto; /* Center the main content block */
     margin-right: auto; /* Center the main content block */
     /* text-align: center; /* REMOVED - Let text align normally (left) */
}

/* New Gap Structure Styles */
.gap-container {
    /* Container is transparent, holds the colored/white blocks */
    position: relative; /* Needed for z-index */
    z-index: 2; /* Ensure it's above fixed background images */
    overflow: hidden; /* Prevent image from overflowing */
}

.top-color-block {
    height: 75px; /* Adjust height of top colored part */
    background-color: var(--main-bg);
}

.white-block {
    height: 150px; /* Increased height for better visibility of the image */
    background-image: url('imageandvideo/home_images/image1.jpg'); /* Use image1 instead of white background */
    background-attachment: fixed; /* Create parallax effect when scrolling */
    background-position: center; /* Center the image */
    background-size: cover; /* Cover the full width */
    position: relative; /* For potential overlay or effects */
    z-index: 2; /* Ensure proper stacking */
}

.bottom-color-block {
    height: 75px; /* Adjust height of bottom colored part */
    background-color: var(--main-bg);
}

/* --- General Content Styles (Applied inside .main-content) --- */
.main-content h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-light); /* Headings light on dark bg */
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    /* border-bottom: 2px solid var(--accent-green); Removed green border */
    font-size: 1.8rem;
    text-align: center; /* Center Gallery heading */
}

/* Add specific styling for the "Send a Message" heading to create more space */
.main-content h2:nth-of-type(2) {
    margin-top: 5rem; /* Increased space above the "Send a Message" heading */
}

.main-content p {
    margin-bottom: 1rem;
    color: var(--text-light); /* Text light on dark bg */
}

/* --- Contact Form Styles (Now on Homepage) --- */
.contact-form {
    max-width: 700px; /* Limit form width */
    margin-left: auto; /* Center form if container is wider */
    margin-right: auto;
    margin-top: 2rem; /* Add space above form */
}

.contact-form label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem; /* Increased space below label */
    display: block; /* Ensure label is block */
    text-align: left; /* Align labels left */
    font-weight: bold;
    color: var(--light-gray); /* Slightly less bright label */
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--medium-gray); /* Darker border */
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    background-color: var(--main-bg); /* Match main background */
    color: var(--text-light); /* Light text inside inputs */
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    background-color: var(--dark-slate-gray); /* Slightly lighter bg on focus */
    box-shadow: 0 0 0 2px rgba(178, 216, 180, 0.3); /* Subtle focus ring using accent */
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button[type="submit"] {
    background-color: var(--accent-green);
    color: var(--dark-slate-gray); /* Dark text on light green button */
    padding: 0.7rem 1.5rem; /* Slightly adjust padding */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.contact-form button[type="submit"]:hover {
    background-color: #222831; /* Corrected hover color */
    color: var(--accent-green); /* Adjust text color for contrast if needed */
}

/* Style for side-by-side name inputs */
.form-group-name .name-inputs {
    display: flex;
    gap: 1rem; /* Space between first and last name */
}

.form-group-name .name-inputs input {
    flex: 1; /* Make inputs share space equally */
}

/* reCAPTCHA v2 styling */
.g-recaptcha {
    margin: 1rem 0;
    display: flex;
    justify-content: flex-start; /* Left align instead of center */
}

/* Responsive reCAPTCHA for mobile */
@media (max-width: 640px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
    }
}

/* Styling for static contact details below form */
.static-contact-details {
    max-width: 700px; /* Match form width */
    margin-left: auto; /* Center details */
    margin-right: auto;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    color: var(--light-gray);
}

.static-contact-details p {
    margin-bottom: 0.5rem;
    color: var(--light-gray); /* Ensure text is light */
}


/* --- Gallery Page Specific Styles --- */
.filter-buttons {
    margin-bottom: 2rem;
    text-align: center;
}

/* Redesigned Filter Buttons (Simple Links) */
.filter-btn {
    background: none;
    border: none;
    color: var(--light-gray);
    padding: 0.5rem 1rem;
    margin: 0 10px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent; /* For active state */
}

.filter-btn:hover {
    color: var(--text-light);
}

.filter-btn.active {
    color: var(--accent-green);
    border-bottom: 2px solid var(--accent-green);
}

/* Filter Navigation Styles */
/* Visualizations-related styles removed */

/* Gallery container and item styles removed */

/* No-scroll styles removed */

/* --- Lightbox Styles --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling in lightbox */
    background-color: rgba(0,0,0,0.9);
}

/* ─── removed: deprecated lightbox wrappers & button ──
.lightbox-container           { ... }
.image-container              { ... }
.fullscreen-btn               { ... }
.lightbox-description-container{ ... }
@media (max-width:768px){ ...mobile variants of the above... }
──────────────────────────────────────────────────────── */

/* Publication citation styles removed */

/* Close lightbox styles removed */

/* Responsive lightbox styles removed */

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* General Mobile Layout */
@media (max-width: 768px) {
    /* Make page wrapper vertical on mobile */
    .page-wrapper {
        flex-direction: column;
        min-height: auto;
    }
    
    /* Adjust main content padding for mobile */
    .main-content {
        padding: 20px;
        order: 2; /* Put main content after navigation */
    }
    
    /* Homepage specific mobile adjustments */
    .home-middle-content .main-content {
        padding: 30px 20px;
        max-width: none; /* Remove max-width constraint */
        margin: 0; /* Remove auto centering margins */
    }
    
    /* Make side navigation horizontal on mobile */
    .side-navigation {
        width: 100%;
        padding: 20px;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        order: 1; /* Put navigation first */
    }
    
    .side-navigation ul {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    .side-navigation li {
        margin-bottom: 0.5rem;
        margin-right: 1rem;
    }
    
    .side-navigation a {
        font-size: 1rem;
        padding: 0.5rem;
    }
      /* Adjust homepage hero sections for mobile */
    .home-section {
        min-height: 50vh; /* Reduce height on mobile */
    }
    
    /* Make bottom image section taller on mobile to show more of ChemicalSynapse */
    .home-section#bottom-image {
        min-height: 75vh; /* Show more of the bottom image on mobile */
    }
    
    .home-overlay-content {
        margin: 1rem; /* Reduce margin */
        padding: 1rem 1.5rem; /* Reduce padding */
        max-width: 90%; /* Make it more responsive */
    }
    
    .home-overlay-content .title {
        font-size: 2.5rem; /* Smaller title on mobile */
        margin-bottom: 0.3rem;
    }
    
    .home-overlay-content .subtitle {
        font-size: 1rem; /* Smaller subtitle */
    }
    
    /* Adjust text content for mobile */
    .main-content h2 {
        font-size: 1.5rem; /* Smaller headings */
        text-align: left; /* Left align on mobile */
        margin-bottom: 1rem;
    }
    
    .main-content p {
        font-size: 0.95rem; /* Slightly smaller text */
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* Contact form mobile adjustments */
    .contact-form {
        max-width: none; /* Remove width constraint */
        margin: 1.5rem 0; /* Adjust margins */
    }
    
    .contact-form .form-group-name .name-inputs {
        flex-direction: column; /* Stack name inputs vertically */
    }
    
    .contact-form .name-inputs input {
        margin-bottom: 0.5rem;
    }
    
    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .contact-form button[type="submit"] {
        width: 100%; /* Full width button on mobile */
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Static contact details mobile */
    .static-contact-details {
        max-width: none;
        margin: 2rem 0;
        text-align: center; /* Center contact details on mobile */
    }
      /* Adjust gap container for mobile */
    .gap-container {
        margin: 0; /* Remove any margins */
    }
    
    .white-block {
        height: 100px; /* Reduce height on mobile */
        /* Keep parallax effect on mobile */
    }
    
    .top-color-block,
    .bottom-color-block {
        height: 50px; /* Reduce heights */
    }
    
    /* Footer mobile adjustments */
    footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .home-middle-content .main-content {
        padding: 20px 15px;
    }
    
    .home-overlay-content .title {
        font-size: 2rem; /* Even smaller on very small screens */
    }
    
    .home-overlay-content .subtitle {
        font-size: 0.9rem;
    }
    
    .main-content h2 {
        font-size: 1.3rem;
    }
    
    .main-content p {
        font-size: 0.9rem;
    }
    
    .side-navigation {
        padding: 15px;
    }
    
    .side-navigation ul {
        flex-direction: column;
        text-align: center;
    }
      .side-navigation li {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .home-section {
        min-height: 70vh; /* Adjust for landscape */
    }
    
    .home-overlay-content {
        margin: 0.5rem;
    }
}

/* Mobile responsive filter and gallery styles removed */

/* --- Footer Styles --- */
footer {
    background: var(--main-bg); /* Match main background color */
    color: var(--light-gray);
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    width: 100%; /* Ensure footer spans width */
}

/* Publications Grid Styles */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 0 auto;
}

.publication-card {
    background-color: rgba(47, 59, 66, 0.8);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.publication-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background-color: rgba(47, 59, 66, 0.9);
}

.pub-journal {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-title {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
    display: block;
}

.pub-title:hover {
    text-decoration: underline;
    color: var(--accent-green);
}

.pub-year {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 1.1rem;
    text-align: right;
    margin: 0;
}

.pub-year-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.pub-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    min-height: 40px;          /* keep card height even when empty */
}

.thumbnail {
    width: 50px;
    height: 35px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-green);
}

.thumbnail img,
.thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-overlay {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

/* ─── mini publication card shown inside light-box ─── */
.mini-pub{
    /* now fill the 50×35 thumbnail instead of oversizing */
    width:100%;              /* match parent .thumbnail (50 px) */
    height:100%;             /* 35 px */
    background:rgba(47,59,66,.85);
    border:1px solid rgba(255,255,255,.15);
    border-radius:4px;
    box-sizing:border-box;
    padding:3px 4px;
    font-size:6px;           /* was 10 px – shrink text */
    line-height:1.15;
    color:var(--text-light);
    position:relative;
    overflow:hidden;         /* avoid spill-over */
}
.mini-pub .journal{
    color:var(--accent-green);
    font-weight:700;
    text-transform:uppercase;
}
.mini-pub .title{
    display:block;
    margin:1px 0 4px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;  /* avoid wrapping */
}
.mini-pub .year{
    position:absolute;
    bottom:2px;
    right:4px;
    color:var(--accent-green);
    font-weight:700;
}

/* ─── mini publication thumb (journal only) ─── */
.mini-pub{
	width:100%;height:100%;             /* 50 × 35 */
	background:rgba(47,59,66,.85);
	border:1px solid rgba(255,255,255,.15);
	border-radius:4px;
	display:flex;align-items:center;justify-content:center;
	padding:0 2px;box-sizing:border-box;
	overflow:hidden;
}
.mini-pub span{                        /* journal text */
	color:var(--accent-green);
	font-size:6px;                      /* 15 % smaller – no clipping */
	font-weight:700;
	text-align:center;
	text-transform:uppercase;
	white-space:nowrap;
	line-height:1;          /* tighter line spacing for tiny box */
}

/* —— publication highlight flash —— */
@keyframes pubFlash{0%{box-shadow:0 0 0 0 var(--accent-green)}
50%{box-shadow:0 0 12px 6px var(--accent-green)}
100%{box-shadow:0 0 0 0 transparent}}
.pub-highlight{animation:pubFlash 1.6s ease-out 2}

/* —— tiny thumbnail inside lightbox —— */
.pub-thumb-link{
    margin-top:12px;display:flex;align-items:center;gap:6px;
}
.pub-thumb-link .thumbnail{         /* reuse existing .thumbnail look */
    width:50px;height:35px;cursor:pointer;
}

@media (max-width: 768px) {
    .publications-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 500px) {
    .publications-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide reCAPTCHA badge */
.grecaptcha-badge {
    visibility: hidden !important;
}

.lightbox .mini-pub{ pointer-events:none; } /* only inside light-box */
