/* Modern Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a202c;
    background-color: #f7fafc;
    line-height: 1.5;
    font-size: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: #2d3748;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Modern Color Variables */
:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --secondary-green: #059669;
    --accent-orange: #ea580c;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 2px 0;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.top-bar .twitter-link {
    color: #000000; /* Original X (Twitter) black color for maximum visibility */
    font-size: 1.1em;
    margin-right: 24px;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* Alternative X logo styling in case Font Awesome doesn't load */
.top-bar .twitter-link .fa-x-twitter {
    font-weight: 900;
    font-size: 1.2em;
}

/* Fallback for X if icon doesn't work */
.top-bar .twitter-link::after {
    content: ' 𝕏';
    font-weight: 900;
    font-size: 1.1em;
}

.top-bar .twitter-link:hover {
    color: var(--primary-blue);
    background-color: var(--bg-accent);
    transform: translateY(-1px);
}

/* Modern Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo img {
    height: 65px;
    transition: all 0.3s ease;
}

.site-header .logo img:hover {
    transform: scale(1.05);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 8px;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    position: relative;
}

.main-nav a:hover {
    color: var(--primary-blue);
    background-color: var(--bg-accent);
    transform: translateY(-1px);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav a:hover::after {
    width: 70%;
}

/* Search Toggle Button */
.search-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.search-toggle:hover {
    color: var(--primary-blue);
    background-color: var(--bg-accent);
    transform: translateY(-1px);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-overlay.active {
    display: flex;
    opacity: 1;
}

.search-overlay-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.search-overlay.active .search-overlay-content {
    transform: translateY(0);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.search-header h2 {
    color: var(--primary-blue);
    margin: 0;
    font-size: 1.5rem;
}

.search-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.search-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-accent);
}

.search-form {
    position: relative;
    margin-bottom: 30px;
}

