/**
 * Responsive Table Styles
 * Cohérent avec le style desktop du thème
 * Breakpoint: 768px (tablet)
 */

/* Wrapper */
.responsive-table-wrapper {
    width: 100%;
}

/* Desktop: show table, hide cards */
.responsive-table-desktop {
    display: block;
}

.responsive-table-mobile {
    display: none;
}

/* Mobile: hide table, show cards */
@media screen and (max-width: 767px) {
    .responsive-table-desktop {
        display: none;
    }

    .responsive-table-mobile {
        display: block;
    }
}

/* ========================================
   Cards container
   ======================================== */
.table-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================
   Single card - style cohérent avec table desktop
   ======================================== */
.table-card {
    border: 1px solid #000;
    overflow: hidden;
}

.table-card--footer {
    background-color: #f0f0f0;
}

/* ========================================
   Card header - comme le th desktop
   ======================================== */
.table-card__header {
    background-color: color-mix(in srgb, var(--wp--preset--color--mist, #DCE0E4) 60%, transparent);
    padding: 8px;
    border-bottom: 1px solid #000;
}

.table-card__title {
    font-weight: 600;
    display: block;
}

/* ========================================
   Card body
   ======================================== */
.table-card__body {
    display: flex;
    flex-direction: column;
}

/* ========================================
   Card row - comme les td desktop
   ======================================== */
.table-card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 8px;
    border-bottom: 1px solid #000;
}

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

/* Label - comme le th */
.table-card__label {
    font-weight: 600;
    flex-shrink: 0;
    min-width: 40%;
    color: inherit;
}

/* Value - comme le td */
.table-card__value {
    text-align: right;
    flex-grow: 1;
}

/* ========================================
   Links - cohérent avec le thème
   ======================================== */
.table-card__value a,
.table-card__title a {
    color: var(--wp--preset--color--tide, #0066cc);
    text-decoration: underline;
}

.table-card__value a:hover,
.table-card__title a:hover {
    text-decoration: none;
}

/* ========================================
   Style stripes - cohérent avec is-style-stripes
   ======================================== */
.is-style-stripes + .responsive-table-mobile .table-card__row:nth-child(odd),
.responsive-table-wrapper:has(.is-style-stripes) .table-card__row:nth-child(odd) {
    background-color: #f0f0f0;
}

/* ========================================
   MODE COLONNES - Chaque colonne = un bloc
   ======================================== */

.table-columns {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-column {
    border: 1px solid #000;
    overflow: hidden;
}

.table-column--footer {
    background-color: #f0f0f0;
}

/* Column header - comme le th desktop */
.table-column__header {
    background-color: color-mix(in srgb, var(--wp--preset--color--mist, #DCE0E4) 60%, transparent);
    padding: 8px;
    border-bottom: 1px solid #000;
}

.table-column__title {
    font-weight: 600;
    display: block;
}

/* Column body */
.table-column__body {
    display: flex;
    flex-direction: column;
}

/* Column row - comme les td desktop */
.table-column__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 8px;
    border-bottom: 1px solid #000;
}

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

/* Label - identifiant de ligne (1ère colonne) */
.table-column__label {
    font-weight: 600;
    flex-shrink: 0;
}

.table-column__value {
    text-align: right;
    flex-grow: 1;
}

/* Links */
.table-column__value a,
.table-column__title a {
    color: var(--wp--preset--color--tide, #0066cc);
    text-decoration: underline;
}

.table-column__value a:hover,
.table-column__title a:hover {
    text-decoration: none;
}

/* Stripes for column mode */
.responsive-table-wrapper:has(.is-style-stripes) .table-column__row:nth-child(odd) {
    background-color: #f0f0f0;
}
