/* ==========================================================================
   Fiche bien (single.php, refonte étape 3) : mobile d'abord.
   Chargée seulement sur les fiches (functions.php). Le reste du site garde style.css.
   Note : le corps du site est à 10 px (62,5 %) ; les tailles ici sont en rem (16 px).
   ========================================================================== */

.fiche-bien {
	--fb-accent: #e20613;
	--fb-accent-fonce: #b6050f;
	--fb-encre: #2e2f31;
	--fb-encre-douce: #5d5f63;
	--fb-trait: #e3e3e1;
	--fb-fond-doux: #f5f5f4;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--fb-encre);
}
.fiche-bien h2 { font-size: 1.375rem; line-height: 1.3; margin: 0 0 .75rem; color: var(--fb-encre); text-align: left; }
.fiche-bien h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; color: var(--fb-encre); text-align: left; }
.fiche-bien p { margin: 0 0 .75rem; }
.fiche-bien a { color: var(--fb-accent); }

/* Fil d'Ariane */
.fb-ariane { font-size: .95rem; margin: .5rem 0 1rem; color: var(--fb-encre-douce); }
.fb-ariane a { color: var(--fb-encre-douce); }
.fb-ariane span[aria-current] { color: var(--fb-encre); }
.wrap .fb-ariane a.retour { font-size: .9rem; padding: 3px 12px; margin-right: 12px; }

