/* =========================================
   1. GLOBAL RESETS & VARIABLES
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    /* Hard stop on horizontal scrolling */
}

:root {
    --primary: #004704;
    /* Dark Green */
    --secondary: #009d61;
    /* Medium Green */
    --accent: #37d476;
    /* Bright Green */
    --light: #f9f9f9;
    --text: #333;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    scroll-behavior: smooth;
}

section {
    padding: 60px 10%;
}

.bg-light {
    background: var(--light);
}

h2 {
    font-size: 2rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

/* =========================================
   2. NAVIGATION
   ========================================= */
nav {
    background: #fff;
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: 0.3s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* =========================================
   3. HERO BANNER & STATS
   ========================================= */
.hero-banner {
    position: relative;
    height: 70vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
}

.image-panel {
    flex: 1;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(60%);
}

.panel-2 {
    filter: brightness(50%);
}

.content-overlay {
    position: relative;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 60px;
    border-radius: 10px;
    text-align: center;
    color: #ffffff;
    max-width: 800px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-overlay h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.content-overlay .badge {
    background-color: #005c23;
    color: white;
    padding: 3px 10px;
    border-radius: 5px;
    margin-right: 5px;
}

.legacy {
    font-style: italic;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin: 15px 0 30px;
}

.stats-bar {
    background: var(--secondary);
    color: white;
    display: flex;
    justify-content: space-around;
    padding: 20px 10%;
    text-align: center;
}

.stat-item h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--accent);
}

/* =========================================
   4. PI & RESEARCH GROUPS
   ========================================= */
.leader-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.leader-img {
    width: 280px;
    height: auto;
    background: #ddd;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 12px 12px 0 var(--accent);
}

.edu-list {
    list-style: none;
    padding: 0;
}

.edu-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.edu-list li::before {
    content: '🎓';
    position: absolute;
    left: 0;
}

.recognition-shelf {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.badge {
    text-align: center;
    padding: 20px;
    border: 1px dashed var(--accent);
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

/* =========================================
   5. RESEARCH TOPICS & FOCUS
   ========================================= */
.focus-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.focus-image-wrapper {
    flex: 1 1 400px;
}

.big-picture-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.big-picture-img:hover {
    transform: scale(1.02);
}

.focus-text {
    flex: 1 1 400px;
}

.focus-text h3 {
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.focus-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.focus-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
}

.focus-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.2;
}

/* --- Strictly 2-Column Grid Layout --- */
.two-col-grid {
    display: grid;
    /* This forces EXACTLY 2 equal columns, no matter how wide the screen is */
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 20px;
    max-width: 1200px;
    /* Optional: Keeps the whole section from getting too massive */
    margin-left: auto;
    margin-right: auto;
}

/* --- Mobile Responsiveness --- */
/* When the screen gets smaller than 850px (tablets/phones), stack them! */
@media (max-width: 850px) {
    .two-col-grid {
        grid-template-columns: 1fr;
    }
}


.topic-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.topic-img-wrapper {
    width: 100%;
    overflow: hidden;
}

.topic-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.topic-card:hover .topic-img {
    transform: scale(1.05);
}

.topic-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.topic-content h3 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    display: inline-block;
}

.topic-content p {
    color: var(--text);
    margin-bottom: 20px;
}

.topic-list {
    list-style: none;
    padding: 0;
    margin: auto 0 0 0;
}

.topic-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #475569;
}

.topic-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* =========================================
   6. LAB NEWS & SOCIAL MEDIA
   ========================================= */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Forced 3 columns */
    gap: 30px;
    margin-top: 20px;
}

.media-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.media-snapshot {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 3px solid var(--secondary);
}

.media-snapshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.media-card:hover .media-snapshot img {
    transform: scale(1.05);
}

.media-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.media-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.media-info h3 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.25rem;
    line-height: 1.4;
}

.media-info p {
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary);
}

/* Social Grid */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

.social-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.social-card:hover {
    transform: translateY(-5px);
}

.social-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.platform-icon {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    margin-right: 15px;
}

