/* Existing styles preserved above */
.rc-explorer__form {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem
}

.rc-explorer__field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 160px
}

.rc-explorer__actions {
    display: flex;
    gap: .5rem;
    align-items: flex-end
}

.rc-explorer__form select,
.rc-explorer__form input[type="search"],
.rc-search__form input[type="search"],
.rc-explorer__form input[type="date"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: #fff;
    color: #111827;
    box-shadow: none;
}

.rc-explorer__form .button,
.rc-explorer__form .button.button-secondary,
.rc-search__form .button {
    background: #e5e7eb !important;
    color: #111827 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
}

.rc-explorer__form .button:hover,
.rc-explorer__form .button.button-secondary:hover,
.rc-search__form .button:hover {
    background: #d1d5db !important;
    border-color: #9ca3af !important;
}

.rc-explorer__form .button:focus,
.rc-explorer__form .button.button-secondary:focus,
.rc-search__form .button:focus {
    outline: 2px solid #9ca3af;
    outline-offset: 1px;
}

.rc-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .75rem
}

.rc-pager .is-disabled {
    opacity: .5
}

.rc-search__form {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    align-items: flex-end
}

.rc-search__results .rc-search__item {
    padding: .75rem 0;
    border-bottom: 1px solid #e5e7eb
}

/* New Table Styles */
.rc-explorer__table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
}

.rc-explorer__table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-family: inherit;
}

.rc-explorer__table th {
    background: #fff;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    /* Gray dark */
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rc-explorer__table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    /* Very subtle gray */
    color: #1f2937;
}

.rc-explorer__row:hover td {
    background-color: #f8fafc;
    /* Subtle hover effect */
}

/* Columns */

/* PDF */
.rc-col-pdf {
    width: 80px;
    text-align: center;
}

.rc-pdf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.rc-pdf-badge:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.rc-pdf-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

.rc-pdf-none {
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
}

/* Date */
.rc-col-date {
    white-space: nowrap;
    color: #6b7280;
    /* Gray */
    font-size: 0.9rem;
    width: 120px;
}

/* Article */
.rc-col-article {
    min-width: 250px;
}

.rc-article-title {
    display: block;
    font-weight: 700;
    color: #111827;
    /* Black/Dark */
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.rc-article-title:hover {
    color: #2563eb;
}

.rc-article-authors {
    color: #6b7280;
    /* Gray */
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Edition */
.rc-col-edition {
    text-align: right;
    width: 150px;
}

.rc-col-edition a {
    color: #0d9488;
    /* Teal */
    text-decoration: underline;
    font-weight: 500;
    font-size: 0.9rem;
}

/* =========================================
   MOBILE OPTIMIZATION (max-width: 768px)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Search Form Optimization */
    .rc-explorer__form {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        /* Reduced gap */
    }

    .rc-explorer__field {
        width: 100%;
        min-width: 0;
        /* Override min-width */
        margin-bottom: 0.5rem;
    }

    .rc-explorer__field span {
        font-size: 14px;
        /* Smaller label */
        margin-bottom: 0.15rem;
    }

    .rc-explorer__form select,
    .rc-explorer__form input[type="search"],
    .rc-explorer__form input[type="date"] {
        height: 36px;
        /* Slightly compact */
        font-size: 14px;
        width: 100%;
        /* Force full width */
    }

    /* Date Fields: 50% width each, on same line */
    /* Assuming "Desde" and "Hasta" are sequential fields in DOM. 
       We target them layout-wise. Since they are just fields, we can 
       target the specific fields if they have classes or generic logic.
       The inputs are type="date". We can try to float them or use grid.
       Let's use flex-basis 48% for fields containing date inputs or just generic 50% split.
    */
    .rc-explorer__field:has(input[type="date"]) {
        flex: 1 1 45%;
        width: auto;
    }

    /* Actions: 50% width each */
    .rc-explorer__actions {
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
        display: flex;
    }

    .rc-explorer__actions .button {
        flex: 1;
        justify-content: center;
        font-size: 14px;
        height: 36px !important;
        line-height: 36px !important;
    }

    /* 2. Table to Cards Transformation */
    .rc-explorer__table-wrapper {
        border: none;
        background: transparent;
        overflow-x: hidden;
        /* Prevent scroll */
    }

    .rc-explorer__table,
    .rc-explorer__table tbody,
    .rc-explorer__table tr,
    .rc-explorer__table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .rc-explorer__table thead {
        display: none;
        /* Hide headers */
    }

    .rc-explorer__table tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        position: relative;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .rc-explorer__table td {
        padding: 0.25rem 0;
        border: none;
        text-align: left;
    }

    /* Specific Column Styling for Card Layout */

    /* Article Title (Main) */
    .rc-col-article {
        margin-bottom: 0.5rem;
        padding-right: 60px !important;
        /* Increased from 40px to Avoid overlap with PDF button */
    }

    .rc-article-title {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    /* PDF Button (Bottom Right, Normal Button Style) */
    .rc-col-pdf {
        position: static;
        /* No longer absolute */
        width: 100%;
        text-align: right;
        order: 4;
        /* Appears last */
        margin-top: 0.75rem;
        padding: 0 !important;
    }

    .rc-pdf-badge {
        font-size: 0.75rem;
        /* Restore text size */
        padding: 6px 12px;
        border-radius: 4px;
        /* Standard radius */
        background-color: #eff6ff;
        color: #2563eb;
        border: 1px solid #dbeafe;
        display: inline-flex;
        width: auto;
        height: auto;
    }

    .rc-pdf-badge span.dashicons {
        margin-right: 4px;
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .rc-pdf-none {
        display: none;
    }

    /* Reorder flex container */
    .rc-explorer__table tr {
        display: flex;
        flex-direction: column;
        padding-bottom: 1.25rem;
        /* Extra padding for bottom button */
    }

    .rc-col-article {
        order: 1;
        padding-right: 0 !important;
        margin-bottom: 0.25rem;
    }

    .rc-col-date {
        order: 2;
        width: auto;
        display: inline-block;
        margin-right: 1rem;
    }

    .rc-col-edition {
        order: 3;
        width: auto;
        display: inline-block;
        text-align: left;
    }

    /* Metadata wrapper? 
       Date and Edition are separate tds. We can make them inline-block to sit next to each other.
       We set them to order 2 and 3.
    */

}