/* ============================================================
   Publications Shortcode Styles
   ============================================================
   Styles for the Hugo publications shortcode.
   Designed to be theme-agnostic and easily customizable.
   ============================================================ */

/* --- Table of Contents --- */
.pub-toc {
    margin-bottom: 2em;
    padding: 1em 1.5em;
    background-color: var(--secondary-bg-color, #f5f5f5);
    border-radius: 6px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.pub-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
}

.pub-toc li {
    font-size: 14px;
}

.pub-toc a {
    color: #2660ab;
    text-decoration: none;
    font-weight: 600;
}

.pub-toc a:hover {
    text-decoration: underline;
}

.pub-toc-count {
    color: var(--body-color, #666);
    font-size: 12px;
    opacity: 0.7;
}

/* --- Section --- */
.pub-section {
    margin-bottom: 2.5em;
}

.pub-section-title {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--heading-color, #5f5f5f);
    border-bottom: 2px solid var(--border-color, rgba(0, 0, 0, 0.15));
    padding-bottom: 0.4em;
    margin-bottom: 1em;
}

/* --- Publication List --- */
.pub-list {
    list-style: none;
    counter-reset: pub-counter;
    padding-left: 0;
    margin: 0;
}

.pub-list > li {
    counter-increment: pub-counter;
}

/* --- Individual Publication Entry --- */
.pub-entry {
    position: relative;
    padding: 0.7em 0 0.7em 2.5em;
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    line-height: 1.55;
    font-size: 13px;
}

.pub-entry:last-child {
    border-bottom: none;
}

/* Numbered counter */
.pub-entry::before {
    content: counter(pub-counter) ".";
    position: absolute;
    left: 0;
    top: 0.7em;
    color: var(--body-color, #888);
    font-size: 12px;
    font-weight: 600;
    width: 2em;
    text-align: right;
    opacity: 0.6;
}

/* --- Title --- */
.pub-title {
    font-weight: 600;
    color: var(--heading-color, #333);
}

.pub-title::before {
    content: open-quote;
}

.pub-title::after {
    content: close-quote;
}

/* --- Authors --- */
.pub-authors {
    color: var(--body-color, #555);
}

.pub-highlight-author {
    font-weight: 700;
    color: var(--heading-color, #333);
}

/* --- Venue --- */
.pub-venue {
    font-style: italic;
    color: var(--body-color, #555);
}

.pub-venue a {
    color: #2660ab;
    text-decoration: none;
}

.pub-venue a:hover {
    text-decoration: underline;
}

/* --- Links --- */
.pub-links {
    display: inline;
    margin-left: 0.1em;
}

.pub-link {
    display: inline-block;
    padding: 1px 7px;
    margin: 2px 1px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 3px;
    transition: all 0.2s ease;
    vertical-align: middle;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.pub-link i {
    margin-right: 2px;
    font-size: 10px;
}

/* PDF link */
.pub-link-pdf {
    color: #c0392b !important;
    background-color: rgba(192, 57, 43, 0.08);
    border: 1px solid rgba(192, 57, 43, 0.25);
}

.pub-link-pdf:hover {
    background-color: rgba(192, 57, 43, 0.18);
    color: #a93226 !important;
}

/* arXiv link */
.pub-link-arxiv {
    color: #b31b1b !important;
    background-color: rgba(179, 27, 27, 0.08);
    border: 1px solid rgba(179, 27, 27, 0.25);
}

.pub-link-arxiv:hover {
    background-color: rgba(179, 27, 27, 0.18);
    color: #8b1515 !important;
}

/* Code link */
.pub-link-code {
    color: #2b3137 !important;
    background-color: rgba(36, 41, 46, 0.07);
    border: 1px solid rgba(36, 41, 46, 0.22);
}

.pub-link-code:hover {
    background-color: rgba(36, 41, 46, 0.16);
    color: #1b1f23 !important;
}

/* Slides link */
.pub-link-slides {
    color: #2874a6 !important;
    background-color: rgba(41, 128, 185, 0.08);
    border: 1px solid rgba(41, 128, 185, 0.25);
}

.pub-link-slides:hover {
    background-color: rgba(41, 128, 185, 0.18);
    color: #1a5276 !important;
}

/* Video link */
.pub-link-video {
    color: #c0392b !important;
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.pub-link-video:hover {
    background-color: rgba(231, 76, 60, 0.18);
    color: #a93226 !important;
}

/* Demo link */
.pub-link-demo {
    color: #7c3aed !important;
    background-color: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.pub-link-demo:hover {
    background-color: rgba(124, 58, 237, 0.18);
    color: #6d28d9 !important;
}

/* BibTeX copy button */
.pub-link-bib {
    color: #1e8449 !important;
    background-color: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.25);
    cursor: pointer;
    font-family: inherit;
}

.pub-link-bib:hover {
    background-color: rgba(39, 174, 96, 0.18);
    color: #196f3d !important;
}

/* BibTeX toast notification */
.bibtex-toast {
    position: fixed;
    bottom: 2em;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Extra/generic links (music, etc.) */
.pub-link-extra {
    color: #0d9488 !important;
    border-color: #0d9488;
    background-color: rgba(13, 148, 136, 0.08);
}

.pub-link-extra:hover {
    background-color: rgba(13, 148, 136, 0.18);
}

/* --- Award Badge --- */
.pub-award {
    display: inline;
}

.pub-award-badge {
    display: inline-block;
    padding: 2px 10px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    line-height: 1.6;
}

/* Dark mode support */
html[data-theme='dark'] .pub-award-badge {
    background-color: #3d3200;
    color: #ffc107;
    border-color: #665200;
}

html[data-theme='dark'] .pub-link-pdf {
    color: #e87468 !important;
    background-color: rgba(232, 116, 104, 0.12);
    border-color: rgba(232, 116, 104, 0.3);
}

html[data-theme='dark'] .pub-link-pdf:hover {
    background-color: rgba(232, 116, 104, 0.22);
}

html[data-theme='dark'] .pub-link-arxiv {
    color: #e87468 !important;
    background-color: rgba(232, 116, 104, 0.12);
    border-color: rgba(232, 116, 104, 0.3);
}

html[data-theme='dark'] .pub-link-arxiv:hover {
    background-color: rgba(232, 116, 104, 0.22);
}

html[data-theme='dark'] .pub-link-code {
    color: #c8cdd3 !important;
    background-color: rgba(200, 205, 211, 0.1);
    border-color: rgba(200, 205, 211, 0.25);
}

html[data-theme='dark'] .pub-link-code:hover {
    background-color: rgba(200, 205, 211, 0.2);
}

html[data-theme='dark'] .pub-link-slides {
    color: #5dade2 !important;
    background-color: rgba(93, 173, 226, 0.12);
    border-color: rgba(93, 173, 226, 0.3);
}

html[data-theme='dark'] .pub-link-slides:hover {
    background-color: rgba(93, 173, 226, 0.22);
}

html[data-theme='dark'] .pub-link-video {
    color: #e87468 !important;
    background-color: rgba(232, 116, 104, 0.12);
    border-color: rgba(232, 116, 104, 0.3);
}

html[data-theme='dark'] .pub-link-video:hover {
    background-color: rgba(232, 116, 104, 0.22);
}

html[data-theme='dark'] .pub-link-demo {
    color: #a78bfa !important;
    background-color: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.3);
}

html[data-theme='dark'] .pub-link-demo:hover {
    background-color: rgba(167, 139, 250, 0.22);
}

html[data-theme='dark'] .pub-link-bib {
    color: #58d68d !important;
    background-color: rgba(88, 214, 141, 0.12);
    border-color: rgba(88, 214, 141, 0.3);
}

html[data-theme='dark'] .pub-link-bib:hover {
    background-color: rgba(88, 214, 141, 0.22);
}

html[data-theme='dark'] .pub-link-extra {
    color: #2dd4bf !important;
    background-color: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.3);
}

html[data-theme='dark'] .pub-link-extra:hover {
    background-color: rgba(45, 212, 191, 0.22);
}

/* --- Error message --- */
.pub-error {
    color: #dc3545;
    font-weight: 600;
    padding: 1em;
    background-color: #fff3f3;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* --- Responsive --- */
@media screen and (max-width: 960px) {
    .pub-toc ul {
        flex-direction: column;
        gap: 0.3em;
    }

    .pub-entry {
        padding-left: 2em;
    }
}
