/* ============================================================
   CPT Table Widget – Frontend Styles
   ============================================================ */

/* Wrapper */
.ctw-table-wrapper {
    width: 100%;
    font-family: inherit;
}

/* Search bar */
.ctw-search-bar {
    margin-bottom: 14px;
}

.ctw-search-input {
    width: 100%;
    max-width: 360px;
    padding: 9px 14px;
    border: 1px solid #c8d5e3;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: #333;
}

.ctw-search-input:focus {
    border-color: #1a3c6e;
    box-shadow: 0 0 0 3px rgba(26, 60, 110, .12);
}

/* Scroll container (horizontal on mobile) */
.ctw-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table base */
.ctw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
}

/* Header */
.ctw-table thead th {
    background-color: #1a3c6e;
    color: #fff;
    text-align: left;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(0,0,0,.1);
    white-space: nowrap;
}

/* Cells */
.ctw-table tbody td {
    padding: 10px 16px;
    color: #333;
    border-bottom: 1px solid #d0dbe8;
    vertical-align: middle;
}

/* Striped */
.ctw-table.ctw-striped tbody tr:nth-child(even) {
    background-color: #f4f7fb;
}

/* Hover */
.ctw-table.ctw-hover tbody tr:hover {
    background-color: #dde8f5;
    transition: background-color .15s ease;
}

/* Featured image */
.ctw-feat-img {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

/* ACF image field */
.ctw-acf-img {
    display: block;
    max-width: 80px;
    height: auto;
    border-radius: 4px;
}

/* Email / URL links */
.ctw-table a {
    color: #1a3c6e;
    text-decoration: none;
}

.ctw-table a:hover {
    text-decoration: underline;
}

/* Empty value */
.ctw-empty {
    color: #aaa;
}

/* No results row */
.ctw-table .ctw-no-results td,
.ctw-no-search-results p {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 24px;
}

/* ── Pagination ─────────────────────────────────────────── */
.ctw-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    align-items: center;
}

.ctw-page-btn {
    padding: 6px 12px;
    border: 1px solid #c8d5e3;
    border-radius: 4px;
    background: #fff;
    color: #1a3c6e;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    line-height: 1;
}

.ctw-page-btn:hover {
    background: #eef3fb;
    border-color: #1a3c6e;
}

.ctw-page-btn.ctw-page-active {
    background: #1a3c6e;
    color: #fff;
    border-color: #1a3c6e;
    font-weight: 600;
    pointer-events: none;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .ctw-table thead th,
    .ctw-table tbody td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .ctw-search-input {
        max-width: 100%;
    }
}
