/* =============================================================================
   Annuaire des enseignants ABEPY
   ============================================================================= */

/* Variables (alignées sur la page d'accueil — #edf1f8) */
:root {
    --annuaire-navy:    #1a2c64;
    --annuaire-accent:  #264d91;
    --annuaire-gray:    #6b7280;
    --annuaire-border:  rgba(26, 44, 100, .12);
    --annuaire-bg:      #edf1f8;
    --annuaire-paper:   #f7f9fd;
    --annuaire-white:   #ffffff;
    --annuaire-radius:  12px;
    --annuaire-shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --annuaire-shadow-hover: 0 4px 12px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.10);
    --annuaire-max-w:   1280px;
}

/* ------------------------------------------------------------------ */
/* HERO                                                                 */
/* ------------------------------------------------------------------ */

.annuaire-hero {
    position: relative;
    background-color: #edf1f8;
    background-size: cover;
    background-position: center;
    padding: 160px 24px 80px;
    overflow: visible;
}

.annuaire-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(237,241,248,0.92) 0%, rgba(237,241,248,0.75) 60%, rgba(237,241,248,0.50) 100%);
    pointer-events: none;
}

.annuaire-hero__content {
    position: relative;
    z-index: 2;
    max-width: var(--annuaire-max-w);
    margin: 0 auto;
    text-align: center;
    padding-bottom: 48px;
}

.annuaire-hero__title {
    font-family: 'Goudy Bookletter 1911', Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #1a2c64;
    margin-bottom: 20px;
}

.annuaire-hero__subtitle {
    font-size: 1rem;
    color: rgba(26, 44, 100, 0.70);
    max-width: 680px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* Barre de recherche hero */
.annuaire-search-bar {
    display: flex;
    gap: 0;
    max-width: 560px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--annuaire-shadow);
}

.annuaire-search-bar__input {
    flex: 1;
    height: 48px;
    padding: 0 20px;
    border: 1px solid var(--annuaire-border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: .95rem;
    outline: none;
    background: var(--annuaire-white);
    transition: border-color .2s;
}

.annuaire-search-bar__input:focus {
    border-color: var(--annuaire-accent);
}

.annuaire-search-bar__btn {
    height: 48px;
    padding: 0 24px;
    background: var(--annuaire-navy);
    color: var(--annuaire-white);
    font-size: .95rem;
    font-weight: 600;
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

.annuaire-search-bar__btn:hover {
    background: #243660;
}

.annuaire-hero__hint {
    margin-top: 14px;
    font-size: .85rem;
    color: var(--annuaire-gray);
}

/* Carte Leaflet dans le hero */
.annuaire-map-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
}

#annuaire-map {
    width: 100%;
    height: 500px;
    background: #c8d5e8;
}

/* ------------------------------------------------------------------ */
/* SECTION ANNUAIRE                                                     */
/* ------------------------------------------------------------------ */

.annuaire-section {
    background: var(--annuaire-bg);
    padding: 64px 24px 80px;
}

.annuaire-container {
    max-width: var(--annuaire-max-w);
    margin: 0 auto;
}

.annuaire-section__header {
    margin-bottom: 40px;
}

.annuaire-section__eyebrow {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--annuaire-gray);
    margin-bottom: 8px;
}

.annuaire-section__title {
    font-family: 'Goudy Bookletter 1911', Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 400;
    color: #1a2c64;
    margin: 0 0 10px;
}

.annuaire-section__subtitle {
    font-size: .95rem;
    color: var(--annuaire-gray);
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* FILTRES                                                              */
/* ------------------------------------------------------------------ */

.annuaire-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.annuaire-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.annuaire-filter-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--annuaire-gray);
    letter-spacing: .05em;
}

.annuaire-filter-select,
.annuaire-filter-input {
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--annuaire-border);
    border-radius: 8px;
    font-size: .9rem;
    background: var(--annuaire-white);
    color: #374151;
    outline: none;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.annuaire-filter-input {
    background-image: none;
    padding-right: 14px;
}

