/* =====================================================================
   CARTES PROJETS / RÉSIDENCES + FICHE RÉSIDENCE — v2.12.0
   ---------------------------------------------------------------------
   Gabarit : template-parts/project-card.php
   Utilisé par : archive des réalisations, archives de catégorie,
   catalogue « Nos projets ». Fiche résidence : single-project.php.
   ===================================================================== */

/* --- Grille --- */
.bgfi-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 8px;
}

@media (max-width: 1024px) {
  .bgfi-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}

@media (max-width: 640px) {
  .bgfi-cards { grid-template-columns: 1fr; gap: 20px; }
}

/* --- Carte (socle commun) --- */
.bgfi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(8, 56, 104, .08);
  color: inherit;
  text-decoration: none;
  transition: transform .35s ease, box-shadow .35s ease;
}

.bgfi-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(8, 56, 104, .16);
}

.bgfi-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream, #F7F4EF);
}

.bgfi-card--residence .bgfi-card__media { aspect-ratio: 3 / 2; }

.bgfi-card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.bgfi-card:hover .bgfi-card__media img { transform: scale(1.06); }

.bgfi-card__media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(0deg, rgba(4, 28, 52, .55), rgba(4, 28, 52, 0));
  pointer-events: none;
}

/* Catégorie (pastille en haut à gauche) */
.bgfi-card__cat {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  max-width: calc(100% - 32px);
  padding: 7px 13px;
  border-radius: 30px;
  background: rgba(255, 255, 255, .95);
  color: var(--navy, #083868);
  font-family: var(--body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Localisation (sur la photo, en bas à gauche) */
.bgfi-card__loc {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  color: #fff;
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.bgfi-card__loc i { margin-right: 4px; }

.bgfi-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 22px;
}

.bgfi-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.16rem !important;
  font-weight: 600 !important;
  line-height: 1.32;
  color: var(--navy, #083868);
}

.bgfi-card__title a { color: inherit; text-decoration: none; }
.bgfi-card__title a:hover { color: var(--sage, #6d7a52); }

.bgfi-card__text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  font-family: var(--body);
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text-2, #454545);
}

.bgfi-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border, rgba(8, 56, 104, .12));
}

/* Le pied ne colle jamais au texte. */
.bgfi-card--project .bgfi-card__text { margin-bottom: 18px; }

.bgfi-card__facts {
  display: flex;
  gap: 20px;
  font-family: var(--body);
  font-size: .76rem;
  color: var(--text-3, #6B6B6B);
}

.bgfi-card__facts b {
  display: block;
  margin-top: 2px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--navy, #083868);
}

.bgfi-card__more {
  font-family: var(--body);
  font-size: .86rem;
  font-weight: 600;
  color: var(--navy, #083868);
}

.bgfi-card__arrow {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--navy, #083868);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy, #083868);
  transition: background .35s, color .35s;
}

.bgfi-card:hover .bgfi-card__arrow {
  background: var(--navy, #083868);
  color: #fff;
}

/* --- Variante résidence --- */
.bgfi-card__price {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--navy, #083868);
  color: #fff;
  font-family: var(--body);
  line-height: 1.1;
}

.bgfi-card__price small {
  display: block;
  margin-bottom: 3px;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .75;
}

.bgfi-card__price b { font-size: 1.1rem; font-weight: 700; }
.bgfi-card__price em { font-style: normal; font-size: .72rem; opacity: .8; }

.bgfi-card__eyebrow {
  margin: 0 0 6px;
  font-family: var(--body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sage, #6d7a52);
}

.bgfi-card--residence .bgfi-card__title { margin-bottom: 4px; }

.bgfi-card__where {
  margin: 0 0 16px;
  font-family: var(--body);
  font-size: .82rem;
  color: var(--text-3, #6B6B6B);
}

.bgfi-card__specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border, rgba(8, 56, 104, .12));
  border-radius: 10px;
}

.bgfi-card__specs--1 { grid-template-columns: 1fr; }
.bgfi-card__specs--2 { grid-template-columns: repeat(2, 1fr); }
.bgfi-card__specs--3 { grid-template-columns: repeat(3, 1fr); }

.bgfi-card__specs li {
  padding: 11px 4px;
  text-align: center;
  border-left: 1px solid var(--border, rgba(8, 56, 104, .12));
  font-family: var(--body);
}

.bgfi-card__specs li:first-child { border-left: 0; }

.res-ico {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto 6px;
  fill: none;
  stroke: var(--sage, #6d7a52);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bgfi-card__specs b {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy, #083868);
}

.bgfi-card__specs span {
  font-size: .64rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3, #6B6B6B);
}

.bgfi-card__actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.bgfi-card__btn {
  flex: 1;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--sage, #6d7a52);
  background: var(--sage, #6d7a52);
  color: #fff !important;
  font-family: var(--body);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .3s, border-color .3s, color .3s;
}

.bgfi-card__btn:hover { background: var(--navy, #083868); border-color: var(--navy, #083868); }

.bgfi-card__btn--ghost {
  flex: 0 0 auto;
  padding: 11px 18px;
  background: transparent;
  border-color: var(--navy, #083868);
  color: var(--navy, #083868) !important;
}

.bgfi-card__btn--ghost:hover { background: var(--navy, #083868); color: #fff !important; }

.bgfi-card a:focus-visible,
a.bgfi-card:focus-visible {
  outline: 2px solid var(--sage, #6d7a52);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   FICHE RÉSIDENCE (page détail)
   --------------------------------------------------------------------- */
.res-panel {
  margin: 28px 0 32px;
  padding: 26px 28px;
  border-radius: 14px;
  background: var(--cream, #F7F4EF);
  border: 1px solid var(--border, rgba(8, 56, 104, .12));
}

.res-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.res-panel__type {
  margin: 0 0 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sage, #6d7a52);
}

.res-panel__price { margin: 0; color: var(--navy, #083868); line-height: 1.15; }
.res-panel__price small { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3, #6B6B6B); margin-bottom: 4px; }
.res-panel__price b { font-size: 1.9rem; font-weight: 700; }
.res-panel__price em { font-style: normal; font-size: .95rem; font-weight: 500; }

.res-panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 8px;
  background: var(--sage, #6d7a52);
  color: #fff !important;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .3s;
}

.res-panel__cta:hover { background: var(--navy, #083868); }

.res-panel__specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.res-panel__specs li {
  padding: 14px 8px;
  text-align: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border, rgba(8, 56, 104, .12));
}

.res-panel__specs .res-ico { width: 24px; height: 24px; margin-bottom: 8px; }
.res-panel__specs b { display: block; font-size: 1.15rem; color: var(--navy, #083868); }
.res-panel__specs span { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3, #6B6B6B); }

.res-panel__sub {
  margin: 24px 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy, #083868);
}

.res-panel__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .92rem;
  color: var(--text-2, #454545);
}

.res-panel__features i { color: var(--sage, #6d7a52); margin-right: 6px; }

@media (max-width: 640px) {
  .res-panel { padding: 20px 18px; }
  .res-panel__price b { font-size: 1.5rem; }
  .res-panel__cta { width: 100%; justify-content: center; }
  .res-panel__features { grid-template-columns: 1fr; }
  .bgfi-card__body { padding: 20px; }
}

/* Les règles de paragraphe des pages (couleur, marges) ne doivent pas
   s'appliquer aux textes des cartes et de la fiche résidence. */
.bgfi-card p.bgfi-card__eyebrow, .res-panel p.res-panel__type { color: var(--sage, #6d7a52) !important; }
.bgfi-card p.bgfi-card__where { color: var(--text-3, #6B6B6B) !important; }
.res-panel p.res-panel__price { color: var(--navy, #083868) !important; }
.res-panel p.res-panel__price small { color: var(--text-3, #6B6B6B) !important; }

/* Sans ligne « programme · lieu », on garde de l’air sous le titre. */
.bgfi-card--residence .bgfi-card__title + .bgfi-card__specs { margin-top: 12px; }

/* Cartes étroites (mobile) : boutons empilés, pleine largeur. */
@media (max-width: 480px) {
  .bgfi-card__actions { flex-direction: column; }
  .bgfi-card__btn, .bgfi-card__btn--ghost { flex: 1 1 auto; width: 100%; white-space: normal; }
}
.bgfi-card__actions { flex-wrap: wrap; }

/* Pied « Voir la résidence » : lien sur toute la largeur, même style que
   la carte projet. */
a.bgfi-card__foot--link { color: inherit; text-decoration: none; }
.bgfi-card--residence .bgfi-card__foot { margin-top: auto; }

.res-panel p.res-panel__rooms { margin: 0; font-size: .92rem; line-height: 1.7; color: var(--text-2, #454545) !important; }

/* =====================================================================
   v2.13 — ÉTIQUETTE « PLAQUETTE » SUR LA PHOTO + FILTRE
   ===================================================================== */

/* Étiquette sous le titre (style plaquette : fond marine, angle arrondi). */
.bgfi-card__tag {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 6px 28px;
  border-radius: 12px 0 12px 0; /* forme plaquette : haut-gauche et bas-droit arrondis */
  text-align: center;
  background: var(--navy, #083868);
  color: #fff;
  font-family: var(--body);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
}

.bgfi-card--project .bgfi-card__title { margin-bottom: 8px; }
.bgfi-card--residence .bgfi-card__title { margin-bottom: 8px; }
.bgfi-card--residence .bgfi-card__tag { margin-bottom: 8px; }

/* --- Filtre par catégorie --- */
.bgfi-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 34px;
}

.bgfi-filter__btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--border, rgba(8, 56, 104, .18));
  border-radius: 30px;
  background: #fff;
  color: var(--navy, #083868);
  font-family: var(--body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s;
}

.bgfi-filter__btn span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(8, 56, 104, .08);
  font-size: .72rem;
  letter-spacing: 0;
}

.bgfi-filter__btn:hover { border-color: var(--navy, #083868); }

.bgfi-filter__btn.is-active {
  background: var(--navy, #083868);
  border-color: var(--navy, #083868);
  color: #fff;
}

.bgfi-filter__btn.is-active span { background: rgba(255, 255, 255, .2); }

.bgfi-filter__btn:focus-visible { outline: 2px solid var(--sage, #6d7a52); outline-offset: 3px; }

.bgfi-cards .bgfi-card[hidden] { display: none !important; }

.bgfi-cards .bgfi-card.is-filtered-in { animation: bgfi-card-in .35s ease both; }

@keyframes bgfi-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.bgfi-filter__empty { text-align: center; color: var(--text-3, #6B6B6B); }

@media (prefers-reduced-motion: reduce) {
  .bgfi-cards .bgfi-card.is-filtered-in { animation: none; }
}

/* ---------------------------------------------------------------------
   ÉTIQUETTE SOUS LE TITRE — page détail (bannière, article, projets liés)
   --------------------------------------------------------------------- */
.bgfi-tag {
  display: inline-block;
  max-width: 100%;
  padding: 7px 32px;
  border-radius: 14px 0 14px 0; /* forme plaquette : haut-gauche et bas-droit arrondis */
  text-align: center;
  background: var(--navy, #083868);
  color: #fff;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Bannière : titre, puis étiquette blanche sur sa propre ligne (centrée),
   puis fil d'Ariane en dessous. */
.page-hero .bgfi-hero-tag {
  display: flex;
  justify-content: center;
  margin: 2px 0 22px;
}

.page-hero .bgfi-tag--hero {
  margin: 0;
  padding: 8px 40px;
  border-radius: 16px 0 16px 0;
  background: #fff;
  color: var(--navy, #083868);
  font-size: 1rem;
  letter-spacing: .01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

p.bgfi-tag-line { margin: -6px 0 22px; }

.bgfi-tag--sm {
  margin-top: 4px;
  padding: 3px 16px;
  border-radius: 8px 0 8px 0;
  font-size: .72rem;
}