.linkedin-color {
    background-color: #0a66c2;
}

.x-color {
    background-color: #000000;
}

.social-header strong {
    display: block;
    color: var(--text);
    font-size: 0.95rem;
}

.social-date {
    font-size: 0.8rem;
    color: #777;
}

.social-image-wrapper {
    width: 100%;
    height: 250px;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.social-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.social-body {
    padding: 20px;
    flex-grow: 1;
}

.social-body p {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
}

.social-footer {
    display: block;
    text-align: center;
    padding: 15px;
    background: #fdfdfd;
    border-top: 1px solid #f0f0f0;
    color: var(--secondary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.social-footer:hover {
    background: var(--secondary);
    color: white;
}

/* =========================================
   7. PUBLICATIONS
   ========================================= */
.pub-scroll-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px 30px;
    background: #ffffff;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
    margin-top: 15px;
}

.pub-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.pub-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.pub-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 8px;
}

.pub-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.pub-list {
    margin: 0;
    padding-left: 20px;
}

.pub-list li {
    margin-bottom: 20px;
    line-height: 1.6;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #444;
}

.pub-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.pub-list strong {
    color: #222;
    display: block;
    margin-bottom: 4px;
}

/* =========================================
   8. CONFERENCE TALKS
   ========================================= */
.talk-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.talk-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    border-left: 5px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.talk-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.talk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.talk-date {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
}

.talk-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-invited {
    background-color: rgba(0, 157, 97, 0.1);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.badge-oral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.talk-item:has(.badge-invited) {
    border-left-color: var(--secondary);
}

.talk-item:has(.badge-oral) {
    border-left-color: #94a3b8;
}

.talk-title {
    color: var(--primary);
    font-size: 1.25rem;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.talk-authors {
    color: #555;
    font-size: 0.95rem;
    margin: 0 0 8px 0;
}

.talk-venue {
    color: var(--text);
    font-style: italic;
    margin: 0;
    font-size: 0.95rem;
}

/* =========================================
   9. PEOPLE & AFFILIATIONS
   ========================================= */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.member-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out;
}

.member-card:hover {
    transform: translateY(-5px);
    border-bottom: 3px solid var(--accent);
}

.member-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f0f0f0;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.member-info h4 {
    margin: 0 0 5px 0;
    color: var(--primary);
}

.member-info p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* CoE Slideshow Card */
.coe-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.coe-card {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 1000px;
    width: 100%;
    border-right: 6px solid var(--accent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.coe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.coe-logo-area.slideshow-container {
    background: var(--primary);
    display: block;
    padding: 0;
    position: relative;
    min-width: 300px;
    height: auto;
    overflow: hidden;
}

.coe-logo-area .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    animation: coe-crossfade 10s infinite;
    z-index: 2;
}

.coe-logo-area .slide:nth-of-type(2) {
    animation-delay: 2s;
}

@keyframes coe-crossfade {
    0% {
        opacity: 1;
    }

    45% {
        opacity: 1;
    }

    55% {
        opacity: 0;
    }

    95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.fallback-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    border-radius: 8px;
    opacity: 0.5;
}

.coe-info {
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.coe-info h3 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.6rem;
    line-height: 1.3;
}

.coe-info p {
    color: var(--text);
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* =========================================
   10. GALLERY SLIDESHOW
   ========================================= */
.gallery-slideshow {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    height: 550px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 8px solid #ffffff;
    background: var(--primary);
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    animation: gallery-fade 16s infinite;
}

.gallery-slide:nth-child(1) {
    animation-delay: 0s;
}

.gallery-slide:nth-child(2) {
    animation-delay: 4s;
}

.gallery-slide:nth-child(3) {
    animation-delay: 8s;
}

.gallery-slide:nth-child(4) {
    animation-delay: 12s;
}

@keyframes gallery-fade {
    0% {
        opacity: 1;
    }

    20% {
        opacity: 1;
    }

    25% {
        opacity: 0;
    }

    95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* =========================================
   11. FOOTER
   ========================================= */
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 40px;
    margin-top: 40px;
}

/* =========================================
   RESTORED STANDARD GRIDS & CARDS
   (Fixes Research, Patents, and Collaborators)
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--accent);
}

/* =========================================
   RESTORED "LAB IN ACTION" GALLERY
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-item {
    height: 200px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   12. THE ULTIMATE MOBILE FIX
   ========================================= */
@media (max-width: 850px) {

    /* Navigation adjustments */
    nav {
        flex-direction: column;
        padding: 1rem;
    }

    nav ul {
        justify-content: center;
        margin-top: 10px;
    }

    /* Reduce spacing */
    section {
        padding: 40px 5%;
    }

    /* Force grids into single column */
    .grid,
    .two-col-grid,
    .social-grid,
    .media-grid,
    .people-grid,
    .gallery-grid,
    .patent-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Stack flex elements */
    .leader-container,
    .focus-content,
    .recognition-shelf,
    .coe-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Image containment */
    .leader-img,
    .big-picture-img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto 20px auto;
        flex: none;
    }

    /* Hero Banner Mobile */
    .content-overlay {
        padding: 30px 20px;
        width: 95%;
    }

    .content-overlay h1 {
        font-size: 2.2rem;
    }

    /* CoE Slideshow Mobile Fix */
    .coe-card {
        border-right: none;
        border-bottom: 6px solid var(--accent);
    }

    .coe-logo-area.slideshow-container {
        height: 250px;
        width: 100%;
        display: block;
    }

    .coe-info {
        padding: 30px;
    }

    /* Talk List Mobile */
    .talk-item {
        padding: 20px;
    }

    .talk-title {
        font-size: 1.15rem;
    }

    /* Gallery Mobile */
    .gallery-slideshow {
        height: 300px;
        border: 4px solid #ffffff;
    }
}

/* =========================================
   AWARDS, PATENTS, TEACHING & FACILITIES (Restored)
   ========================================= */

/* Facilities & Collaboration Styles */
.fac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.fac-card {
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    text-align: center;
    border-radius: 4px;
}

/* Teaching Table */
.teaching-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
}

.teaching-table th,
.teaching-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.teaching-table th {
    background-color: var(--primary);
    color: white;
}

/* Opportunities Section */
.opp-card {
    /* The linear-gradient creates a dark green tint over the image so text stays readable */
    background:
        url('labpic.jpeg');
    /* Replace with your actual image filename */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: rgb(12, 12, 12);
    padding: 60px 40px;
    /* Slightly increased top/bottom padding to show off the image more */
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.apply-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent);
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    margin-top: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Added a quick hover effect to make the button feel interactive */
.apply-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Patents & Awards Styles */
.award-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.award-icon {
    font-size: 2rem;
    color: var(--accent);
}

.patent-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.patent-card {
    background: var(--primary);
    color: white;
    padding: 25px;
    border-radius: 8px;
    position: relative;
}

.patent-card h4 {
    margin: 0 0 10px 0;
    color: var(--accent);
}

.patent-status {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

/* =========================================
   SLIDESHOW ADD-ON FOR TOPIC CARDS
   ========================================= */

.topic-slideshow {
    position: relative;
    width: 100%;
    /* 1. DELETE the height: 250px; line completely */
    overflow: hidden;
    background-color: #f1f5f9;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.4s ease;
}

/* 2. ADD THIS MAGIC TRICK */
/* It forces the first image to stay in the normal flow and hold the box open */
.slide:first-of-type {
    position: relative;
    height: auto;
}

/* The visible slide */
.slide.active {
    opacity: 1;
    z-index: 1;
}

/* Matches your original hover zoom effect! */
.topic-card:hover .slide.active {
    transform: scale(1.05);
}

/* Navigation Buttons */
.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
    opacity: 0;
    /* Hidden until hover */
    transition: all 0.3s ease;
}

.topic-slideshow:hover .slide-btn {
    opacity: 1;
}

.slide-btn:hover {
    background: var(--accent);
    /* Uses your existing CSS accent color */
}

.slide-btn.prev {
    left: 10px;
}

.slide-btn.next {
    right: 10px;
}