/* ==========================================================================
   HP Publications Frontend — Professional Design
   Covers: [publication_list] · [publication_ticker] · [publication_archive]
   ========================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
    --hp-pub-primary: #0d3b6e;
    --hp-pub-primary-dark: #092c52;
    --hp-pub-primary-light: #e8f0fa;
    --hp-pub-accent: #c8973a;
    --hp-pub-accent-light: #fdf3e3;
    --hp-pub-surface: #ffffff;
    --hp-pub-surface-2: #f7f9fc;
    --hp-pub-border: #dde3ec;
    --hp-pub-text: #1a2636;
    --hp-pub-text-muted: #6b7a8d;
    --hp-pub-radius: 10px;
    --hp-pub-shadow: 0 2px 12px rgba(13, 59, 110, .07);
    --hp-pub-shadow-hover: 0 8px 28px rgba(13, 59, 110, .14);
    --hp-pub-transition: all .22s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   PUBLICATION LIST  [publication_list]
   ========================================================================== */

.hp-pub-list-wrap {
    margin-bottom: 28px;
}

.hp-pub-list-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hp-pub-primary);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--hp-pub-accent);
    display: inline-block;
}

.hp-pub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hp-pub-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--hp-pub-surface);
    border: 1px solid var(--hp-pub-border);
    border-left: 4px solid var(--hp-pub-primary);
    border-radius: var(--hp-pub-radius);
    padding: 13px 16px;
    transition: var(--hp-pub-transition);
}

.hp-pub-item:hover {
    box-shadow: var(--hp-pub-shadow-hover);
    border-left-color: var(--hp-pub-accent);
    transform: translateX(3px);
    background: var(--hp-pub-surface-2);
}

.hp-pub-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--hp-pub-accent-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hp-pub-accent);
}

.hp-pub-info {
    flex: 1;
    min-width: 0;
}

.hp-pub-title {
    display: block;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--hp-pub-text);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color .18s;
}

.hp-pub-title:hover {
    color: var(--hp-pub-primary);
    text-decoration: underline;
}

.hp-pub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.hp-pub-cat,
.hp-pub-year {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 20px;
    padding: 2px 9px;
}

.hp-pub-cat {
    background: var(--hp-pub-primary-light);
    color: var(--hp-pub-primary);
}

.hp-pub-year {
    background: var(--hp-pub-accent-light);
    color: #7a5520;
}

.hp-pub-download {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hp-pub-primary);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--hp-pub-transition);
}

.hp-pub-download:hover {
    background: var(--hp-pub-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 151, 58, .35);
    color: #fff;
}

/* ==========================================================================
   PUBLICATION TICKER  [publication_ticker]
   ========================================================================== */

/* Outer card wrapper */
.hp-pub-ticker-card {
    width: 100%;
    background: var(--hp-pub-surface);
    border: 1px solid var(--hp-pub-border);
    border-radius: var(--hp-pub-radius);
    box-shadow: var(--hp-pub-shadow);
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
/*.hp-pub-ticker-heading {*/
/*    font-size: 18px;*/
/*    font-weight: 700;*/
/*    color: var(--hp-pub-primary);*/
/*    margin: 0 0 16px;*/
/*    padding-bottom: 10px;*/
/*    border-bottom: 2px solid var(--hp-pub-border);*/
/*}*/


.hp-pub-ticker-heading {
    background: #192a3d;
    color: #ffffff;
    font-size:18px;
    padding: 12px 16px;
    border-radius: 8px;
    border-bottom: none;
}

/* Scrolling viewport */
.hp-pub-ticker-outer {
    overflow: hidden;
    position: relative;
}

/* Fade top + bottom edges */
.hp-pub-ticker-outer::before,
.hp-pub-ticker-outer::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 2;
    pointer-events: none;
}

.hp-pub-ticker-outer::before {
    top: 0;
    background: linear-gradient(to bottom, var(--hp-pub-surface), transparent);
}

.hp-pub-ticker-outer::after {
    bottom: 0;
    background: linear-gradient(to top, var(--hp-pub-surface), transparent);
}

/* Scrolling track */
.hp-pub-ticker-track {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: hp-pub-ticker-scroll linear infinite;
    will-change: transform;
}

.hp-pub-ticker-track:hover {
    animation-play-state: paused;
}

@keyframes hp-pub-ticker-scroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

