/* com_publications front-end
   Re-theme by overriding the variables on .pubs-wrapper in your template CSS. */
.pubs-wrapper {
    --pp-accent: #17a2b8;
    --pp-accent-dark: #128a9d;
    --pp-ink: #1f2d3d;
    --pp-muted: #5f6f7f;
    --pp-card: #f4fafc;
    --pp-card-hover: #fff;
    --pp-line: #d9ecf1;
    --pp-author: #1a56db;
    --pp-t-ij: #0e7c8f;  --pp-t-ij-bg: #dff3f7;
    --pp-t-ej: #1d4ed8;  --pp-t-ej-bg: #e3ebfd;
    --pp-t-ic: #a05a00;  --pp-t-ic-bg: #fdefd6;
    --pp-t-ec: #7e3fb5;  --pp-t-ec-bg: #f0e5fa;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    color: var(--pp-ink);
}

/* ---------- Toolbar ---------- */
.pubs-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px;
    background: var(--pp-card);
    border: 1px solid var(--pp-line);
    border-radius: 12px;
}

.pubs-search { display: flex; flex: 1 1 360px; min-width: 240px; gap: 6px; }

.pubs-search-input {
    min-width: 0;
    flex: 1 1 auto;
    height: 42px;
    border: 1px solid var(--pp-line);
    border-radius: 999px;
    padding: 0 18px;
    background: #fff;
}
.pubs-search-input:focus {
    border-color: var(--pp-accent);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, .2);
    outline: 0;
}

