/**
 * Public Styles
 *
 * @package ZEG_Publications
 */

/* =====================
   Wrap & Filter Bar
   ===================== */

.zeg-publications-wrap {
    width: 100%;
    scroll-margin-top: 100px; /* keeps filter bar clear of the sticky site header when scrolled into view */
}

.zeg-filter-bar {
    margin-bottom: 28px;
}

/* Search Field */
.zeg-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

#zeg-search {
    width: 100%;
    padding: 12px 40px 12px 44px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0,60,50,0.12);
    transition: box-shadow 0.2s;
}

#zeg-search:focus {
    outline: none;
    box-shadow: 0 2px 18px rgba(0,60,50,0.2);
}

.zeg-search-wrap::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23888'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.zeg-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #999;
    padding: 2px 4px;
    line-height: 1;
    display: none;
    border-radius: 50%;
    transition: color 0.15s;
}

.zeg-search-clear:hover {
    color: #333;
}

/* Pill Row — 2 rows: Data Sources on row 1, Topics on row 2 */
.zeg-pill-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.zeg-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.zeg-pill-group:first-child {
    padding-bottom: 8px;
    border-bottom: 1px solid #94b3b5;
    flex-wrap: wrap;
}

.zeg-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    border: none;
    background: rgba(255,255,255,0.75);
    color: #1a4a47;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.zeg-pill:hover:not(.active) {
    background: rgba(255,255,255,0.95);
}

.zeg-pill.active {
    background: #1a6b60;
    color: #fff;
}

/* Results Count */
.zeg-results-count {
    font-size: 12px;
    color: rgba(30,60,55,0.65);
}

/* =====================
   Publication List
   ===================== */

.zeg-publications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Year group header */
.zeg-year-header {
    font-size: 13px;
    font-weight: 700;
    color: #1a6b60;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 24px 4px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zeg-year-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #94b3b5;
}

.zeg-year-header:first-child {
    padding-top: 4px;
}

/* Publication Card */
.zeg-publication-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,50,40,0.07);
    transition: box-shadow 0.2s;
}

.zeg-publication-item:hover {
    box-shadow: 0 4px 14px rgba(0,50,40,0.11);
}

.zeg-publication-body {
    flex: 1;
    min-width: 0;
}

.zeg-publication-title {
    display: block;
    font-size: 0.93em;
    font-weight: 600;
    line-height: 1.5;
    color: #1a2e2b;
    margin-bottom: 4px;
}

.zeg-publication-authors {
    display: block;
    font-size: 0.82em;
    color: #888;
    margin-bottom: 5px;
    line-height: 1.4;
}

body.page-id-2770 .zeg-publication-authors a.zeg-author-link {
    color: #19837c;
}

body.page-id-2770 .zeg-publication-authors a.zeg-author-link:hover {
    color: #136b65;
}

.zeg-publication-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.8em;
    color: #aaa;
    margin-top: 2px;
}

.zeg-pub-dot {
    color: #19837c;
    white-space: nowrap;
}

.zeg-pub-year {
    color: #666;
    white-space: nowrap;
    font-weight: 500;
    margin-left: 3px;
}

.zeg-pub-journal {
    color: #bbb;
    margin-left: 14px;
}

.zeg-pub-doi {
    color: #19837c;
    text-decoration: none;
    white-space: nowrap;
    font-style: normal;
    margin-left: 14px;
}

.zeg-pub-doi:hover {
    text-decoration: underline;
}

.zeg-publication-pdf {
    margin-top: 5px;
    font-size: 0.82em;
}

.zeg-pdf-link {
    color: #19837c;
    text-decoration: underline;
}

.zeg-pdf-link:hover {
    color: #136b65;
}

/* Topic Badge — different colors per topic */
.zeg-publication-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1;
    background: #eef6f5;
    color: #2d8a7e;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    margin-top: 2px;
    letter-spacing: 0.01em;
}

/* Badge colors are set dynamically via inline style in PHP (hash-based, see render_publication_item) */

/* Search highlight */
mark.zeg-highlight {
    background: rgba(255, 200, 0, 0.4);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    font: inherit;
}

/* Empty State */
.zeg-empty-state {
    padding: 48px 0;
    text-align: center;
    color: #aaa;
    font-style: italic;
    background: #fff;
    border-radius: 10px;
}

/* =====================
   Pagination
   ===================== */

#zeg-pagination-container {
    margin-top: 16px;
}

.zeg-pagination {
    margin: 28px 0;
    text-align: center;
}

.zeg-page-link {
    display: inline-block;
    padding: 7px 14px;
    margin: 0 2px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.zeg-page-link:hover {
    background: #f4faf9;
    border-color: #1a6b60;
    color: #1a6b60;
}

.zeg-page-link.current {
    background: #1a6b60;
    color: #fff;
    border-color: #1a6b60;
    cursor: default;
}

.zeg-page-link.dots {
    border: none;
    cursor: default;
    pointer-events: none;
}

.zeg-page-link.dots:hover {
    background: transparent;
    color: #444;
    border-color: transparent;
}

/* =====================
   Author Bio
   ===================== */

.zeg-author-single {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.zeg-author-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.zeg-author-photo { flex-shrink: 0; }

.zeg-author-photo img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 300px;
    height: auto;
}

.zeg-author-info { flex: 1; }

.zeg-author-name {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.zeg-author-position {
    font-size: 1.2em;
    color: #2c5282;
    font-weight: 500;
    margin: 0 0 10px 0;
}

.zeg-author-email a { color: #2c5282; text-decoration: none; }
.zeg-author-email a:hover { text-decoration: underline; }

.zeg-author-short-description {
    margin-top: 15px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
    font-style: italic;
}

.zeg-author-biography { margin-bottom: 50px; }
.zeg-author-biography h2, .zeg-author-publications h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* =====================
   Responsive
   ===================== */

@media (max-width: 768px) {
    .zeg-pill { padding: 5px 11px; font-size: 12px; }


    .zeg-publication-item {
        padding: 14px 16px;
        flex-direction: column;
    }

    .zeg-publication-body {
        inline-size: 100%;
        max-inline-size: 100%;
    }

    .zeg-publication-badge {
        order: -1;
        align-self: flex-start;
    }

    /* Mobile: Journal first (truncated), then Year + DOI below */
    .zeg-pub-journal {
        order: 1;
        flex-basis: 100%;
        margin-left: 0;
        min-inline-size: 0;
        max-inline-size: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .zeg-pub-dot  { order: 2; }
    .zeg-pub-year { order: 3; }

    .zeg-pub-doi {
        order: 4;
        margin-left: 10px;
    }

    .zeg-author-header { flex-direction: column; }
    .zeg-author-photo img { max-width: 200px; }
    .zeg-author-name { font-size: 2em; }
}
