/* MBU QA Publications — สไตล์ตารางผลงานตีพิมพ์ + แถบกรอง */
/* Prefix .mbu-qa-pub- ทุกคลาส เพื่อไม่ชนกับธีม WordPress ของหน่วยงานที่นำไปใช้ */
a {
    text-decoration: none;
}
.mbu-qa-pub-wrap {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

.mbu-qa-pub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.mbu-qa-pub-search {
    flex: 1 1 220px;
    padding: .5rem .75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: .95rem;
}

.mbu-qa-pub-filter-year,
.mbu-qa-pub-filter-type {
    padding: .5rem .6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: .9rem;
    background: #fff;
}

.mbu-qa-pub-count {
    margin-left: auto;
    font-size: .85rem;
    color: #777;
    white-space: nowrap;
}

.mbu-qa-pub-table-wrap {
    overflow-x: auto;
}

.mbu-qa-pub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.mbu-qa-pub-table th,
.mbu-qa-pub-table td {
    border: 1px solid #e5e5e5;
    padding: .6rem .75rem;
    text-align: left;
    vertical-align: top;
}

.mbu-qa-pub-table th {
    background: #f5f5f5;
    white-space: nowrap;
}

.mbu-qa-pub-title {
    font-weight: 600;
    min-width: 220px;
}

.mbu-qa-pub-apa {
    min-width: 260px;
    color: #555;
    font-size: .85rem;
}

.mbu-qa-pub-file-link {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: #e8f0fe;
    color: #1565c0;
    text-decoration: none;
    font-size: .85rem;
    white-space: nowrap;
}

.mbu-qa-pub-file-link:hover {
    background: #d5e5fc;
}

.mbu-qa-pub-no-match {
    text-align: center;
    color: #777;
    padding: 1.5rem 0;
}

.mbu-qa-pub-empty-msg,
.mbu-qa-pub-error {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
}

.mbu-qa-pub-error {
    background: #fdecea;
    color: #b71c1c;
}

@media (max-width: 600px) {
    .mbu-qa-pub-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mbu-qa-pub-count {
        margin-left: 0;
    }
}

/* ── Block: container เมื่อแทรกในหน้า/โพสต์ (Widget ใช้ before_widget ของธีมแทน ไม่ต้องมี wrapper นี้) ── */
.mbu-qa-pub-block {
    margin: 1.5rem 0;
}

.mbu-qa-pub-widget-title-heading {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ── Widget/Block: การ์ด/แถวข้อมูลผลงานตีพิมพ์ที่ใช้ร่วมกันทั้ง 3 รูปแบบ ── */
.mbu-qa-pub-widget-title {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.4;
    margin-bottom: .25rem;
}

.mbu-qa-pub-widget-author {
    font-size: .82rem;
    color: #666;
    margin-bottom: .4rem;
}

.mbu-qa-pub-widget-file {
    display: inline-block;
    font-size: .8rem;
    color: #1565c0;
    text-decoration: none;
}

.mbu-qa-pub-widget-file:hover {
    text-decoration: underline;
}

.mbu-qa-pub-widget-view-all {
    margin-top: 1rem;
    text-align: center;
}

.mbu-qa-pub-widget-btn {
    display: inline-block;
    padding: .5rem 1.25rem;
    border-radius: 999px;
    background: #1565c0;
    color: #fff !important;
    text-decoration: none;
    font-size: .85rem;
}

.mbu-qa-pub-widget-btn:hover {
    background: #0d4a94;
}

/* ── Widget: Card ── */
.mbu-qa-pub-widget-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .85rem;
}

.mbu-qa-pub-widget-card {
    padding: .85rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* ── Widget: List ── */
.mbu-qa-pub-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mbu-qa-pub-widget-list-item {
    padding: .65rem 0;
    border-bottom: 1px solid #eee;
}

.mbu-qa-pub-widget-list-item:last-child {
    border-bottom: none;
}

/* ── Widget: Carousel ── */
.mbu-qa-pub-widget-carousel {
    position: relative;
}

.mbu-qa-pub-widget-carousel-track {
    display: flex;
    gap: .85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: .5rem;
    -webkit-overflow-scrolling: touch;
}

.mbu-qa-pub-widget-carousel-slide {
    flex: 0 0 200px;
    scroll-snap-align: start;
    padding: .85rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.mbu-qa-pub-widget-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.mbu-qa-pub-widget-carousel-prev {
    left: -.75rem;
}

.mbu-qa-pub-widget-carousel-next {
    right: -.75rem;
}
