/* ============================================
   Galerie de photos et fiche en fenêtre, pour le catalogue et histoire
   ============================================ */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.tile {
  display: flex; flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); }
.tile:hover img { transform: scale(1.06); }
.gallery .tile { animation: fadeIn 0.45s var(--ease) both; }
.gallery .tile:nth-child(2) { animation-delay: 30ms; }
.gallery .tile:nth-child(3) { animation-delay: 60ms; }
.gallery .tile:nth-child(4) { animation-delay: 90ms; }
.gallery .tile:nth-child(5) { animation-delay: 120ms; }
.gallery .tile:nth-child(n + 6) { animation-delay: 150ms; }
.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--bg-2);
  transition: transform 0.5s var(--ease);
}
.tile .tile-body { padding: 12px 14px 14px; }
.tile .tile-name { font-weight: 800; font-size: 0.98rem; margin-bottom: 3px; }
.tile .tile-role { color: var(--text-dim); font-size: 0.84rem; line-height: 1.4; }

/* Fiche en fenêtre */
.sheet {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.sheet::backdrop { background: rgba(var(--bg-rgb), 0.85); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in 0.28s var(--ease) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.sheet .photo { display: block; width: 100%; max-height: 56vh; object-fit: contain; background: var(--bg-2); }
.sheet .body { padding: 20px 24px 24px; }
.sheet h2 { font-size: 1.35rem; margin-bottom: 2px; padding-right: 44px; }
.sheet .role { color: var(--accent); font-weight: 700; font-size: 0.92rem; margin-bottom: 12px; }
.sheet .desc { font-size: 0.97rem; margin-bottom: 16px; }
.sheet .facts { display: grid; gap: 10px; margin-bottom: 16px; }
.sheet .fact {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 0.92rem;
}
.sheet .fact b { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 3px; }
.sheet .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet a.btn { text-decoration: none; }
.sheet .credit { font-size: 0.76rem; color: var(--text-dim); }
.sheet .credit a { color: var(--text-dim); }
.sheet .close {
  position: sticky; top: 10px;
  float: right;
  display: grid; place-items: center;
  margin: 10px 10px -54px 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(var(--bg-rgb),0.85);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
}
