@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

/* ── Publication alignment ── */
.text-container p:first-child {
    margin-top: 0;
}

/* ── Author list ── */
.text-container p:nth-child(2) {
    font-size: 1em;
    color: #6b7280;
    font-style: italic;
}

/* ── Publication card hover ── */
.pub-card {
    border-radius: 10px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    margin-bottom: 0;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pub-card:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.pub-card.pub-hidden {
    display: none !important;
}

/* ── Static/list style for publications (no thumbnails, compact rows) ── */
.view-toggle {
    display: inline-flex;
    gap: 4px;
    float: right;
    margin-top: 4px;
}

.view-toggle button {
    font-family: inherit;
    font-size: 0.8em;
    font-weight: 500;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.view-toggle button:hover {
    color: #111827;
}

.view-toggle button.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

#papers-all.list-view {
    border-top: 1px solid #e5e7eb;
}

#papers-all.list-view .pub-card.pub-hidden {
    display: none !important;
}

#papers-all.list-view .pub-card {
    display: grid !important;
    grid-template-columns: 110px 1fr;
    column-gap: 16px;
    align-items: baseline;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 16px 20px !important;
}

#papers-all.list-view .pub-card:hover {
    background: #f9fafb;
    box-shadow: none;
}

#papers-all.list-view .image-container,
#papers-all.list-view .paper-desc,
#papers-all.list-view .text-container p[style*="italic"] {
    display: none !important;
}

#papers-all.list-view .text-container {
    width: 100%;
    flex: 1 1 auto !important;
}

#papers-all.list-view .papertitle {
    font-size: 1em !important;
    margin-bottom: 3px !important;
}

#papers-all.list-view .author-list {
    margin-top: 0 !important;
}

/* ── Serif type for paper titles and authors ── */
.papertitle {
    font-family: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;
    font-weight: 600 !important;
    color: #1f2937;
    letter-spacing: -0.005em;
}

#papers-all.list-view .papertitle {
    font-size: 1.08em !important;
}

.author-list,
.author-list a {
    font-family: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;
    font-size: 14px;
    font-style: italic;
}

.author-list u {
    color: #1f2937;
}

/* ── Venue badge (left column of list view) ── */
.venue-badge {
    display: none;
}

#papers-all.list-view .venue-badge {
    display: block;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.8em;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    align-self: baseline;
}

/* ── Fixed-size media box so every pub-card lines up, regardless of each image/gif's native aspect ratio ── */
.image-container {
    max-width: 460px;
    max-height: 380px;
    border-radius: 8px;
}

.image-container img,
.image-container video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
}

/* ── Social links ── */
.social-links a {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px;
    border: 1px solid #d1d5db;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background-color: #ffffff;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.social-links a:hover {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ── Description box (shown on pub-card hover) ── */
.desc-box {
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: #f8fafc;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
    margin-top: 0;
    margin-bottom: 14px;
    transition: max-height 0.3s ease, opacity 0.25s ease,
                padding 0.25s ease, margin-top 0.2s ease,
                border-color 0.2s ease;
}

.pub-card:hover + .desc-box,
.desc-box:hover {
    max-height: 300px;
    opacity: 1;
    padding: 12px 20px;
    margin-top: 4px;
    border-color: #e5e7eb;
}

/* ── In list view, keep it compact: no abstract popup on hover ── */
#papers-all.list-view .desc-box {
    display: none !important;
}

/* ── Desc box title ── */
.desc-box-title {
    margin: 0 0 6px 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #1f2937;
}

/* ── Desc box label ── */
.desc-box-label {
    margin: 0 0 5px 0;
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* ── Paper description text ── */
.paper-desc {
    margin: 0;
}

/* ── Paper resource links (pill badges) ── */
.paper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.paper-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border: 1px solid #d1d5db;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    color: #374151;
    background-color: #f8fafc;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.paper-links a:hover {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.paper-links a.unavailable {
    color: #9ca3af;
    border-color: #e5e7eb;
    background-color: #f9fafb;
    cursor: default;
    pointer-events: none;
}

/* ── Publication box (soft slate container with footer link) ── */
.pub-box {
    background-color: #f3f6f9;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    margin-bottom: 40px;
}

.pub-box #papers-all.list-view {
    border-top: none;
}

.pub-box #papers-all.list-view .pub-card {
    border-bottom-color: #e2e8f0;
}

.pub-box #papers-all.list-view .pub-card:hover {
    background-color: #eaeff5;
}

.pub-box #papers-all.list-view .venue-badge {
    color: #64748b;
}

.pub-box-footer {
    display: flex;
    justify-content: flex-start;
    padding: 14px 20px 16px;
    background-color: #edf1f5;
}

.all-pubs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Lora', 'Georgia', 'Times New Roman', serif;
    font-size: 15px;
    font-style: italic;
    color: #1e3a8a;
    transition: color 0.15s ease;
}

.all-pubs-btn i {
    font-size: 0.8em;
    transition: transform 0.15s ease;
}

.all-pubs-btn:hover,
.all-pubs-btn:focus {
    color: #2563eb;
}

.all-pubs-btn:hover .fa-arrow-right {
    transform: translateX(3px);
}

.all-pubs-btn:hover .fa-arrow-left {
    transform: translateX(-3px);
}
