/**
 * accueil.css — page d'accueil index.html (style Éditorial, jetons de editorial.css) :
 * haut de page à deux entrées, bandes meublé / longue durée, étapes, bloc agences, FAQ.
 * L'entrée affichée suit html[data-entree] (posé dans le <head> puis par accueil.js).
 */

/* ---------- Bandeau défilant (bandeau-accueil.js) ---------- */
.h-bandeau {
    height: 0; overflow: hidden; background: var(--encre); color: var(--ivoire);
    font-size: 13px; transition: height 260ms var(--ease-out);
}
.h-bandeau.is-ouvert { height: 38px; }
.h-bandeau:focus-visible { outline: 2px solid var(--laiton); outline-offset: -2px; }
.h-bandeau-piste { display: flex; width: max-content; height: 38px; animation: h-bandeau-defile var(--duree, 40s) linear infinite; }
.h-bandeau:hover .h-bandeau-piste,
.h-bandeau:active .h-bandeau-piste,
.h-bandeau:focus-within .h-bandeau-piste { animation-play-state: paused; }
.h-bandeau-serie { display: flex; flex: none; align-items: center; justify-content: space-around; gap: 56px; min-width: 100vw; padding-right: 56px; white-space: nowrap; }
.h-bandeau-item { color: inherit; }
a.h-bandeau-item { text-underline-offset: 3px; text-decoration-color: rgba(244, 241, 234, 0.4); }
.h-bandeau-item b { color: #C2A06B; font-weight: 600; }
@keyframes h-bandeau-defile { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .h-bandeau { overflow-x: auto; }
    .h-bandeau-piste { animation: none; }
    .h-bandeau-serie[aria-hidden="true"] { display: none; }
}

/* ---------- 1. Haut de page ---------- */
.h-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: min(calc(100svh - 69px), 820px);
    border-bottom: 1px solid var(--sable);
}
/* Bandeau ouvert : le haut de page garde la même limite basse à l'écran. */
@media (min-width: 901px) {
    .h-bandeau.is-ouvert + .h-hero { min-height: min(calc(100svh - 107px), 782px); }
}
.h-texte {
    display: flex; flex-direction: column;
    padding: clamp(32px, 6vh, 72px) clamp(24px, 4vw, 64px) 48px max(32px, calc((100vw - 1240px) / 2 + 32px));
}

.h-switch { display: inline-flex; align-self: flex-start; border: 1px solid var(--encre); border-radius: 4px; overflow: hidden; }
.h-switch button {
    border: 0; background: transparent; padding: 10px 16px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--encre);
    transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.h-switch button + button { border-left: 1px solid var(--encre); }
.h-switch button[aria-selected="true"] { background: var(--encre); color: var(--ivoire); }
@media (hover: hover) { .h-switch button[aria-selected="false"]:hover { background: var(--ivoire-2); } }

.h-bloc { display: grid; flex: 1; margin-top: clamp(32px, 6vh, 64px); }
.h-panneau {
    grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0;
    transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), visibility 0s linear 0s;
}
html:not([data-entree="agence"]) .h-panneau[data-pour="agence"],
html[data-entree="agence"] .h-panneau[data-pour="logement"] {
    opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none;
    transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s linear 180ms;
}
.h-titre { margin: 14px 0 20px; max-width: 15ch; }
.h-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.h-recherche {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 22px;
    margin-top: auto; padding-top: 18px; border-top: 1px solid var(--encre);
}
.h-panneau[data-pour="logement"] .ed-lead { margin-bottom: 40px; }
.h-modes { display: flex; gap: 18px; grid-column: 1 / -1; }
.h-modes button {
    border: 0; background: transparent; padding: 0 0 8px; cursor: pointer; white-space: nowrap;
    font-size: 14px; color: var(--gris-texte); box-shadow: inset 0 -2px 0 transparent;
    transition: color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.h-modes button[aria-pressed="true"] { color: var(--encre); font-weight: 700; box-shadow: inset 0 -2px 0 var(--encre); }
.h-texte-champ {
    min-width: 0; border: 0; border-bottom: 1px solid #C9C2B4; background: transparent;
    padding: 8px 0; font-size: 16px; color: var(--encre); border-radius: 0;
    transition: border-color 180ms var(--ease-out);
}
.h-texte-champ:focus { outline: none; border-bottom-color: var(--encre); }
.h-texte-champ::placeholder { color: var(--gris-doux); }
.h-type-champ { cursor: pointer; }
.h-recherche.is-vente { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.h-visuel { position: relative; overflow: hidden; background: var(--encre); min-height: 420px; }
.h-visuel figure { position: absolute; inset: 0; margin: 0; transition: opacity 320ms var(--ease-out), visibility 0s linear 0s; }
html[data-entree="agence"] .h-visuel .h-photo,
html:not([data-entree="agence"]) .h-visuel .h-ecran {
    opacity: 0; visibility: hidden;
    transition: opacity 220ms ease-out, visibility 0s linear 220ms;
}
/* Teinte unie tant que la photo n'est pas chargée (accueil.js, poserPhoto). */
.h-visuel .h-photo { background: var(--ivoire-2); }
.h-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: 0; transition: opacity 280ms var(--ease-out); }
.h-photo.is-prete img, .h-photo .h-photo-repli { opacity: 1; }
.h-photo .h-photo-repli { position: absolute; inset: 0; }
.h-etiquette {
    position: absolute; left: 24px; bottom: 24px; max-width: calc(100% - 48px);
    display: grid; gap: 2px; padding: 12px 16px; border-radius: 2px;
    background: var(--ivoire); color: var(--encre); text-decoration: none; font-size: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    transition: transform 200ms var(--ease-out);
}
.h-etiquette b { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
.h-etiquette small { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--gris-doux); }
@media (hover: hover) { .h-etiquette:hover { transform: translateY(-2px); } }
.h-visuel .h-ecran { padding: 24px; }
.h-visuel .tel-cadre { max-width: 720px; }

/* ---------- 2 et 3. Bandes d'annonces ---------- */
.h-bande { padding-bottom: 72px; }
.h-bande + .h-bande { border-top: 1px solid var(--sable); }
.h-bande-actions { display: flex; align-items: center; gap: 24px; }
.h-fleches { display: flex; gap: 8px; }
.h-fleches.is-inutile { display: none; }
.h-fleche {
    width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--encre); border-radius: 4px; background: transparent; color: var(--encre);
    transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), opacity 180ms var(--ease-out);
}
.h-fleche:disabled { opacity: 0.25; cursor: default; }
@media (hover: hover) { .h-fleche:not(:disabled):hover { background: var(--encre); color: var(--ivoire); } }

