/* Le bouton couvre la photo de la fiche en laissant le sélecteur photo/courbe au premier plan. */
[data-community-gallery] .replica-card-photo { position: relative; }
.community-photo-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: .6rem;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.community-photo-trigger span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #536044;
  padding: .34rem .5rem;
  background: #10150e;
  color: #e9ecdd;
  font: 600 .68rem/1.1 var(--font-mono, monospace);
}
.community-photo-trigger b { font-size: 1.1rem; line-height: 1; color: #a8ff3f; }
.community-photo-trigger:is(:hover, :focus-visible) span { border-color: #a8ff3f; }
.community-photo-trigger:focus-visible { outline: 2px solid #a8ff3f; outline-offset: -3px; }
.replica-card-track.show-curve .community-photo-trigger { visibility: hidden; }

.community-photo-viewer:not([open]), .community-photo-viewer [hidden] { display: none; }
html:has(.community-photo-viewer[open]) { overflow: hidden; }
.community-photo-viewer {
  box-sizing: border-box;
  width: min(68rem, calc(100% - 2rem));
  max-width: none;
  max-height: 94vh;
  max-height: 94dvh;
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #536044;
  background: #0e120d;
  color: #e9ecdd;
  box-shadow: 0 2rem 6rem #000a;
}
.community-photo-viewer::backdrop { background: rgb(5 8 5 / .88); }
.community-photo-layout { position: relative; }
.community-photo-close { position: absolute; top: .65rem; right: .65rem; margin: 0; z-index: 1; }
.community-photo-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0 .85rem;
  border: 1px solid #647052;
  color: #e9ecdd;
  background: #151a12;
  font: 600 .77rem/1.1 var(--font-mono, monospace);
  cursor: pointer;
}
.community-photo-viewer button:hover { border-color: #a8ff3f; }
.community-photo-viewer button:focus-visible { outline: 2px solid #a8ff3f; outline-offset: 3px; }
.community-photo-close span { font-size: 1.25rem; line-height: 1; }
.community-photo-stage {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  height: min(65vh, 38rem);
  height: min(65dvh, 38rem);
  padding: 3.8rem clamp(.8rem, 3vw, 2rem) 1rem;
  background: radial-gradient(ellipse at 57% 77%, #59604b 0, #3b4434 34%, transparent 74%),
    linear-gradient(125deg, #283025, #1c231b 55%, #151b14);
}
.community-photo-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.community-photo-stage p { margin: 0; color: #e9ecdd; }
.community-photo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid #404a35;
  padding: clamp(.85rem, 2.4vw, 1.5rem);
}
.community-photo-caption { flex: 1 1 12rem; min-width: 0; }
.community-photo-viewer .community-photo-caption h2 { margin: 0; color: #e9ecdd; font: 800 clamp(1.45rem, 3.5vw, 2.65rem)/1.06 var(--font-display, Saira, sans-serif); text-transform: uppercase; overflow-wrap: anywhere; }
.community-photo-caption p { margin: .35rem 0 0; color: #bdd495; font: .85rem/1.4 var(--font-mono, monospace); overflow-wrap: anywhere; }
.community-photo-controls { display: flex; align-items: center; gap: .7rem; }
.community-photo-controls span { font: .75rem/1 var(--font-mono, monospace); color: #e9ecdd; white-space: nowrap; }
.community-photo-controls button { font: 1.3rem/1 sans-serif; padding: 0; }
@media (max-width: 520px) {
  .community-photo-viewer { width: calc(100% - 1rem); }
  .community-photo-stage { height: clamp(12rem, min(78vw, 50vh), 23rem); height: clamp(12rem, min(78vw, 50dvh), 23rem); }
  .community-photo-controls { gap: .44rem; }
}