/* Each item — matches the sample's left-border card style */
.hp-pub-ticker-item {
    display: block;
    padding-left: 16px;
    border-left: 2px solid var(--hp-pub-border);
    text-decoration: none;
    transition: border-color .2s;
}

.hp-pub-ticker-item:hover {
    border-left-color: var(--hp-pub-primary);
}

/* Title row: text + NEW badge side by side */
.hp-pub-ticker-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-pub-ticker-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-pub-text);
    line-height: 1.4;
}

/* Description line */
.hp-pub-ticker-desc {
    font-size: 12px;
    color: var(--hp-pub-text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* Blinking NEW badge */
.hp-pub-new-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    background: #dc2626;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    animation: hp-pub-blink 1s infinite;
}

@keyframes hp-pub-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

/* ==========================================================================
   PUBLICATION ARCHIVE  [publication_archive]
   ========================================================================== */

.hp-pub-archive-wrap {

    margin: 0 auto;
}

/* ── Filter bar ────────────────────────────────────────────────────── */
.hp-pub-filters {
    background: var(--hp-pub-surface);
    border: 1px solid var(--hp-pub-border);
    border-radius: var(--hp-pub-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--hp-pub-shadow);
}

.hp-pub-filter-row {
    display: flex;
  
    gap: 10px;
    align-items: center;
}

.hp-pub-search-input,
.hp-pub-filter-select {
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--hp-pub-border);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--hp-pub-text);
    background: var(--hp-pub-surface-2);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.hp-pub-search-input {
    min-width: 220px;
}

.hp-pub-filter-select {
    min-width: 160px;
    cursor: pointer;
}

.hp-pub-search-input:focus,
.hp-pub-filter-select:focus {
    border-color: var(--hp-pub-primary);
    box-shadow: 0 0 0 3px rgba(13, 59, 110, .1);
    background: var(--hp-pub-surface);
}

.hp-pub-filter-btn,
.hp-pub-filter-reset {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: var(--hp-pub-transition);
}

.hp-pub-filter-btn {
    background: var(--hp-pub-primary);
    color: #fff;
    border: 1px solid transparent;
}

.hp-pub-filter-btn:hover {
    background: var(--hp-pub-primary-dark);
    box-shadow: 0 4px 12px rgba(13, 59, 110, .25);
    transform: translateY(-1px);
    color: #fff;
}

.hp-pub-filter-reset {
    background: transparent;
    color: var(--hp-pub-text-muted);
    border: 1px solid var(--hp-pub-border);
}

.hp-pub-filter-reset:hover {
    background: var(--hp-pub-surface-2);
    color: var(--hp-pub-text);
    border-color: #aab0bb;
}

/* ── Results count ──────────────────────────────────────────────────── */
.hp-pub-results-count {
    font-size: 13px;
    color: var(--hp-pub-text-muted);
    margin: 0 0 14px;
}

/* ── Archive list ───────────────────────────────────────────────────── */
.hp-pub-archive-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hp-pub-archive-list .hp-pub-item {
    padding: 15px 20px;
}

.hp-pub-desc {
    font-size: 13px;
    color: var(--hp-pub-text-muted);
    margin: 4px 0 0;
    line-height: 1.5;
}

.hp-pub-download-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--hp-pub-primary);
    color: var(--hp-pub-primary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--hp-pub-transition);
    cursor: pointer;
}

.hp-pub-download-btn:hover {
    background: var(--hp-pub-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 59, 110, .2);
    transform: translateY(-1px);
}

/* ── Pagination ─────────────────────────────────────────────────────── */
.hp-pub-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 22px;
}

.hp-pub-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--hp-pub-border);
    color: var(--hp-pub-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hp-pub-transition);
    background: var(--hp-pub-surface);
}

.hp-pub-page-btn:hover {
    border-color: var(--hp-pub-primary);
    color: var(--hp-pub-primary);
    background: var(--hp-pub-primary-light);
}

.hp-pub-page-btn.active {
    background: var(--hp-pub-primary);
    color: #fff;
    border-color: var(--hp-pub-primary);
    box-shadow: 0 3px 10px rgba(13, 59, 110, .28);
}

