/* =========================================================
   🎨 directory.css — Styles globaux pour SubjectList
   ========================================================= */

/* =========================================================
   🎨 VARIABLES GLOBALES (Design Tokens)
   ========================================================= */
:root {
    /* Couleurs principales */
    --color-primary: #278FE2;          /* Bleu principal utilisé pour titres/links */
    --color-primary-dark: #1e3d7b;     /* Bleu foncé au survol */
    --color-dark-blue: #092851;        /* Bleu foncé pour boutons non-actifs */
    --color-orange: #f28c00;           /* Orange accent / département */
    --color-accent: #f57c00;           /* autre orange (breadcrumbs) */

    /* Textes et fonds */
    --color-text-dark: #333;
    --color-text-medium: #444;
    --color-text-light: #999;
    --color-background-light: #e0e0e0;
    --color-background-off-white: #F8F6F2;
    --color-row-even: #ffffff;
    --color-row-odd: #eeeeee;
    --color-row-hover: #d7dff2;

    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* Rayons */
    --radius-sm: 5px;
    --radius-lg: 25px;

    /* Typographie */
    --font-family: 'Raleway', sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 1.8rem;
}

/* =========================================================
   🧱 STRUCTURE GLOBALE
   ========================================================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding-top: 0 !important;
    font-family: var(--font-family);
    color: var(--color-text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.subjectlist-layout {
    display: flex;
    flex-direction: column;
    width: min(90%, 1600px);
    margin: var(--spacing-md) auto;
    padding: 0 var(--spacing-lg);
    box-sizing: border-box;
    background-color: #fff;
}

.content-align-logo {
    margin-top: var(--spacing-xl);
}

.bandeau-recrutement {
    background-color: rgba(40, 143, 226, 1);
    color: white;
    text-align: center;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bandeau-recrutement p {
    margin: 0;
}

/* =========================================================
   🔍 FILTRES + RECHERCHE (barre supérieure)
   ========================================================= */
/* Wrapper: si tu laisses la search-container DANS filters-container (comme dans ton PHP),
   cette règle gère l'alignement gauche/bas droit */
.filters-container {
    display: flex;
    align-items: center;            /* centre verticalement */
    justify-content: flex-start; /* pousse la recherche à droite si elle est en flex item séparé */
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 15px;
    font-family: var(--font-family);
    width: 100%;
}

.filters-container label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #092951;
    cursor: pointer;
    white-space: nowrap;
}

.filter-dropdown-container {
    position: relative;
    display: inline-block;
}

.filter-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    border-top: none;
    left: 0;
    top: 100%; /* S aligne sous le bouton */
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-menu.show {
    display: block;
}

.menu-item {
    padding: 8px 15px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.menu-item:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

.menu-item.reset {
    color: #333;
}
.menu-item.reset:hover {
    color: orange;
    background-color: rgba(255, 165, 0, 0.1); /* Très léger voile orange au fond */
}

/* Boutons de filtres */
.filter-btn {
    border: none;
    /*border-radius: 20px;*/
    padding: 6px 18px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    background-color: var(--color-dark-blue);
    transition: all 0.16s ease;
    white-space: nowrap;
}

.filter-btn.active {
    background-color: var(--color-orange);
}

.filter-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.filter-icon {
    width: 25px;
    height: 25px;
    vertical-align: middle;
    filter: brightness(1.3) contrast(1.2);
}

.search-container {
    display: flex;
    align-items: center;    /* centrage vertical */
    position: relative;
    max-width: 320px;
    width: 100%;
    flex: 0 0 320px;
    margin-left: auto; /* garantit qu'il se colle à droite si dans le même conteneur */
}

.search-container input,
#searchInput {
    width: 100%;
    padding: 8px 36px 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    background: #fff;
}

.search-container .icon-search {
    position: absolute;
    right: 10px;
    color: var(--color-dark-blue);
    cursor: pointer;
}

.hidden1 {
    display: none !important;
}

.thesis-cards-container {
    display: flex;
    flex-wrap: wrap;      /* permet plusieurs lignes */
    gap: 20px;            /* espace entre les cartes */
    justify-content: flex-start;
    align-items: stretch;
}