/* En-tête */
.fb-entete { margin-bottom: 1.25rem; }
.fb-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; }
.fb-badge { font-size: .8rem; font-weight: 600; letter-spacing: .02em; padding: .15rem .6rem; border-radius: 3px; background: var(--fb-fond-doux); color: var(--fb-encre); }
.fb-badge--operation { background: var(--fb-accent); color: #fff; }
.fiche-bien .fb-titre { font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.2; font-weight: 700; margin: 0 0 .5rem; color: var(--fb-encre); text-align: left; max-width: none; text-wrap: balance; }
.fb-reperes { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .95rem; color: var(--fb-encre-douce); margin: 0; }

/* Grille : galerie, chiffres clés, contenu. Mobile : les trois l'un sous l'autre. */
.fb-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.fb-galerie, .fb-cles, .fb-contenu { min-width: 0; }

/* Galerie : défilement horizontal, une photo à la fois */
.fb-galerie { position: relative; background: var(--fb-fond-doux); }
.fb-galerie__piste { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fb-galerie__piste::-webkit-scrollbar { display: none; }
.fb-galerie__piste:focus-visible { outline: 3px solid var(--fb-accent); outline-offset: 2px; }
.fb-galerie__photo { flex: 0 0 100%; scroll-snap-align: start; margin: 0; aspect-ratio: 4 / 3; }
.fb-galerie__ouvrir { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.fb-galerie__photo img, .fb-galerie__vide { display: block; width: 100%; height: 100%; object-fit: cover; }
.fb-galerie__fleche { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--fb-encre); font-size: 2rem; line-height: 40px; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.fb-galerie__fleche--prec { left: 10px; }
.fb-galerie__fleche--suiv { right: 10px; }
.fb-galerie__fleche:focus-visible { outline: 3px solid var(--fb-accent); }
.fb-galerie__compteur { position: absolute; right: 10px; bottom: 10px; margin: 0; padding: .1rem .55rem; border-radius: 3px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Visionneuse plein écran */
.fb-visionneuse { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .92); }
.fb-visionneuse::backdrop { background: rgba(0, 0, 0, .92); }
.fb-visionneuse[open] { display: flex; align-items: center; justify-content: center; }
.fb-visionneuse img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.fb-visionneuse__fermer { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; font-size: 1.8rem; line-height: 44px; cursor: pointer; }

/* Chiffres clés et contact */
.fb-cles { border: 1px solid var(--fb-trait); border-radius: 6px; padding: 1.1rem 1.2rem; background: #fff; }
.fb-cles__principal { margin: 0 0 .75rem; }
.fb-cles__principal span { display: block; font-size: .9rem; color: var(--fb-encre-douce); }
.fb-cles__principal strong { display: block; font-size: 1.75rem; line-height: 1.2; color: var(--fb-accent); font-variant-numeric: tabular-nums; }
.fb-cles__liste { margin: 0 0 1rem; }
.fb-cles__liste > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--fb-trait); }
.fb-cles__liste dt { color: var(--fb-encre-douce); }
.fb-cles__liste dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.fb-cles__actions { display: grid; gap: .5rem; }
.fb-cles__note { font-size: .85rem; color: var(--fb-encre-douce); margin: .6rem 0 0; }

.fb-bouton { display: block; padding: .75rem 1rem; border: 2px solid var(--fb-accent); border-radius: 30px; text-align: center; font-weight: 700; text-decoration: none; color: var(--fb-accent); background: #fff; }
.fb-bouton--plein { background: var(--fb-accent); color: #fff; }
.fiche-bien .fb-bouton--plein, .fb-barre .fb-bouton--plein { color: #fff; }
.fb-bouton:hover { background: var(--fb-accent-fonce); border-color: var(--fb-accent-fonce); color: #fff; }
.fb-bouton:focus-visible { outline: 3px solid var(--fb-encre); outline-offset: 2px; }

/* Blocs de contenu */
.fb-bloc { padding: 1.5rem 0; border-top: 1px solid var(--fb-trait); }
.fb-essentiel { border-top: 0; padding-top: 0; }
/* Même encadré gris que .wrap_page .encadrement-gris (style.css), texte à gauche car c'est un paragraphe */
.fiche-bien .encadrement-gris { background-color: #f0f0f0; padding: 15px; margin: 0; text-align: left; }
.fb-description p { max-width: 70ch; }
.fb-note { font-size: .9rem; color: var(--fb-encre-douce); }
.fb-lien { font-weight: 600; }

.fb-couts__colonnes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.fb-couts__colonne h3 { margin-top: 0; }
.fb-couts table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fb-couts th, .fb-couts td { padding: .45rem 0; border-bottom: 1px solid var(--fb-trait); text-align: left; font-weight: 400; }
.fb-couts td { text-align: right; font-weight: 600; }
.fb-couts__total th, .fb-couts__total td { font-weight: 700; border-bottom: 0; color: var(--fb-accent); }

.fb-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin: 0; background: var(--fb-trait); border: 1px solid var(--fb-trait); }
.fb-liste > div { background: #fff; padding: .6rem .8rem; }
.fb-liste dt { font-size: .85rem; color: var(--fb-encre-douce); }
.fb-liste dd { margin: .1rem 0 0; font-weight: 700; }

.fb-emplacement .bien-carte { margin: .75rem 0; min-height: 180px; }
.fb-emplacement .bien-carte__bouton { font-size: 1rem; }
.fiche-bien .bien-carte iframe { width: 100%; height: 330px; display: block; }

.fb-faq details { border-bottom: 1px solid var(--fb-trait); }
.fb-faq summary { cursor: pointer; padding: .75rem 0; font-weight: 600; }
.fb-faq summary:focus-visible { outline: 3px solid var(--fb-accent); }
.fb-faq details p { margin: 0 0 .9rem; color: var(--fb-encre-douce); }

/* Bien plus disponible (bien-retire.php) */
.fb-retire-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 0; }
.fb-retire-actions .fb-bouton { display: inline-block; }

/* Formulaire de contact : ancre sous l'en-tête */
.fb-contact { scroll-margin-top: 20px; }

/* Barre d'action : mobile seulement, fixée en bas de l'écran */
.fb-barre { display: none; }
@media (max-width: 767px) {
	.fb-barre {
		display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
		padding: .6rem max(16px, env(safe-area-inset-right, 0px)) calc(.6rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
		background: #fff; box-shadow: 0 -2px 10px rgba(0, 0, 0, .15);
		font-size: 1rem;
	}
	.fb-barre .fb-bouton { padding: .65rem .5rem; }
	body.single-bien { padding-bottom: 76px; }
	.fb-cles__actions { display: none; } /* remplacés par la barre */
	.fb-galerie__fleche { display: none; } /* le doigt suffit */
}

/* Ordinateur : galerie et contenu à gauche, chiffres clés collants à droite */
@media (min-width: 900px) {
	.fb-grille { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "galerie cles" "contenu cles"; column-gap: 2.5rem; }
	.fb-galerie { grid-area: galerie; }
	.fb-cles { grid-area: cles; position: sticky; top: 20px; }
	.fb-contenu { grid-area: contenu; }
	.fb-couts__colonnes { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
