/* ===== Publication Display Grid – style.css ===== */

.pub-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Filter Bar --- */
.pub-grid-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.pub-grid-search {
    width: 40%;
    flex: 0 0 40%;
}

.pub-grid-search input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    color: #333;
}

.pub-grid-sort-options {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex: 1;
}

.pub-grid-custom-select {
    flex: 1;
    min-width: 0;
    position: relative;
    font-family: 'Inter', sans-serif;
    z-index: 10;
    cursor: pointer;
}

.pub-grid-custom-select.open {
    z-index: 20;
}

/* --- Grid Layout --- */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* --- Card --- */
.pub-grid-card {
    background-color: #ffffff !important;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    border: 1px solid #f0f0f0;
    color: #444;
}

.pub-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pub-grid-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    margin: 15px;
    border-radius: 15px;
}

.pub-grid-card-content {
    padding: 0 20px 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pub-grid-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e !important;
    margin: 10px 0 5px 0;
    line-height: 1.4;
}

.pub-grid-card-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-grid-card-meta {
    font-size: 0.75rem;
    color: #6c757d !important;
    margin-bottom: 12px;
    font-weight: 400;
}

.pub-grid-card-excerpt {
    font-size: 0.95rem;
    color: #6c757d !important;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.pub-grid-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    width: 100%;
}

.pub-grid-read-more {
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
}

.pub-grid-read-more::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #1a1a2e;
    transition: width 0.3s;
}

.pub-grid-read-more:hover::after {
    width: 100%;
}

.pub-grid-category-badge {
    background-color: #e6f0ff;
    color: #0056b3;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Loading State --- */
.pub-grid-loading {
    text-align: center;
    width: 100%;
    color: #666;
    font-size: 1.2em;
}

/* --- Hover Variants --- */
.pub-grid-hover-lift .pub-grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pub-grid-hover-zoom .pub-grid-card:hover .pub-grid-card-image {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.pub-grid-hover-zoom .pub-grid-card-image {
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.pub-grid-hover-none .pub-grid-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --- Button Style Variants --- */
.pub-grid-btn-style-box .pub-grid-read-more {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.pub-grid-btn-style-box .pub-grid-read-more::after {
    display: none;
}

.pub-grid-btn-style-text .pub-grid-read-more {
    background: transparent;
    padding: 0;
}

/* --- Pagination --- */
.pub-grid-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
    flex-wrap: wrap;
}

.pub-grid-page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: all 0.3s ease;
}

.pub-grid-page-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.pub-grid-page-btn.active {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

/* --- Custom Dropdown --- */
.pub-grid-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    color: #333;
}

.pub-grid-select-trigger:hover {
    border-color: #bbb;
}

.pub-grid-arrow {
    width: 0;
    height: 0;
    border: solid #666;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-bottom: 2px;
    transition: transform 0.3s;
}

.pub-grid-custom-select.open .pub-grid-arrow {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

.pub-grid-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.pub-grid-custom-select.open .pub-grid-select-dropdown {
    display: block;
}

.pub-grid-select-search {
    padding: 10px;
    border-bottom: 1px dashed #eee;
}

.pub-grid-select-search input {
    width: 100%;
    padding: 6px 8px;
    border: 1px dotted #0056b3;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.pub-grid-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.pub-grid-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: #444;
}

.pub-grid-option:hover {
    background: #f5f9ff;
    color: #0056b3;
}

.pub-grid-option.selected {
    background: #e6f0ff;
    color: #0056b3;
    font-weight: 600;
}

.pub-grid-selected-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* --- Scrollbar --- */
.pub-grid-options-list::-webkit-scrollbar {
    width: 6px;
}

.pub-grid-options-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pub-grid-options-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.pub-grid-options-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .pub-grid-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .pub-grid-search,
    .pub-grid-search input {
        width: 100%;
        max-width: 100%;
    }

    .pub-grid-sort-options {
        width: 100%;
        flex-direction: column;
        gap: 15px;
    }

    .pub-grid-custom-select {
        width: 100%;
        flex: auto;
    }
}