.annuaire-filter-select:focus,
.annuaire-filter-input:focus {
    border-color: var(--annuaire-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* Compteur */
.annuaire-count {
    font-size: .88rem;
    color: var(--annuaire-gray);
    margin-bottom: 24px;
}

#annuaire-count-number {
    font-weight: 700;
    color: #374151;
}

/* ------------------------------------------------------------------ */
/* GRILLE                                                               */
/* ------------------------------------------------------------------ */

.annuaire-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    min-height: 200px;
}

.annuaire-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--annuaire-gray);
    padding: 48px 0;
    font-size: 1rem;
}

/* ------------------------------------------------------------------ */
/* CARTE PROFESSEUR                                                     */
/* ------------------------------------------------------------------ */

.teacher-card {
    background: var(--annuaire-white);
    border-radius: var(--annuaire-radius);
    box-shadow: var(--annuaire-shadow);
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}

.teacher-card:hover {
    box-shadow: var(--annuaire-shadow-hover);
    transform: translateY(-3px);
}

.teacher-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Photo */
.teacher-card__photo-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--annuaire-radius) var(--annuaire-radius) 0 0;
    background: #f3f4f6;
}

.teacher-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.teacher-card:hover .teacher-card__photo {
    transform: scale(1.04);
}

.teacher-card__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

.teacher-card__photo--placeholder svg {
    width: 56px;
    height: 56px;
}

/* Badge certification */
.teacher-card__cert {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(26, 42, 74, .85);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: .06em;
    backdrop-filter: blur(4px);
}

/* Corps */
.teacher-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.teacher-card__name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.teacher-card__location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: var(--annuaire-gray);
    margin: 0;
}

.teacher-card__location-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #9ca3af;
}

/* Tags */
.teacher-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.teacher-tag {
    display: inline-block;
    background: var(--annuaire-paper);
    border: 1px solid var(--annuaire-border);
    color: #374151;
    font-size: .72rem;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: .02em;
}

/* Bio */
.teacher-card__bio {
    font-size: .82rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* Lien voir plus */
.teacher-card__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--annuaire-accent);
    margin-top: 4px;
    transition: color .2s;
}

.teacher-card:hover .teacher-card__more {
    color: #1d4ed8;
}

/* ------------------------------------------------------------------ */
/* LOADER                                                               */
/* ------------------------------------------------------------------ */

.annuaire-loader {
    display: none;
    text-align: center;
    padding: 40px 0;
}

.annuaire-loader.is-visible {
    display: block;
}

.annuaire-loader__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--annuaire-border);
    border-top-color: var(--annuaire-accent);
    border-radius: 50%;
    animation: annuaire-spin .7s linear infinite;
    display: inline-block;
}

@keyframes annuaire-spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ */
/* POPUP LEAFLET personnalisée                                          */
/* ------------------------------------------------------------------ */

.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: var(--annuaire-shadow-hover) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.map-popup {
    padding: 12px 16px;
    min-width: 160px;
}

.map-popup__name {
    font-weight: 700;
    font-size: .9rem;
    color: #111827;
    margin-bottom: 2px;
}

.map-popup__city {
    font-size: .8rem;
    color: var(--annuaire-gray);
    margin-bottom: 8px;
}

.map-popup__link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--annuaire-accent);
    text-decoration: none;
}

.map-popup__link:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 1199px) {
    .annuaire-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .annuaire-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .annuaire-hero {
        padding: 80px 16px 40px;
    }

    .annuaire-search-bar {
        flex-direction: column;
        border-radius: 10px;
    }

    .annuaire-search-bar__input {
        border-right: 1px solid var(--annuaire-border);
        border-bottom: none;
        border-radius: 10px 10px 0 0;
    }

    .annuaire-search-bar__btn {
        border-radius: 0 0 10px 10px;
        width: 100%;
    }

    #annuaire-map {
        height: 260px;
    }

    .annuaire-filters {
        grid-template-columns: 1fr;
    }

    .annuaire-grid {
        grid-template-columns: 1fr;
    }

    .annuaire-section {
        padding: 40px 16px 60px;
    }
}

/* ------------------------------------------------------------------ */
/* Marqueurs Leaflet (lieu de cours des enseignants)                   */
/* ------------------------------------------------------------------ */

.annuaire-map-marker {
    background: transparent;
    border: none;
}

.map-marker-dot {
    width: 22px;
    height: 22px;
    background-color: #d97706;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.map-marker-dot:hover {
    transform: scale(1.3);
}