.search-form input {
    width: 100%;
    padding: 15px 20px;
    padding-right: 50px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: var(--primary-blue-dark);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-help {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin: 40px 0;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-accent);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-result-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Modern Hero Section */
.hero {
    color: white;
    height: 40vh;
    min-height: 350px;
    background-image: url('images/pic01.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg, 
        rgba(37, 99, 235, 0.9) 0%, 
        rgba(59, 130, 246, 0.75) 50%, 
        rgba(29, 78, 216, 0.85) 100%
    );
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 40px;
    margin: 0 auto;
    transform: translateY(30px);
    opacity: 0;
    animation: heroFadeInUp 1.2s forwards ease-out 0.3s;
}

.hero-wave-symbol {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 1px 2px rgba(0,0,0,0.9);
    animation: pulse 2s infinite;
    display: block;
}

.hero-wave-symbol .small-dot {
    font-size: 0.7em;
}

.hero-wave-symbol .wave-small {
    font-size: 0.8em;
}

.hero-wave-symbol .wave-medium {
    font-size: 1em;
}

.hero-wave-symbol .wave-large {
    font-size: 1.2em;
}

/* Simple CO₂ Sources and Sinks Animation - Runs once on page load */
.co2-sources-sinks {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.co2-bubble {
    position: absolute;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Source bubbles (CO₂ going out) - reddish color */
.co2-bubble.source {
    color: rgba(255, 107, 107, 0.9);
    animation: sourceFloat 2s ease-in-out;
    animation-fill-mode: forwards;
}

/* Sink bubbles (CO₂ coming in) - greenish color */
.co2-bubble.sink {
    color: rgba(134, 239, 172, 0.9);
    animation: sinkFloat 2s ease-in-out;
    animation-fill-mode: forwards;
}

/* Individual bubble positioning and delays */
.co2-1 {
    top: 20%;
    left: 80%;
    animation-delay: 0s;
}

.co2-2 {
    top: 70%;
    left: 15%;
    animation-delay: 0.5s;
}

.co2-3 {
    top: 30%;
    left: 10%;
    animation-delay: 1s;
}

/* Simple source animation (bubbles moving outward) */
@keyframes sourceFloat {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateX(-10px) translateY(-10px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-30px) translateY(-30px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateX(-45px) translateY(-45px) scale(0.6);
    }
}

/* Simple sink animation (bubbles moving inward) */
@keyframes sinkFloat {
    0% {
        opacity: 0;
        transform: translateX(-45px) translateY(-45px) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translateX(-30px) translateY(-30px) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateX(-10px) translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(0.8);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.hero h1 {
    font-size: clamp(1.56rem, 3.125vw, 2.19rem);
    font-weight: 700;
    margin-bottom: 0.94rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 1px 2px rgba(0,0,0,0.9),
        0 0 1px rgba(0,0,0,1);
    color: #ffffff;
}

.hero p {
    font-size: clamp(0.69rem, 1.56vw, 0.875rem);
    font-weight: 500;
    line-height: 1.6;
    max-width: 375px;
    margin: 0 auto;
    text-shadow: 
        0 1px 2px rgba(0,0,0,0.8),
        0 0 1px rgba(0,0,0,1);
    color: rgba(255, 255, 255, 0.95);
}

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

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modern Main Content */
main.container {
    padding-top: 24px;
    padding-bottom: 24px;
}

.page-section {
    background: var(--bg-primary);
    padding: 28px;
    margin-bottom: 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.page-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-title {
    color: var(--primary-blue);
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 20px;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 2px;
}

.section-title-small {
    color: var(--primary-blue);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.section-title-small::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-blue-light);
    border-radius: 1px;
}

.section-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.section-content p {
    margin-bottom: 1rem;
}

.section-content a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.section-content a:hover {
    border-bottom-color: var(--primary-blue);
    color: var(--primary-blue-dark);
}

/* Intro Section (Two Columns) */
#intro.page-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Main content takes 2/3, sidebar 1/3 */
    gap: 40px; /* Space between columns */
    align-items: start; /* Align items to the top */
}

.intro-main-content {
    /* flex: 2; No longer needed with grid */
}

.intro-sidebar {
    /* flex: 1; No longer needed with grid */
    display: flex;
    flex-direction: column;
    gap: 30px; /* Space between news and twitter feed */
}

.intro-news-preview {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

.news-list-preview {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-list-preview li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start; /* Align items to the top */
    flex-wrap: wrap; /* Allow items to wrap */
}

.news-preview-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.news-item-content {
    flex-grow: 1; /* Allow content to take available space */
    display: flex;
    flex-direction: column;
}

.news-list-preview a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    line-height: 1.2; /* Adjust line height for better spacing */
}

.news-list-preview a:hover {
    color: #0056b3;
}

.news-date-preview {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 5px; /* Space below title */
    display: block; /* Make it a block element to go below title */
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

.twitter-feed-placeholder {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
    text-align: center;
}

/* Work Section */
.work-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.work-text {
    flex: 1;
}

.work-image {
    flex: 1;
}

.work-image img {
    width: 100%;
    border-radius: 8px;
}

/* Team Section */
.team-intro {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    text-align: center;
}

.team-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 0;
    max-width: 900px;
    margin: 0 auto;
}

.team-members-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.team-member {
    text-align: center;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.team-member-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%; /* Circular images */
    margin-bottom: 15px;
    border: 3px solid #0056b3;
}

.team-member h3 {
    color: #0056b3;
    margin-bottom: 5px;
}

.team-member p {
    font-size: 0.9em;
    color: #555;
}

/* Modern News Section */
.news-item {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 32px;
    transition: all 0.3s ease;
}

.news-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.news-item-img {
    width: 300px;
    height: 300px;
    object-fit: contain; /* Changed from cover to contain to show full image */
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    background: var(--bg-accent);
    padding: 8px; /* Add padding to give breathing room */
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

.news-item-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.news-item h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

.news-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 16px;
    padding: 4px 12px;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    display: inline-block;
}

.news-item p {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Abstract Link Styling */
.abstract-link {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-blue-light);
}

.abstract-link h4 {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.abstract-link p {
    margin: 0;
    font-size: 1rem;
}

.abstract-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.abstract-link a:hover {
    border-bottom-color: var(--primary-blue);
    color: var(--primary-blue-dark);
}

/* Footer */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0;
    font-size: 0.9em;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    max-width: 75%;
}

.footer-text h4 {
    color: white;
    margin-top: 0;
    margin-bottom: 10px;
}

.footer-logo img {
    height: 100px;
    background-color: white;
    padding: 12px;
    border-radius: 8px;
}

/* Form Styles */
.fields {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.field {
    padding: 10px;
    width: 100%;
}

.field.half {
    width: 50%;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important */
}

.actions {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.actions li {
    display: inline-block;
    margin-right: 10px;
}

input[type="submit"], input[type="reset"] {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

input[type="submit"].primary {
    background-color: #0056b3;
}

input[type="reset"] {
    background-color: #6c757d;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #ccc;
}

/* Make news images clickable */
.news-image-link {
    cursor: pointer;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.news-image-link:hover {
    opacity: 0.9;
}

.news-image-link:hover .news-item-img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* News Carousel */
.news-carousel-container {
    position: relative;
    margin-bottom: 40px;
}

.news-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

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

.news-slide {
    min-width: 100%;
    flex: 0 0 100%;
    padding: 0;
}

.news-slide .news-card {
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    min-height: 300px;
    padding: 30px;
}

.news-slide .news-card.text-only {
    grid-template-columns: 1fr;
    text-align: center;
    justify-content: center;
}

/* Carousel-specific image styles to prevent cropping */
.news-slide .news-card-image {
    height: auto;
    min-height: 250px;
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.news-slide .news-card-image img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    object-position: center;
    border-radius: var(--radius-md);
}

.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.carousel-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.carousel-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.carousel-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.carousel-indicators {
    display: flex;
    gap: 8px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.indicator.active {
    background: var(--primary-blue);
    transform: scale(1.2);
}

.indicator:hover {
    background: var(--primary-blue-light);
}

.news-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.news-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

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

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

.news-card-content {
    padding: 25px;
}

.news-card-header {
    margin-bottom: 15px;
}

.news-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    line-height: 1.3;
}

.news-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card h3 a:hover {
    color: #0056b3;
}

.news-card-date {
    color: #6c757d;
    font-size: 0.85em;
    font-weight: 500;
    display: block;
    margin-bottom: 15px;
}

.news-card-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.news-card-link {
    display: inline-block;
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    padding: 8px 16px;
    border: 1px solid #0056b3;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.news-card-link:hover {
    background-color: #0056b3;
    color: white;
    transform: translateX(2px);
}

.news-section-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.view-all-news {
    display: inline-block;
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-size: 1em;
}

.view-all-news:hover {
    background-color: #003d82;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

/* Partners Section */
#partners {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.partners-content {
    text-align: center;
}

.partners-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: center;
    justify-items: center;
    margin-top: 40px;
}

.partner-logo {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    width: 100%;
    max-width: 220px;
    border: 1px solid var(--border-light);
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue-light);
}

.partner-logo img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(0.2);
    transition: filter 0.3s ease;
}

.partner-logo:hover img {
    filter: grayscale(0);
}

/* Specific adjustments for different logo dimensions */
.partner-logo img[src*="trinity"] {
    max-height: 60px;
}

.partner-logo img[src*="teagasc"] {
    max-height: 50px;
}

.partner-logo img[src*="earthy-matters"] {
    max-height: 70px;
}

.partner-logo img[src*="bord-na-mona"] {
    max-height: 50px;
}

.partner-logo img[src*="npws"] {
    max-height: 70px;
}

/* Social Media Section */
#social-media {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.social-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.social-title {
    color: #0056b3;
    font-size: 1.4em;
    margin-bottom: 20px;
    font-weight: 600;
}

.social-links-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.social-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.social-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.social-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue-light);
    background: white;
}

.social-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    filter: grayscale(0.3);
    transition: filter 0.3s ease;
}

.social-card:hover .social-icon {
    filter: grayscale(0);
}

.social-card h4 {
    color: var(--primary-blue);
    font-size: 1.3em;
    margin-bottom: 12px;
    font-weight: 600;
}

.social-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.social-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.social-btn:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.follow-message {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-blue);
    text-align: center;
}