.thesis-card {
    flex: 1 1 calc(25% - 40px); /* 25% de largeur moins gap (pour 4 cartes par ligne) */
    max-width: calc(25% - 40px);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    margin: 10px;
    border: 2px solid #278FE1;
    border-bottom-right-radius: 30px;
    overflow: hidden;
    font-family: var(--font-family);
}

.thesis-card-header {
    padding: 12px;
    color: white;
    background-color:#278FE1;
}

.thesis-card-body {
    display: flex;
    flex-direction: column;
    /* 2. Permettre au corps de remplir l'espace restant de la carte */
    flex-grow: 1;
    padding: 12px;
    background-color: white;
}

.thesis-card-body hr {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 10px 0;
}

/* 💥 Le contenu variable doit prendre le moins d'espace possible */
.thesis-variable-content {
    /* Laisser cet espace se contracter ou prendre la hauteur naturelle du contenu */
    flex-grow: 0;
}

/* 💥 Le pied de page doit être poussé vers le bas */
.thesis-fixed-footer {
    /* Pousser ce conteneur vers le bas en remplissant l'espace vide restant
       entre le contenu variable et ce footer. */
    margin-top: auto;
    /* OU, si vous voulez que le footer reste petit mais soit en bas: */
    /* flex-grow: 0; */
}

/* Si vous voulez que le corps entier (y compris le titre, hr) soit en haut
   et que SEUL le footer soit en bas, utilisez flex-grow: 1 sur un conteneur intermédiaire */
.thesis-card-body > div:first-child {
    /* Le contenu entre le header et le fixed-footer. Si vous mettez tout ici,
       il remplira l'espace et poussera le fixed-footer en bas. */
    flex-grow: 1;
    line-height: 1.5em;
}

.thesis-vignette img {
    display: block;
    width: 100%;
    object-fit: cover;
}

.thesis-dates {
    font-size: 18px;
    margin-bottom: 6px;
    color: white;
}

.thesis-department {
    margin-bottom: 8px;
    color: #278EE1;
    font-size: 0.95rem;
}

.thesis-duration, .thesis-person, .thesis-location {
    font-size: 1rem;
    margin-bottom: 6px;
    color: #278EE1;
}

.thesis-theme-title {
    font-size: 16px;
    font-weight: normal !important;
}

.thesis-theme-title > a {
    color: #092851;
}
.thesis-soutenant {
    font-size: 14px;
    color: #278EE1;
}

.thesis-soutenant > a {
    font-size: 14px;
    color: #278EE1;
}

@media (max-width: 768px) {

    .subjectlist-layout {
        width: 95% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .filters-container {
        display: block !important;
        width: 100% !important;
        padding: 15px;
        margin-bottom: 20px;
        box-sizing: border-box !important;
        background: #f9f9f9;
        border-radius: 8px;
        overflow: visible;
    }

    .filter-dropdown-container,
    .search-container,
    .filters-container label {
        display: block !important;
        width: 100% !important;
        margin-bottom: 12px !important;
        box-sizing: border-box !important;
    }

    .filter-btn,
    #searchInput {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .search-container {
        position: relative;
        padding: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .search-container .icon-search {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--color-dark-blue);
        pointer-events: none;
    }

    .filters-container label {
        display: flex !important;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        padding: 3px 0;
    }

    .thesis-cards-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px;
        width: 100% !important;
        padding: 0 !important;
    }

    .thesis-card {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        min-height: auto !important;
    }

    .thesis-card-body {
        padding: 15px !important;
    }

    .thesis-theme-title a {
        font-size: 14px !important;
        line-height: 1.35;
        display: block;
        margin-bottom: 10px;
    }

    .thesis-fixed-footer {
        font-size: 13px;
        line-height: 1.35;
    }

    .thesis-duration,
    .thesis-soutenant,
    .thesis-location,
    .thesis-person {
        margin-bottom: 8px;
    }

    .thesis-vignette img {
        border-radius: 0 !important;
        margin-top: 10px;
    }

    .blue-banner h2 {
        font-size: 16px !important;
        padding: 10px 15px;
        text-align: center;
        line-height: 1.25;
    }
}