/* VSD Espace client : se pose sur le thème VSD Photograph et reprend ses variables */

.ec [hidden] { display: none !important; }

.ec a:focus-visible,
.ec button:focus-visible,
.ec input:focus-visible {
  outline: 2px solid var(--red-hover);
  outline-offset: 3px;
}

/* Page du code */
.ec .field input.ec-code {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ec .field input.ec-code::placeholder {
  color: rgba(var(--paper-rgb), 0.22);
}

.ec-atouts {
  list-style: none;
  margin: 2.5rem 0 0;
  border-top: 1px solid rgba(var(--paper-rgb), 0.1);
}
.ec-atouts li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(var(--paper-rgb), 0.1);
}
.ec-atouts .ec-n {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--red);
}
.ec-atouts strong {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--paper);
}
.ec-atouts div span {
  color: var(--stone);
  font-size: 0.9rem;
}

.ec .legal-content .ec-actions { margin-top: 2rem; }

/* En-tête de la galerie */
.ec-apercu {
  background: rgba(180, 35, 24, 0.12);
  border: 1px solid var(--red);
  border-radius: 2px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--paper);
}
.ec-apercu a { color: var(--paper); margin-left: 0.5rem; }

.ec-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(var(--paper-rgb), 0.08);
}
.ec-tete .display-title {
  max-width: 18ch;
  text-wrap: balance;
}
.ec-infos {
  margin-top: 1rem;
  color: var(--stone);
  font-size: 0.9rem;
}

.ec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.ec-actions .btn small {
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.ec-zip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ec-zip-titre {
  width: 100%;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
}

/* Mot de Valentin */
.ec-mot {
  max-width: 52rem;
  margin: 0 0 3rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  color: var(--paper);
}
.ec-mot p + p { margin-top: 0.75rem; }
.ec-mot p:first-child::before { content: "\201C"; color: var(--red); margin-right: 0.08em; }
.ec-mot p:last-of-type::after { content: "\201D"; color: var(--red); margin-left: 0.04em; }
.ec-mot cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--ui);
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
}

/* Film */
.ec-film {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 3rem;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}
.ec-film iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ec-film-lien { margin-bottom: 3rem; }

/* Barre des filtres */
.ec-barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ec .ec-filtres {
  justify-content: flex-start;
  margin-bottom: 0;
}
.ec-barre .back { margin-bottom: 0; }

/* Grille en rangées justifiées : l'ordre de la galerie se lit de gauche à droite */
.ec-grille {
  --rang: 250px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ec-grille::after {
  content: "";
  flex-grow: 1000000;
}
.ec-grille .ec-photo {
  flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--rang));
  width: auto;
  margin: 0;
  cursor: default;
}
.ec-photo .ec-ouvrir {
  display: block;
  height: 100%;
}
.ec-photo .tile-media {
  display: block;
  height: 100%;
  aspect-ratio: var(--r);
  background: var(--bg-elevated);
}
/* Les photos du client s'affichent sans le filtre de contraste du portfolio */
.ec-photo .tile-media img,
.ec-photo:hover .tile-media img {
  height: 100%;
  object-fit: cover;
  filter: none;
}
.ec-photo:hover .tile-media img { transform: scale(1.025); }

.ec-photo-actions {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.ec-photo:hover .ec-photo-actions,
.ec-photo:focus-within .ec-photo-actions,
.ec-photo.is-fav .ec-photo-actions {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .ec-photo-actions { opacity: 1; transform: none; }
}

.ec-fav,
.ec-dl,
.ec-lb-fermer,
.ec-lb-nav {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(var(--paper-rgb), 0.18);
  border-radius: 2px;
  background: rgba(14, 14, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--paper);
  font-family: var(--ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ec-fav:hover,
.ec-dl:hover,
.ec-lb-fermer:hover,
.ec-lb-nav:hover { border-color: var(--paper); }
.ec-fav svg,
.ec-dl svg,
.ec-lb-nav svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ec-fav[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.ec-fav[aria-pressed="true"] svg { fill: currentColor; }

.ec-vide {
  padding: 3rem 0;
  color: var(--stone);
  text-align: center;
}
.ec-note {
  margin-top: 1.5rem;
  color: var(--stone);
  font-size: 0.8rem;
}
.ec-sortie { margin-top: 3rem; }

/* Visionneuse (reprend .lb du thème) */
.ec-lb {
  padding: 0;
  place-items: stretch;
  grid-template-columns: 4.5rem minmax(0, 1fr) 4.5rem;
  grid-template-rows: auto minmax(0, 1fr);
}
.ec-lb-haut {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}
.ec-lb-compteur {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
}
.ec-lb-outils {
  display: flex;
  gap: 0.5rem;
}
.ec-lb-fermer {
  font-size: 1.6rem;
  line-height: 1;
}
.ec-lb-nav {
  align-self: center;
  justify-self: center;
  width: 3rem;
  height: 3rem;
}
.ec-lb-cadre {
  display: grid;
  place-items: center;
  min-height: 0;
  padding-bottom: 1.5rem;
}
.ec-lb-img {
  max-width: 100%;
  max-height: calc(100vh - 6.5rem);
  max-height: calc(100dvh - 6.5rem);
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

@media (max-width: 599px) {
  /* Deux photos par rangée environ sur téléphone */
  .ec-grille { --rang: 100px; gap: 0.35rem; }
  .ec-lb { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .ec-lb-cadre { padding: 0 0.5rem 5rem; }
  .ec-lb-img { max-height: calc(100dvh - 10rem); }
  .ec-lb-nav { position: fixed; bottom: 1.25rem; }
  .ec-lb-prec { left: 1.25rem; }
  .ec-lb-suiv { right: 1.25rem; }
}

/* Message bref en bas de l'écran */
.ec-info {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 10001;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.25rem;
  border-radius: 2px;
  background: var(--paper);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.ec-info.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}
