/**
 * Kanji Diccionario — Post Table Widget Styles.
 *
 * Base structural and aesthetic styles for the table widget.
 * Elementor selector-based controls override individual properties.
 *
 * @package Kanji_Diccionario
 * @since   1.0.0
 */

/* ─── Wrapper ─────────────────────────────────────────────── */

.kanji-post-table-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.kanji-post-table-wrapper:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

/* ─── Table ───────────────────────────────────────────────── */

.kanji-post-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

/* Header */
.kanji-post-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1rem;
    background: #f8f9fa;
    text-align: left;
}

/* Body cells */
.kanji-post-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
    transition: background-color 0.2s ease;
    text-align: left;
}

.kanji-post-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row hover */
.kanji-post-table tbody tr:hover td {
    background-color: rgba(0, 0, 0, 0.018);
}

/* Column styling */
.kanji-pt-col-title {
    font-weight: 600;
}

.kanji-pt-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.kanji-pt-title-link:hover {
    color: #000;
    text-decoration: underline;
}

.kanji-pt-col-excerpt {
    line-height: 1.6;
}

/* No posts message */
.kanji-pt-no-posts {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-style: italic;
}

/* Notice (no category selected) */
.kanji-pt-notice {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-style: italic;
}

/* ─── Pagination ──────────────────────────────────────────── */

.kanji-post-table-pagination-container {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.01);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.kanji-post-table-pagination-container:empty {
    display: none;
}

.kanji-pt-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.kanji-pt-pagination a,
.kanji-pt-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kanji-pt-pagination a:hover,
.kanji-pt-pagination a:focus-visible {
    border-color: #333;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    outline: none;
}

.kanji-pt-pagination .current {
    background: #333;
    color: #fff;
    border-color: #333;
    cursor: default;
}

/* ─── Loading State ───────────────────────────────────────── */

.kanji-post-table-wrapper.kanji-pt-loading {
    pointer-events: none;
}

/* Overlay */
.kanji-post-table-wrapper.kanji-pt-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 9;
}

/* Spinner */
.kanji-post-table-wrapper.kanji-pt-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(0, 0, 0, 0.06);
    border-top-color: #333;
    border-radius: 50%;
    animation: kanji-pt-spin 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 10;
}

@keyframes kanji-pt-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .kanji-post-table thead {
        display: none;
    }

    .kanji-post-table tbody tr {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .kanji-post-table tbody td {
        display: block;
        padding: 0.25rem 0;
        border: none;
    }

    .kanji-pt-col-title {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    .kanji-pt-pagination {
        gap: 0.25rem;
    }

    .kanji-pt-pagination a,
    .kanji-pt-pagination span {
        min-width: 2.2rem;
        height: 2.2rem;
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
}