/* Présentation choisie par Hanna (layout.js) : mise en page des fiches, bandeaux, portes, cadrage des images. */

/* image cadrée : point gardé au centre et zoom (propriété scale, indépendante des animations transform) */
.img--styled { object-position: var(--focus, 50% 50%); scale: var(--zoom, 1); }

/* photo de fiche dans un cadre : le zoom reste dans le cadre */
.card__frame { width: calc(100% + 32px); margin: -16px -16px 6px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-soft); }
.card__frame .card__photo { width: 100%; height: 100%; margin: 0; aspect-ratio: auto; }
.card__frame:has(.img--small) { aspect-ratio: 3 / 1; }
.card__frame:has(.img--large) { aspect-ratio: 4 / 5; }

/* fiches : grille, grandes photos, compactes */
/* grille : des tuiles photo + nom (2 lignes au plus, coupure aux espaces) ; toucher la tuile ouvre la fiche complète,
   où restent adresse, horaires et boutons (Itinéraire, Waze…). Sur téléphone, 2 colonnes de ~170 px ne les portent pas. */
.layout--grid .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.layout--grid .card { gap: 8px; padding: 0 0 12px; }
.layout--grid .card__frame { width: 100%; margin: 0; aspect-ratio: 4 / 3; }
.layout--grid .card__frame:has(.img--small) { aspect-ratio: 16 / 9; }
/* sans photo : une bande basse qui porte le cœur, pas un grand bloc vide */
.layout--grid .card:not(.card--photo)::before { content: ""; display: block; height: 60px; background: var(--caramel-soft); }
.layout--grid .card > :is(.card__eyebrows, .card__he, .card__addr, .card__quartier, .hours, .card__meta, .tags, .card__note, .tip, .phone-list, .card__actions) { display: none; }
.layout--grid .card > .card__title,
.layout--grid .card:not(.card--photo) > .card__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  padding: 0 12px; font-size: 1.02rem; line-height: 1.25; word-break: normal; hyphens: manual; overflow-wrap: break-word; /* coupe aux espaces ; dans un mot seulement s’il est plus large que la tuile */
}
.layout--grid .card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.layout--grid .card > :is(.edit-btn:not(.edit-btn--photo), .move, .notice) { position: relative; z-index: 2; margin-inline: 12px; }
.layout--grid .card > .move { gap: 6px; margin-top: 0; }
.layout--grid .card > .edit-btn--photo { top: 8px; inset-inline-start: 8px; width: 44px; padding: 0; justify-content: center; }
.layout--grid .card > .edit-btn--photo span { display: none; }
.layout--large .card__frame { aspect-ratio: 4 / 3; }
.layout--compact .card__frame { display: none; }
.layout--compact .card { gap: 4px; padding: 12px 14px; }

/* hauteur de la grande photo d'une rubrique */
.banner--small.page-head--immersive .banner { height: 38svh; min-height: 240px; }
.banner--medium.page-head--immersive .banner { height: 60svh; min-height: 320px; }
/* mode édition : outils + boutons « Modifier » en plus du titre ; un bandeau petit les empilait sur le titre */
.banner--small.page-head--immersive .banner:has(.banner__tools .edit-btn),
.banner--medium.page-head--immersive .banner:has(.banner__tools .edit-btn) { min-height: 500px; }

/* taille des portes de l'accueil */
.walk--small .walk__panel { min-height: min(34vh, 260px); }
.walk--large .walk__panel { min-height: min(82vh, 640px); }

/* panneau « Cadrer » */
.crop { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; cursor: crosshair; background: var(--surface-soft); }
.crop__img { width: 100%; height: 100%; object-fit: cover; }
.crop__dot {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 3px solid var(--white); border-radius: 50%; box-shadow: 0 0 0 2px rgb(0 0 0 / 45%); pointer-events: none;
}
.form__range { width: 100%; min-height: 44px; }

/* outils du bandeau en mode édition : côte à côte (sinon superposés) ; vide hors édition */
.banner__tools { position: absolute; z-index: 3; top: 64px; inset-inline-end: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: calc(100% - 24px); }
.banner__tools:empty { display: none; }
.banner__tools .edit-btn--photo { position: static; }
.card > .edit-btn--photo { position: absolute; top: 10px; inset-inline-start: 10px; }
