/*
 * Estilos del plugin Liblit.
 * Antes iban mezclados como atributos HTML obsoletos (bgcolor, align="center"...)
 * dentro del propio PHP. Ahora viven aquí y se cargan con wp_enqueue_style()
 * solo cuando hace falta.
 */

/* --- Tabla de libros (pendientes / leídos) ------------------------------ */

.liblit-table-wrap {
    width: 100%;
    overflow-x: auto; /* red de seguridad: si algo no cabe, se puede hacer scroll en vez de romper el layout */
    margin: 10px 0;
}

.liblit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.liblit-table thead th {
    background: #F3F2D8;
    text-align: center;
    padding: 8px 10px;
    font-weight: 600;
}

.liblit-table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
    border-bottom: 1px solid #e5e3d6;
}

.liblit-table tbody tr:hover {
    background: #fbfaf2;
}

.liblit-table img {
    max-width: 100%;
    height: auto;
}

/* --- Versión móvil: la tabla se convierte en tarjetas apiladas ---------- */

@media (max-width: 640px) {
    .liblit-table thead {
        display: none;
    }

    .liblit-table,
    .liblit-table tbody,
    .liblit-table tr,
    .liblit-table td {
        display: block;
        width: 100%;
    }

    .liblit-table tr {
        margin-bottom: 16px;
        border: 1px solid #e5e3d6;
        border-radius: 8px;
        overflow: hidden;
    }

    .liblit-table td {
        text-align: right;
        position: relative;
        padding: 10px 12px 10px 45%;
        border-bottom: 1px solid #f1f0e6;
    }

    .liblit-table td:last-child {
        border-bottom: none;
    }

    /* La "etiqueta" de cada dato sale del atributo data-label del propio <td> */
    .liblit-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 10px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #555;
    }
}

/* --- Paginación ----------------------------------------------------------- */

.liblit-pagination {
    text-align: center;
    margin: 12px 0;
}

.liblit-pagination a {
    padding: 2px 6px;
}

.liblit-pagination select {
    margin: 0 10px;
}

/* --- Caja "leyendo / próximo" (widget esclavo lector) --------------------- */

.liblit-info-box {
    text-align: center;
}

.liblit-info-box .liblit-info-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.liblit-info-box .liblit-info-col {
    text-align: center;
}

.liblit-info-box img {
    max-width: 100%;
    height: auto;
}

/* --- Estadísticas ----------------------------------------------------------- */

.liblit-stats img {
    max-width: 100%;
    height: auto;
}
.liblit-info-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
}

.liblit-info-col {
    text-align: center;
    margin: 0;
    padding: 0;
}