/* ── Empty state ────────────────────────────────────────────────────── */
.hp-pub-empty {
    text-align: center;
    color: var(--hp-pub-text-muted);
    padding: 48px 20px;
    border: 2px dashed var(--hp-pub-border);
    border-radius: var(--hp-pub-radius);
    font-size: 15px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
/* ── Responsive Improvements ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* General archive fixes */
    .hp-pub-archive-wrap {
        overflow-x: hidden;
    }
    
    /* Publication items - better mobile layout */
    .hp-pub-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }
    
    .hp-pub-icon {
        width: 32px;
        height: 32px;
    }
    
    .hp-pub-info {
        flex: 1 1 100%;
        order: 2;
        margin-left: 0;
    }
    
    .hp-pub-download,
    .hp-pub-download-btn {
        order: 3;
        margin-left: auto;
    }
    
    /* Ticker responsive */
    .hp-pub-ticker-card {
        padding: 12px;
    }
    
    .hp-pub-ticker-heading {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .hp-pub-ticker-text {
        font-size: 13px;
    }
    
    .hp-pub-ticker-desc {
        font-size: 11px;
    }
    
    /* Filter bar responsive */
    .hp-pub-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .hp-pub-search-input,
    .hp-pub-filter-select,
    .hp-pub-filter-btn,
    .hp-pub-filter-reset {
        width: 100%;
        min-width: unset;
        box-sizing: border-box;
    }
    
    /* Results count */
    .hp-pub-results-count {
        font-size: 12px;
        margin: 10px 0;
    }
    
    /* Pagination */
    .hp-pub-pagination {
        gap: 4px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hp-pub-page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    /* Small mobile devices */
    .hp-pub-item {
        padding: 10px;
    }
    
    .hp-pub-title {
        font-size: 13px;
    }
    
    .hp-pub-meta {
        gap: 4px;
    }
    
    .hp-pub-cat,
    .hp-pub-year {
        font-size: 9px;
        padding: 1px 6px;
    }
    
    .hp-pub-download-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 12px;
    }
    
    .hp-pub-icon {
        width: 28px;
        height: 28px;
    }
    
    .hp-pub-icon svg {
        width: 14px;
        height: 14px;
    }
    
    /* Ticker adjustments */
    .hp-pub-ticker-outer {
        height: auto !important;
        max-height: 400px;
    }
    
    .hp-pub-ticker-item {
        padding: 8px 0;
    }
    
    .hp-pub-ticker-item-title {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .hp-pub-new-badge {
        font-size: 8px;
        padding: 1px 6px;
    }
    
    /* Archive list */
    .hp-pub-archive-list .hp-pub-item {
        padding: 12px;
    }
    
    /* Empty state */
    .hp-pub-empty {
        padding: 30px 15px;
        font-size: 13px;
    }
}

/* Fix for table overflow on admin side */
@media (max-width: 782px) {
    .hp-pub-wrap .wp-list-table,
    .hp-vpub-wrap .wp-list-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .hp-pub-wrap .wp-list-table thead,
    .hp-vpub-wrap .wp-list-table thead {
        display: table-header-group;
    }
    
    .hp-pub-wrap .wp-list-table tbody,
    .hp-vpub-wrap .wp-list-table tbody {
        display: table-row-group;
    }
    
    .hp-pub-wrap .wp-list-table tr,
    .hp-vpub-wrap .wp-list-table tr {
        display: table-row;
    }
    
    .hp-pub-wrap .wp-list-table td,
    .hp-pub-wrap .wp-list-table th,
    .hp-vpub-wrap .wp-list-table td,
    .hp-vpub-wrap .wp-list-table th {
        display: table-cell;
        white-space: normal;
    }
}

/* Visual Publications specific responsive fixes (if needed) */
@media (max-width: 768px) {
    .hp-vpub-wrap .hp-upload-card {
        padding: 15px;
    }
    
    .hp-vpub-wrap .form-table {
        display: block;
        width: 100%;
    }
    
    .hp-vpub-wrap .form-table tbody,
    .hp-vpub-wrap .form-table tr {
        display: block;
        width: 100%;
    }
    
    .hp-vpub-wrap .form-table th {
        display: block;
        width: 100%;
        padding: 8px 0 4px;
    }
    
    .hp-vpub-wrap .form-table td {
        display: block;
        width: 100%;
        padding: 4px 0 12px;
    }
    
    .hp-vpub-wrap .hp-file-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hp-vpub-wrap .hp-file-row button {
        width: 100%;
        text-align: center;
    }
    
    /* Visual publications table */
    .hp-vpub-table img {
        width: 40px;
        height: auto;
        min-height: 52px;
    }
    
    
    
    /**/
    .hp-pub-ticker-item{
       padding-left: 8px;
    }
}