/* Publications and Patents Section Styles */

#publications {
    padding: 3rem 0;
}

/* Subsection titles - centered */
#publications h4 {
    color: var(--primary-color) !important;
    font-weight: 600;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: block;
    text-align: center;
    width: 100%;
}

/* Card container - responsive grid layout */
#publications .row {
    margin-left: 0;
    margin-right: 0;
}

#publications .col-card {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Cards - equal heights with flexbox */
#publications .card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background-color: var(--secondary-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

#publications .card:hover {
    transform: translateY(-3px);
    box-shadow: 0px 8px 25px rgba(15, 80, 100, 0.15);
    border-color: var(--primary-color);
}

#publications .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Card title */
#publications .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color) !important;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#publications .card-title a.external-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

#publications .card-title a.external-link:hover {
    opacity: 0.7;
}

/* Card text/content */
#publications .card-text {
    color: var(--text-secondary-color) !important;
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#publications .card-text p {
    margin-bottom: 0.4rem;
}

#publications .card-text p:last-child {
    margin-bottom: 0;
}

/* Featured badge */
#publications .badge {
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Desktop and Tablet: 3 cards per row (lg breakpoint = 992px) */
@media (min-width: 992px) {
    #publications .col-card {
        flex: 0 0 auto;
        width: 33.3333%;
    }
}

/* Tablet small / Large phones: 2 cards per row (md breakpoint = 768px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    #publications .col-card {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Mobile: 1 card per row (below 768px) */
@media (max-width: 767.98px) {
    #publications {
        padding: 2rem 0;
    }

    #publications h4 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    #publications .col-card {
        flex: 0 0 auto;
        width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #publications .card-title {
        font-size: 1rem;
    }

    #publications .card-text {
        font-size: 0.9rem;
    }

    #publications .card-body {
        padding: 1.25rem;
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] #publications .card {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] #publications .card:hover {
    border-color: var(--primary-color);
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.3);
}