.h-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, calc((min(100vw, 1240px) - 64px - 72px) / 4.35));
    gap: 24px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    --marge: max(32px, calc((100vw - 1240px) / 2 + 32px));
    padding: 4px var(--marge) 8px; scroll-padding-left: var(--marge);
}
.h-rail::-webkit-scrollbar { display: none; }
.h-rail > * { scroll-snap-align: start; }
.h-rail:focus-visible { outline: 2px solid var(--laiton); outline-offset: -2px; }

.h-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }

/* ---------- 4. Étapes ---------- */
.h-etapes { border-top: 1px solid var(--sable); }
.h-etapes-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.h-etapes-liste li { border-top: 1px solid var(--encre); padding-top: 20px; }
.h-num { font-family: var(--serif); font-size: 15px; color: var(--laiton); font-variant-numeric: lining-nums; }
.h-etapes-liste h3 { font-family: var(--serif); font-size: 30px; font-weight: 500; margin: 8px 0 8px; }
.h-etapes-liste p { margin: 0; color: var(--gris-texte); max-width: 34ch; }

/* ---------- 5. Pour les agences ---------- */
.h-agences { background: var(--encre); color: var(--ivoire); padding: 112px 0; }
.h-agences-grille { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.h-agences .ed-h2 { color: var(--ivoire); margin-top: 10px; }
.h-kick-clair { color: #C2A06B; }
.h-arguments { list-style: none; margin: 28px 0 0; padding: 0; }
.h-arguments li { padding: 16px 0; border-top: 1px solid rgba(244, 241, 234, 0.14); color: #CFC8BB; }
.h-arguments strong { display: block; color: var(--ivoire); font-weight: 600; margin-bottom: 2px; }
.h-agences figure { margin: 0; }

/* ---------- 6. FAQ ---------- */
.h-faq { border-top: 1px solid var(--sable); }
.h-faq-grille { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.h-faq-grille .ed-h2 { margin: 10px 0 16px; }
.h-faq-liste details { border-bottom: 1px solid var(--sable); }
.h-faq-liste details:first-child { border-top: 1px solid var(--sable); }
.h-faq-liste summary {
    list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 20px 0; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.25;
}
.h-faq-liste summary::-webkit-details-marker { display: none; }
.h-faq-liste summary::after {
    content: "+"; font-family: var(--sans); font-size: 22px; font-weight: 300; color: var(--laiton);
    transition: transform 200ms var(--ease-out); flex: none;
}
.h-faq-liste details[open] summary::after { transform: rotate(45deg); }
.h-faq-liste details p { margin: 0 0 22px; color: var(--gris-texte); max-width: 62ch; }

/* ---------- Tablettes et téléphones ---------- */
@media (max-width: 1000px) {
    .h-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h-agences-grille, .h-faq-grille { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 900px) {
    .h-hero { grid-template-columns: 1fr; min-height: 0; }
    .h-texte { padding: 32px 16px 36px; }
    .h-visuel { min-height: 0; height: min(78vw, 440px); }
    /* Une seule colonne : le panneau caché sort de la mise en page (pas de vide sous le texte). */
    html:not([data-entree="agence"]) .h-panneau[data-pour="agence"],
    html[data-entree="agence"] .h-panneau[data-pour="logement"] { display: none; }
    /* Entrée agence : hauteur de la vidéo 16:9 (720 px de large au plus), marges et bouton son. */
    html[data-entree="agence"] .h-visuel { height: calc(min(100vw - 48px, 720px) * 0.5625 + 118px); }
    .h-recherche { margin-top: 0; }
}
@media (max-width: 640px) {
    .h-switch { align-self: stretch; }
    .h-switch button { flex: 1; padding: 11px 8px; }
    .h-recherche, .h-recherche.is-vente { grid-template-columns: 1fr; gap: 14px; }
    .h-recherche .ed-btn { width: 100%; }
    .h-rail { grid-auto-columns: 74%; gap: 16px; --marge: 16px; }
    .h-bande-actions .h-fleches { display: none; }
    .h-grille { grid-template-columns: 1fr; }
    .h-etapes-liste { grid-template-columns: 1fr; gap: 24px; }
    .h-agences { padding: 72px 0; }
    .h-faq-liste summary { font-size: 20px; }
}