.pubs-search-btn,
.pubs-clear-search {
    height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.pubs-search-btn { border: 0; background: var(--pp-accent); color: #fff; }
.pubs-search-btn:hover, .pubs-search-btn:focus { background: var(--pp-accent-dark); box-shadow: 0 4px 12px rgba(23, 162, 184, .35); }

.pubs-filter { display: flex; align-items: center; gap: 8px; }
.pubs-filter-label { margin: 0; font-weight: 700; color: var(--pp-muted); font-size: 14px; }

.pubs-filter-select {
    min-width: 190px;
    height: 42px;
    padding: 6px 34px 6px 14px;
    border: 1px solid var(--pp-line);
    border-radius: 999px;
    font-size: 14px;
    color: #222 !important;
    background-color: #fff !important;
}
.pubs-filter-select:focus { border-color: var(--pp-accent); box-shadow: 0 0 0 3px rgba(23, 162, 184, .2); outline: 0; }
.pubs-filter-select option { color: #222 !important; background: #fff !important; }

.pubs-clear-search { border: 1px solid var(--pp-line); color: var(--pp-muted); background: #fff; }
.pubs-clear-search:hover { color: var(--pp-ink); border-color: var(--pp-accent); }

.pubs-result-info { margin: -6px 0 16px; color: var(--pp-muted); font-size: 14px; }

/* ---------- List & cards ---------- */
.pubs-list { display: flex; flex-direction: column; gap: 14px; }

.pubs-item {
    --pp-c: var(--pp-accent);
    --pp-c-bg: var(--pp-t-ij-bg);
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 18px;
    padding: 16px 18px;
    background: var(--pp-card);
    border: 1px solid var(--pp-line);
    border-right: 4px solid var(--pp-c);
    border-radius: 10px;
    box-sizing: border-box;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.pubs-item:hover, .pubs-item:focus-within {
    background: var(--pp-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 80, 100, .12);
}
.pubs-item-single:hover { transform: none; }

.pubs-item--internal_journal    { --pp-c: var(--pp-t-ij); --pp-c-bg: var(--pp-t-ij-bg); }
.pubs-item--external_journal    { --pp-c: var(--pp-t-ej); --pp-c-bg: var(--pp-t-ej-bg); }
.pubs-item--internal_conference { --pp-c: var(--pp-t-ic); --pp-c-bg: var(--pp-t-ic-bg); }
.pubs-item--external_conference { --pp-c: var(--pp-t-ec); --pp-c-bg: var(--pp-t-ec-bg); }

.pubs-item-body { flex: 1 1 auto; min-width: 0; text-align: right; order: 1; }

.pubs-item-title { font-weight: 700; line-height: 1.85; margin-bottom: 6px; }
.pubs-item-title a { color: var(--pp-ink); text-decoration: none; }
.pubs-item-title a:hover, .pubs-item-title a:focus { color: var(--pp-c); text-decoration: none; }

.pubs-item-authors { color: var(--pp-author); font-weight: 600; line-height: 1.8; margin-bottom: 8px; }
.pubs-item-authors a { color: inherit; text-decoration: none; }
.pubs-item-authors a:hover { text-decoration: underline; }

/* ---------- Meta: type badge, source, date, DOI ---------- */
.pubs-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 13.5px;
    color: var(--pp-muted);
    line-height: 1.7;
}

.pubs-item-type {
    display: inline-block;
    padding: 1px 12px;
    border-radius: 999px;
    background: var(--pp-c-bg);
    color: var(--pp-c);
    font-weight: 700;
    white-space: nowrap;
}

.pubs-item-source { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-muted); }
.pubs-icon { flex: 0 0 auto; color: var(--pp-c); opacity: .85; }
.pubs-item-date { color: var(--pp-muted); }

.pubs-item-doi { flex-basis: 100%; font-size: 13px; color: var(--pp-muted); }
.pubs-item-doi a { color: #0f766e; text-decoration: none; font-weight: 600; }
.pubs-item-doi a:hover { text-decoration: underline; }

/* ---------- Custom fields ---------- */
.pubs-custom-fields {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--pp-line);
    font-size: 13.5px;
    line-height: 1.9;
}
.pubs-custom-field { display: block; }
.pubs-custom-label { font-weight: 700; margin-left: 4px; color: var(--pp-ink); }
.pubs-custom-value { display: inline; }

/* ---------- Buttons ---------- */
.pubs-item-action {
    flex: 0 0 auto;
    order: 2;
    align-self: flex-end;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.pubs-download-link,
.pubs-view-btn,
.pubs-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.pubs-download-link { background: var(--pp-accent); border: 1px solid var(--pp-accent); color: #fff; }
.pubs-download-link:hover, .pubs-download-link:focus {
    background: var(--pp-accent-dark);
    border-color: var(--pp-accent-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(23, 162, 184, .35);
}

.pubs-view-btn { background: #fff; border: 1px solid var(--pp-line); color: var(--pp-c); }
.pubs-view-btn:hover, .pubs-view-btn:focus { background: var(--pp-c-bg); border-color: var(--pp-c); color: var(--pp-c); text-decoration: none; }

.pubs-back { gap: 6px; margin-bottom: 14px; background: #fff; border: 1px solid var(--pp-line); color: var(--pp-muted); }
.pubs-back:hover, .pubs-back:focus { border-color: var(--pp-accent); color: var(--pp-accent-dark); text-decoration: none; }

/* ---------- External (LTR) items ---------- */
.pubs-ltr {
    direction: ltr;
    text-align: left;
    border-right: 1px solid var(--pp-line);
    border-left: 4px solid var(--pp-c);
}
.pubs-ltr .pubs-item-body,
.pubs-ltr .pubs-item-title,
.pubs-ltr .pubs-item-authors,
.pubs-ltr .pubs-item-meta,
.pubs-ltr .pubs-item-source { text-align: left; }

/* ---------- Single article ---------- */
.pubs-item-single { display: block; padding: 22px 24px; }
.pubs-item-single .pubs-item-title { font-size: 1.2rem; line-height: 1.75; margin: 0 0 12px; }
.pubs-item-single .pubs-item-action { margin-top: 18px; }

/* ---------- Empty state & pagination ---------- */
.pubs-empty { padding: 28px; text-align: center; color: var(--pp-muted); border: 1px dashed var(--pp-line); border-radius: 10px; background: var(--pp-card); }

.pubs-pagination { margin-top: 26px; display: flex; justify-content: center; }
.pubs-pagination .pagination { margin: 0; flex-wrap: wrap; gap: 4px; }
.pubs-pagination .page-link { min-width: 38px; text-align: center; border-radius: 8px !important; color: var(--pp-accent-dark); border-color: var(--pp-line); }
.pubs-pagination .page-item.active .page-link { background: var(--pp-accent); border-color: var(--pp-accent); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .pubs-toolbar { display: block; }
    .pubs-search, .pubs-filter { width: 100%; margin-bottom: 10px; }
    .pubs-filter-select { flex: 1 1 auto; min-width: 0; width: 100%; }
    .pubs-item { flex-direction: column; gap: 12px; padding: 14px 16px; }
    .pubs-item-action { order: 2; align-self: stretch; width: 100%; }
    .pubs-item-title { font-size: 1rem; }
    .pubs-item-single { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .pubs-item, .pubs-search-btn, .pubs-download-link, .pubs-view-btn { transition: none; }
    .pubs-item:hover, .pubs-item:focus-within { transform: none; }
}
