/* =========================================================
   Zone accueil : haut de page creme et recherche, bandeau des metiers,
   etapes, FAQ, appel aux centres ; puis resultats de la recherche (titre,
   carte, departement, fenetre de contact) et page 404.
   ========================================================= */

/* ---------- Haut de page ---------- */
.home-hero {
    overflow: hidden;
    background: var(--creme);
    color: var(--ink);
}

.home-hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
    align-items: end;
    padding-top: 72px;
}

.home-hero-content {
    align-self: center;
    padding-bottom: 96px;
}

.home-hero-title {
    margin-bottom: 2rem;
    font-size: clamp(2.4rem, 4.6vw, 3.6rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.home-hero-accent {
    color: var(--orange);
}

.home-hero-small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.62em;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.home-hero-visual {
    align-self: end;
}

.home-hero-visual img {
    display: block;
    width: 100%;
    max-width: 620px;
    height: auto;
    margin-left: auto;
}

/* ---------- Recherche ---------- */
.home-search {
    position: relative;
    max-width: 560px;
}

.home-search-input {
    padding: 1.1rem 4.25rem 1.1rem 1.5rem;
    border-color: transparent;
    font-size: 1rem;
}

.home-search-input:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.home-search-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: var(--pill);
    background: var(--orange);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.2s;
}

.home-search-btn:hover {
    background: var(--orange-hover);
}

/* La liste de suggestions est une <ul> : pas de puces ni de retrait. */
.autocomplete-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    list-style: none;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item[aria-selected="true"] {
    background: var(--creme);
}

.autocomplete-highlight {
    background: none;
    color: var(--orange);
    font-weight: 600;
}

.autocomplete-code {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.home-search-feedback .form-message {
    margin: 0.6rem 0 0 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.home-search-feedback .btn {
    margin-top: 0.75rem;
}

.home-search-noscript {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.home-search-noscript a {
    color: var(--orange);
}

.home-popular {
    margin-top: 1.5rem;
}

/* Libelle en petites capitales, au-dessus des puces. */
.home-popular-label {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.6;
}

.home-popular-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Puce : pilule blanche, loupe orange ; au survol, orange plein. */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem 0.55rem 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--pill);
    background: #ffffff;
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip .icon {
    color: var(--orange);
    font-size: 0.8rem;
    transition: color 0.2s;
}

.chip:hover,
.chip:focus-visible {
    border-color: var(--orange);
    background: var(--orange);
    color: #ffffff;
}

.chip:hover .icon,
.chip:focus-visible .icon {
    color: #ffffff;
}

/* ---------- Bandeau des metiers ---------- */
.home-professions {
    overflow: hidden;
    padding: 80px 0;
    background: var(--noir);
    color: #ffffff;
}

/* Fondu a gauche et a droite ; deux pistes identiques par rangee font une
   boucle sans couture, la seconde etant cachee aux lecteurs d'ecran. */
.marquee {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.marquee-row {
    display: flex;
    overflow: hidden;
    padding: 14px 0;
}

.marquee-track {
    display: flex;
    flex-shrink: 0;
    gap: 40px;
    width: max-content;
    margin: 0;
    padding: 0 40px 0 0;
    list-style: none;
    animation: marquee 60s linear infinite;
}

.marquee-row--reverse .marquee-track {
    animation-name: marquee-reverse;
}

.marquee-row--slow .marquee-track {
    animation-duration: 75s;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
    animation-play-state: paused;
}

.prof {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.prof::before {
    content: "";
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: url("../img/pastille.png") center / cover no-repeat;
}

.prof button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
    cursor: pointer;
}

.prof:nth-child(even) {
    color: var(--orange);
}

@keyframes marquee {
    to { transform: translateX(-100%); }
}

@keyframes marquee-reverse {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}

/* ---------- FAQ, appel aux centres ---------- */
.home-section {
    padding: 88px 0;
}

.home-section-title {
    margin-bottom: 0.75rem;
    color: var(--ink);
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-align: center;
}

.home-faq {
    padding-top: 128px;
}

.home-faq-inner {
    max-width: 860px;
}

.home-faq .home-section-title {
    margin-bottom: 2rem;
}

.home-cta {
    padding-bottom: 88px;
}

/* ---------- Accueil : responsive ---------- */
@media (max-width: 960px) {
    .home-hero-grid {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 40px;
    }

    .home-hero-content {
        padding-bottom: 40px;
    }

    .home-hero-visual img {
        max-width: 520px;
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .home-hero-title {
        margin-bottom: 1.5rem;
        font-size: 2rem;
    }

    .home-popular-chips {
        gap: 0.4rem;
    }

    .chip {
        gap: 0.35rem;
        padding: 0.4rem 0.75rem 0.4rem 0.65rem;
        font-size: 0.78rem;
    }

    .chip .icon {
        font-size: 0.7rem;
    }

    .home-professions {
        padding: 56px 0;
    }

    .prof {
        gap: 10px;
        font-size: 1.1rem;
    }

    .prof::before {
        width: 26px;
        height: 26px;
    }

    .marquee-track {
        gap: 28px;
        padding-right: 28px;
    }

    .home-section {
        padding: 64px 0;
    }

    .home-faq {
        padding-top: 88px;
    }
}

/* ---------- Resultats de la recherche ---------- */
/* La section ne prend de la place qu'une fois une recherche lancee. */
.home-results:has(.search-results-list:not([hidden]), .search-results:not([hidden])) {
    padding: 72px 0 88px;
    border-bottom: 1px solid var(--line);
}

/* Plusieurs titres correspondent : on en choisit un. */
.results-count {
    margin-bottom: 1.25rem;
    color: var(--muted);
}

.result-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.result-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.result-card:hover,
.result-card:focus-visible {
    border-color: var(--orange);
    background: var(--creme);
}

.result-card-intitule {
    font-weight: 600;
    line-height: 1.3;
}

.result-card-code {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Titre choisi */
.selected-titre-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.selected-titre-title {
    color: var(--ink);
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.selected-titre-code {
    padding: 0.3rem 0.8rem;
    border-radius: var(--pill);
    background: var(--creme);
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
}

.france-summary {
    margin: 0.75rem 0 2rem;
    color: var(--muted);
}

/* Carte des departements : seul moyen de choisir un departement. Si elle ne
   se charge pas, des boutons la remplacent (`.dept-fallback`). */
.map-block {
    display: block;
}

.dept-fallback {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dept-fallback button {
    padding: 0.55rem 1rem;
    border: 1px solid var(--field-border);
    border-radius: var(--pill);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.dept-fallback button:hover,
.dept-fallback button[aria-pressed="true"] {
    border-color: var(--orange);
    color: var(--orange);
}

.france-map-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

/* Carte des departements (SVG de assets/img), sur fond blanc : la France en
   creme aux frontieres blanches tant qu'aucun titre n'est choisi ; ensuite,
   les departements qui ont un centre en orange, ceux qui n'en ont aucun en
   orange pale, le departement choisi en orange brule. */
.carte-departements {
    display: block;
    width: 100%;
    height: auto;
    max-height: 750px;
}

.carte-departements .departement {
    fill: var(--creme);
    stroke: #ffffff;
    stroke-width: 1.2;
    transition: fill 0.2s;
}

.carte-departements .departement.is-active {
    fill: var(--orange);
    cursor: pointer;
}

/* Orange a 22 % sur blanc, opaque : la teinte ne depend pas du fond. */
.carte-departements .departement.is-empty {
    fill: #ffd8c7;
}

/* Aucun anneau de focus du navigateur sur un departement : apres un clic, il
   encadrait le departement choisi. Le clavier garde son repere, porte par le
   trait (voir `:focus-visible` plus bas). */
.carte-departements .departement:focus {
    outline: none;
}

/* Survol et focus clavier eclaircissent l'orange : foncer le rapprocherait de
   l'orange brule du departement choisi. Le departement choisi ne change pas. */
.carte-departements .departement.is-active:not(.is-selected):hover,
.carte-departements .departement.is-active:not(.is-selected):focus-visible {
    fill: #ff7a40;
}

.carte-departements .departement.is-selected {
    fill: #a33000;
}

.carte-departements .departement.is-active:focus-visible {
    stroke: var(--ink);
    stroke-width: 2.5;
}

/* Cadres des encarts d'outre-mer, dessines dans le SVG de la carte. */
.carte-departements .encart {
    fill: none;
    stroke: var(--field-border);
    stroke-dasharray: 4 3;
}

.map-unavailable {
    padding: 2rem 1rem;
    color: var(--muted);
    text-align: center;
}

/* Centres du departement choisi */
.dept-results {
    margin-top: 2.5rem;
    scroll-margin-top: 24px;
}

.dept-results-title {
    margin-bottom: 1.25rem;
    color: var(--ink);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.centre-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.no-results-info-card {
    padding: 2rem;
    border-radius: var(--radius);
    background: var(--creme);
    color: var(--ink);
}

.no-results-info-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

/* ---------- Carte d'un centre ---------- */
/* Le lien du nom couvre toute la carte ; le bouton de contact reste au-dessus. */
.centre-result-row {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
        "logo info"
        "actions actions";
    gap: 1rem 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    transition: border-color 0.2s;
}

.centre-result-row:hover {
    border-color: var(--orange);
}

.centre-card-logo {
    grid-area: logo;
    width: 72px;
    height: 72px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    object-fit: contain;
}

.centre-card-logo.is-default-logo {
    padding: 18px;
    border-color: transparent;
    background: var(--creme);
}

.centre-info-main {
    grid-area: info;
    min-width: 0;
}

.centre-org-name {
    margin-bottom: 0.5rem;
    color: var(--ink);
    font-size: 1.1rem;
    line-height: 1.25;
}

.centre-link {
    color: inherit;
    text-decoration: none;
}

.centre-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.centre-link:focus-visible {
    outline: none;
}

.centre-link:focus-visible::after {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.centre-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.6rem;
    padding: 0;
    list-style: none;
}

.centre-badge {
    padding: 0.2rem 0.65rem;
    border-radius: var(--pill);
    background: var(--orange-soft);
    color: #A33200;
    font-size: 0.72rem;
    font-weight: 600;
}

.centre-badge--referenced {
    background: var(--orange);
    color: #ffffff;
}

.centre-badge--premium {
    background: #FFC43D;
    color: var(--noir);
}

.centre-detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.centre-detail-item .detail-icon {
    color: var(--orange);
}

.centre-actions {
    position: relative;
    z-index: 1;
    grid-area: actions;
}

.btn-contact-centre {
    width: 100%;
    padding: 0.75rem 1.2rem;
    border: 0;
    border-radius: var(--pill);
    background: var(--orange);
    color: #ffffff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-contact-centre:hover {
    background: var(--orange-hover);
}

/* ---------- Fenetre « Contacter le centre » ---------- */
#lead-status:not(:empty) {
    margin-bottom: 1rem;
}

.char-count.is-warning {
    color: #B45309;
    font-weight: 600;
}

.char-count.is-danger {
    color: var(--error);
    font-weight: 700;
}

@media (max-width: 860px) {
    .carte-departements {
        max-height: 500px;
    }

    .centre-results-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Sections editoriales de l'accueil ---------- */

/* ---------- Page 404 ---------- */

