/* =====================================================================
   INKADH — Archive Textes Juridiques (/textes-juridiques/)
   Design des cartes repris du widget « Textes Juridiques ».
   ===================================================================== */

.itex-section {
    background: #f6f7fc;
    padding: 48px 0 100px;
    min-height: 60vh;
}
.itex-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 60px;
}

/* ── Hero ── */
.itex-header {
    text-align: center;
    margin-bottom: 44px;
}
.itex-title {
    font-size: 2.6rem;
    font-weight: 800;
    color: #071338;
    line-height: 1.2;
    margin: 0 0 12px;
}
.itex-subtitle {
    font-size: 1rem;
    color: #5a6480;
    margin: 0;
}

/* ── Onglets catégories ── */
.itex-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 54px;
}
.itex-tab {
    display: inline-block;
    padding: 9px 26px;
    border-radius: 40px;
    border: 1.5px solid #d7ddf2;
    background: #fff;
    color: #2b2b3d;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}
.itex-tab:hover {
    border-color: #2342F7;
    color: #2342F7;
}
.itex-tab.active {
    background: #2342F7;
    border-color: #2342F7;
    color: #fff;
}

/* ── Grille : 3 colonnes égales, cartes de même hauteur par ligne ── */
.itex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: stretch;
}

/* ── Carte ── */
.itex-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 2px 16px rgba(35, 66, 247, 0.06);
    border: 1.5px solid rgba(35, 66, 247, 0.08);
    transition: box-shadow .25s, transform .25s;
    height: 100%;                 /* remplit la ligne → hauteur uniforme */
}
.itex-card:hover {
    box-shadow: 0 8px 32px rgba(35, 66, 247, 0.14);
    transform: translateY(-3px);
}

/* Contenu (titre + « lire plus ») : occupe l'espace, pousse les boutons en bas */
.itex-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.itex-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #071338;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    /* Tronqué à 3 lignes par défaut */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-height: calc(1.5em * 3 + 2px);
    transition: max-height .38s ease;
}
/* Déployé : titre complet + hauteur de carte qui grandit */
.itex-card.is-open .itex-card-title {
    -webkit-line-clamp: unset;
    overflow: visible;
}
.itex-card-more {
    background: none;
    border: none;
    color: #2342F7;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: color .2s;
}
.itex-card-more:hover { text-decoration: underline; color: #1a34d4; }

/* ── Actions : Consulter + Télécharger ── */
.itex-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}
.itex-btn-consulter,
.itex-btn-telecharger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s, background .2s, border-color .2s;
    white-space: nowrap;
}
.itex-btn-consulter svg,
.itex-btn-telecharger svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
/* Consulter : plein bleu */
.itex-btn-consulter {
    background: #2342F7;
    color: #fff;
    border: 1.6px solid #2342F7;
}
.itex-btn-consulter:hover {
    background: #1a34d4;
    border-color: #1a34d4;
    color: #fff;
}
/* Télécharger : contour bleu */
.itex-btn-telecharger {
    background: transparent;
    color: #071338;
    border: 1.6px solid #2342F7;
}
.itex-btn-telecharger:hover {
    color: #2342F7;
    background: rgba(35, 66, 247, 0.04);
}
/* Indisponible */
.itex-btn-unavailable {
    font-size: 0.82rem;
    font-weight: 600;
    color: #99a;
    padding: 8px 18px;
    border: 1.6px dashed #ccd3e6;
    border-radius: 4px;
}

/* ── Pagination ── */
.itex-pagination {
    margin-top: 56px;
}
.itex-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.itex-pagination a,
.itex-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    background: #fff;
    border: 1.5px solid #e2e7f5;
    color: #2b2b3d;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}
.itex-pagination a:hover {
    border-color: #2342F7;
    color: #2342F7;
}
.itex-pagination .current {
    background: #2342F7;
    border-color: #2342F7;
    color: #fff;
}

/* ── Vide ── */
.itex-empty {
    text-align: center;
    padding: 60px 20px;
    color: #5a6480;
}
.itex-empty svg {
    width: 54px;
    height: 54px;
    color: #c3cbe4;
    margin-bottom: 16px;
}
.itex-empty p {
    font-size: 1rem;
    margin: 0 0 16px;
}
.itex-empty-reset {
    color: #2342F7;
    font-weight: 600;
    text-decoration: none;
}
.itex-empty-reset:hover {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .itex-inner   { padding: 0 30px; }
    .itex-title   { font-size: 2rem; }
    .itex-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .itex-section { padding: 40px 0 70px; }
    .itex-inner   { padding: 0 18px; }
    .itex-title   { font-size: 1.7rem; }
    .itex-grid    { grid-template-columns: 1fr; gap: 16px; }
    .itex-tabs    { gap: 8px; margin-bottom: 36px; }
    .itex-tab     { padding: 8px 18px; font-size: 0.82rem; }
}
