/**
 * Etablissements — CSS unifié (mars 2026)
 * Styles partagés pour composantes, structures, ED, IEJ
 *
 * Chargé dans: tous les mainbody.php d'établissements
 */

/* =============================================
   HERO UNIFIÉ (tous types)
   ============================================= */
.etab-hero {
    position: relative;
    overflow: hidden;
    min-height: var(--hero-min, 260px);
    background: none;
    isolation: isolate;
    border-radius: 10px;
    --hero-max: 360px;
    --hero-sat: 0.85;
    --hero-blur: 1.5px;
    --hero-bright: 0.82;
}

/* Image de fond (pseudo-élément) */
.etab-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero, linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: saturate(var(--hero-sat)) blur(var(--hero-blur)) brightness(var(--hero-bright));
    z-index: 0;
    pointer-events: none;
}

/* Variante gradient (pas d'image) */
.etab-hero--gradient::before {
    filter: none;
}

/* Gradient overlay */
.etab-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 45%,
        rgba(0, 0, 0, 0.08) 80%
    );
    z-index: 0;
    pointer-events: none;
}

/* Contenu au-dessus */
.etab-hero__content {
    position: relative;
    z-index: 1;
}

/* --- Ligne 1 : Logo principal + Titre --- */
.etab-hero__main {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo principal (grand, à gauche) */
.etab-hero__main-logo {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}

.etab-hero__main-logo img {
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
}

/* Texte (à droite du logo) */
.etab-hero__main-text {
    flex: 1;
    min-width: 0;
}

.etab-hero__parent {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.etab-hero__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    line-height: 1.25;
    margin: 0;
}

.etab-hero__sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.etab-hero__sigle {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.etab-hero__badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(200, 16, 46, 0.8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Ligne 2 : Logos associés (petites pastilles) --- */
.etab-hero__assoc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.etab-hero__assoc-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.etab-hero__assoc-pill:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.etab-hero__assoc-pill img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

.etab-hero__assoc-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

/* =============================================
   META BAR (sous le hero, toutes pages)
   ============================================= */
.etab-meta-bar {
    background: #fff;
    /*border-bottom: 1px solid #e8e8e8;
    padding: 12px 0;*/
    margin-bottom: 24px;
}

.etab-meta-bar__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 15px;
}

/* Chips texte */
.etab-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f5f5f5;
    color: #444;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    transition: all 0.2s;
}

.etab-meta-chip i {
    font-size: 11px;
    color: #c8102e;
}

/* Variantes couleur par type */
.etab-meta-chip--type {
    background: #c8102e;
    color: #fff;
    border-color: #c8102e;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.etab-meta-chip--type i { color: #fff; }

.etab-meta-chip--type-blue {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.etab-meta-chip--type-green {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

.etab-meta-chip--type-purple {
    background: #7b1fa2;
    color: #fff;
    border-color: #7b1fa2;
}

/* Chips liens */
.etab-meta-chip--link {
    text-decoration: none;
    color: #444;
    cursor: pointer;
    background: #fff;
}

.etab-meta-chip--link:hover {
    border-color: #c8102e;
    color: #c8102e;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(200, 16, 46, 0.12);
}

/* Chip contact (tel, email) */
.etab-meta-chip--contact {
    background: #fff;
    color: #333;
    font-weight: 500;
}

.etab-meta-chip--contact i { color: #888; }

/* Séparateur */
.etab-meta-bar__separator {
    width: 1px;
    height: 22px;
    background: #ddd;
    margin: 0 4px;
}

/* Icônes réseaux sociaux */
.etab-meta-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.etab-meta-social:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Couleurs natives au hover */
.etab-meta-social--x:hover        { background: #000;    border-color: #000;    color: #fff; }
.etab-meta-social--youtube:hover   { background: #ff0000; border-color: #ff0000; color: #fff; }
.etab-meta-social--linkedin:hover  { background: #0077b5; border-color: #0077b5; color: #fff; }
.etab-meta-social--facebook:hover  { background: #1877f2; border-color: #1877f2; color: #fff; }
.etab-meta-social--mastodon:hover  { background: #6364ff; border-color: #6364ff; color: #fff; }
.etab-meta-social--canalu:hover    { background: #e63946; border-color: #e63946; color: #fff; }

/* =============================================
   LAYOUT PRINCIPAL (2/3 + 1/3 sidebar)
   ============================================= */

/* Sidebar sticky */
.etab-sidebar {
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

/* =============================================
   DIRECTION — Group X modernisée (structures, ED)
   ============================================= */
.etab-direction-card {
    padding: 16px;
}

.etab-direction-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.etab-direction-card li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
}

.etab-direction-card li:last-child {
    border-bottom: none;
}

.user-free {
    color: #666;
    font-weight: 500;
}

.user-ec a {
    color: #c8102e;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.user-ec a:hover {
    color: #a00d24;
    text-decoration: underline;
}

.user-cnrs {
    color: #1565c0;
    font-weight: 500;
}

/* =============================================
   LABO CARDS (shared)
   ============================================= */
.labo-card {
    transition: box-shadow 0.3s, transform 0.3s;
    border-left: 3px solid #c8102e;
}

.labo-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-3px);
}

.labo-card__logo {
    height: 110px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.labo-card__logo img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
    padding: 10px;
}

.labo-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1em * 2.6);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    transition: color 0.2s;
}

.labo-card:hover .labo-card__title {
    color: #c8102e;
}

.labo-card .jl-card-body {
    background: #f7f7f7;
}

.labo-card .jl-card-footer {
    background: #fff;
    border-top: none !important;
    font-size: 0.75rem;
}

.labo-card .jl-badge {
    background: #c8102e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* =============================================
   ACTUALITES — Mini-cards horizontales
   ============================================= */
.etab-actus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.etab-actu-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.65rem;
    display: flex;
    gap: 0.6rem;
    transition: box-shadow 0.2s;
}

.etab-actu-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.etab-actu-card__img {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.etab-actu-card__type {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c8102e;
}

.etab-actu-card__title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.etab-actu-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.etab-actu-card__title a:hover {
    color: #c8102e;
}

.etab-actu-card__meta {
    font-size: 0.7rem;
    color: #999;
}

.etab-actus-hidden {
    display: none;
}

@media (max-width: 639px) {
    .etab-actus-grid {
        grid-template-columns: 1fr;
    }

    .etab-actu-card__img {
        width: 48px;
        height: 48px;
    }
}

/* =============================================
   CONTACT CARD
   ============================================= */
.jl-card-default .jl-list-collapse li {
    line-height: 1.5;
}

/* =============================================
   JCP EN REGION
   ============================================= */
.etab-jcp-card .jl-card-header {
    border-bottom: 1px solid #f0f0f0;
}

.etab-jcp-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.etab-jcp-item:last-child {
    border-bottom: none;
}

.etab-jcp-item:hover {
    background: #fafafa;
    text-decoration: none;
    color: inherit;
}

.etab-jcp-item__date {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
    background: #c8102e;
    color: #fff;
    border-radius: 8px;
    padding: 6px 4px;
    line-height: 1;
}

.etab-jcp-item__day {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.etab-jcp-item__month {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.etab-jcp-item__year {
    display: block;
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 1px;
}

.etab-jcp-item__content {
    flex: 1;
    min-width: 0;
}

.etab-jcp-item__title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    transition: color 0.2s;
}

.etab-jcp-item:hover .etab-jcp-item__title {
    color: #c8102e;
}

.etab-jcp-item__sub {
    font-size: 0.75rem;
    color: #888;
    margin-top: 3px;
    line-height: 1.4;
}

/* =============================================
   RECRUTEMENTS
   ============================================= */
.etab-rec-card .jl-card-header {
    border-bottom: 1px solid #f0f0f0;
}

.etab-rec-card .jl-badge {
    background: #c8102e;
    color: #fff;
}

.etab-rec-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.etab-rec-item:last-child {
    border-bottom: none;
}

.etab-rec-item:hover {
    background: #fafafa;
    text-decoration: none;
    color: inherit;
}

.etab-rec-item__status {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.etab-rec-status--open {
    background: #e8f5e9;
    color: #2e7d32;
}

.etab-rec-status--upcoming {
    background: #fff3e0;
    color: #e65100;
}

.etab-rec-status--closed {
    background: #f5f5f5;
    color: #999;
}

.etab-rec-item__content {
    flex: 1;
    min-width: 0;
}

.etab-rec-item__title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    transition: color 0.2s;
}

.etab-rec-item:hover .etab-rec-item__title {
    color: #c8102e;
}

.etab-rec-item__meta {
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.etab-rec-item__odyssee {
    flex-shrink: 0;
    background: #C63EC2;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

/* =============================================
   SECTIONS COMMUNES
   ============================================= */

/* Titres de section pleine largeur */
.etab-section-title {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 3px;
    border-bottom: 1px solid #f3f3f3;
}

.etab-section-title span {
    border-bottom: 2px solid #dadada;
    padding-bottom: 3px;
}

/* Slider dans card — éviter débordement */
.jl-card-body .jl-slider {
    max-width: min(900px, calc(100vw - 2rem));
    margin-inline: auto;
}

.jl-card-body .jl-slider > .jl-slider-container {
    width: 100%;
    overflow: hidden;
}

.jl-grid > [class*="jl-width-"],
.jl-card,
.jl-card-body {
    min-width: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 960px) {
    .labo-card__logo { height: 120px; }
    .labo-card__logo img { max-height: 90px; }
}

@media (max-width: 959px) {
    .etab-hero {
        --hero-min: 200px;
        --hero-max: 280px;
    }

    .etab-hero__title {
        font-size: 1.4rem;
    }

    .etab-hero__main {
        gap: 16px;
    }

    .etab-hero__main-logo {
        width: 80px;
        height: 80px;
    }

    .etab-hero__main-logo img {
        max-width: 64px;
        max-height: 64px;
    }

    .etab-hero__assoc-pill {
        width: 42px;
        height: 42px;
    }

    .etab-hero__assoc-pill img {
        max-width: 30px;
        max-height: 30px;
    }

    .etab-meta-bar__inner {
        justify-content: center;
    }

    .etab-sidebar {
        position: static;
    }
}

@media (max-width: 639px) {
    .etab-hero {
        --hero-min: 180px;
        border-radius: 0;
    }

    .etab-hero__main {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .etab-hero__main-logo {
        width: 90px;
        height: 90px;
    }

    .etab-hero__main-logo img {
        max-width: 80px;
        max-height: 80px;
    }

    .etab-hero__title {
        font-size: 1.15rem;
    }

    .etab-hero__parent {
        font-size: 0.85rem;
    }

    .etab-hero__sub {
        justify-content: center;
    }

    .etab-hero__assoc {
        justify-content: center;
    }

    .etab-hero__assoc-pill {
        width: 60px;
        height: 60px;
    }

    .etab-hero__assoc-pill img {
        max-width: 48px;
        max-height: 48px;
    }

    .etab-meta-chip {
        font-size: 11px;
        padding: 3px 10px;
    }

    .etab-meta-social {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .labo-card__logo { height: 90px; }
    .labo-card__logo img { max-height: 60px; }
}