.follow-message p {
    margin: 0;
    color: #333;
    font-size: 1em;
    line-height: 1.6;
}

.follow-message a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.follow-message a:hover {
    border-bottom-color: var(--primary-blue);
    color: var(--primary-blue-dark);
}

/* Remove old intro-grid styles and update */
#intro.page-section {
    display: block; /* Override grid */
}

.intro-main-content,
.intro-sidebar,
.intro-news-preview,
.news-list-preview,
.twitter-feed-placeholder {
    /* Remove old styles by commenting out or setting to initial */
}

/* Comprehensive Mobile Responsive Design */

/* Mobile Navigation - Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 10001;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu-toggle:hover {
    background-color: var(--bg-accent);
}

.mobile-menu-toggle:active {
    background-color: var(--border-light);
    transform: scale(0.95);
}

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .news-slide .news-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 25px;
        text-align: center;
    }
    
    .news-slide .news-card-image {
        max-height: 250px;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .hero {
        height: 35vh;
        min-height: 300px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        z-index: 9999;
        transition: right 0.3s ease;
        padding-top: 80px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 20px;
    }
    
    .main-nav a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    /* Mobile Header */
    .site-header .container {
        position: relative;
    }
    
    .site-header .logo img {
        height: 50px;
    }
    
    /* Mobile Hero */
    .hero {
        height: 30vh;
        min-height: 250px;
        background-attachment: scroll; /* Better performance on mobile */
        text-align: center;
        justify-content: center;
    }
    
    .hero-content {
        padding: 0 20px;
        max-width: 100%;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 15px;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    /* Mobile Container */
    .container {
        padding: 0 16px;
    }
    
    /* Mobile Section Spacing */
    .page-section {
        padding: 40px 0;
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 2rem;
        text-align: center;
        margin-bottom: 30px;
    }
    
    /* Mobile News Carousel */
    .news-slide .news-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 25px 20px;
        text-align: center;
        min-height: auto;
    }
    
    .news-slide .news-card-image {
        order: -1;
        max-height: 200px;
        min-height: 180px;
    }
    
    .news-card-content {
        padding: 15px 0;
    }
    
    .news-card h3 {
        font-size: 1.1rem;
    }
    
    .news-card-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Mobile Carousel Navigation */
    .carousel-nav {
        margin-top: 20px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .carousel-indicators {
        gap: 8px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    /* Mobile News Grid */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-item {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .news-item-img {
        width: 100%;
        max-width: 250px;
        height: 200px;
        margin: 0 auto;
    }
    
    /* Mobile Team Grid */
    .team-members-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: none;
    }
    
    .team-member {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Mobile Footer */
    .footer-content {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .footer-text {
        max-width: 100%;
        order: 2;
    }
    
    .footer-logo {
        order: 1;
    }
    
    .footer-logo img {
        height: 80px;
    }
    
    .partner-logos {
        justify-content: center;
        gap: 15px;
    }
    
    .partner-logos img {
        height: 40px;
    }
    
    .partner-placeholder {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    /* Mobile Forms */
    .field.half {
        width: 100%;
    }
    
    .fields {
        margin: -5px;
    }
    
    .field {
        padding: 5px;
    }
    
    /* Mobile Social Cards */
    .social-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .social-card {
        padding: 20px;
    }
    
    /* Mobile Partners Section */
    .partners-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .partner-logo {
        height: 100px;
        padding: 15px;
    }
    
    .partner-logo img {
        max-height: 60px;
    }
    
    /* Mobile Typography */
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* Mobile Top Bar */
    .top-bar .twitter-link {
        margin-right: 16px;
        padding: 6px 10px;
        font-size: 1rem;
    }
}

/* Small Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-content h1 {
        font-size: 1.7rem;
        line-height: 1.1;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .news-slide .news-card {
        padding: 20px 15px;
    }
    
    .news-card h3 {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .site-header .logo img {
        height: 45px;
    }
    
    .main-nav {
        width: 100vw;
        right: -100vw;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .close-button {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

/* Mobile-first improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .news-card:hover,
    .team-member:hover,
    .social-card:hover {
        transform: none;
    }
    
    /* Make tap targets larger on touch devices */
    .carousel-btn,
    .indicator,
    .news-card-link,
    .social-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 70vh;
        min-height: 350px;
    }
    
    .main-nav {
        width: 320px;
    }
}

/* Research Outputs Styles */
.section-intro {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.output-category {
    margin-bottom: 3rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.category-title i {
    font-size: 1.25rem;
}

/* Conference Presentations */
.presentations-list,
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.presentation-item,
.publication-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.presentation-item:hover,
.publication-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue-light);
    transform: translateY(-2px);
}

.presentation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.presentation-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.presentation-type {
    background: var(--bg-primary);
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--primary-blue-light);
}

.presenter {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

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

.conference {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.25rem 0;
}

.date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.description {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.75rem 0 0 0;
}

.publication-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.doi-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.doi-link:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

/* Journal Publications - No content state */
.no-publications {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-light);
}

.no-publications p {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.coming-soon {
    color: var(--primary-blue) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
}

/* Outputs Footer */
.outputs-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-light);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.outputs-footer p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.outputs-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.outputs-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design for Outputs */
@media (max-width: 768px) {
    .presentation-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .presentation-type {
        align-self: flex-start;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
    
    .presentation-header h5 {
        font-size: 1rem;
    }
    
    .presentation-item,
    .publication-item {
        padding: 1.25rem;
    }
    
    .no-publications {
        padding: 2rem 1rem;
    }
}
