/* ============================================================
   TOKENS DE DESIGN
   ============================================================ */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #8a8a8a;
  --color-accent: #1f2a44;
  --color-border: #ececec;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", var(--font-main);

  --header-height: 72px;
  --content-max-width: 1100px;
  --feed-max-width: 1400px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

img {
  max-width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--content-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0; /* autorise le rétrécissement dans la flexbox */
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-icon {
  display: none;
  width: 22px;
  height: 22px;
}

.contact-btn {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--color-text);
  background: none;
  border: none;
  padding: 0.25rem 0;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.contact-btn:hover {
  color: var(--color-accent);
  opacity: 0.75;
}

.contact-btn:active {
  opacity: 0.5;
}

/* ============================================================
   FEED DE PHOTOS
   ============================================================ */
.feed-container {
  max-width: var(--feed-max-width);
  width: 100%;
  box-sizing: border-box;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.photo-feed {
  width: 100%;
  display: flex;
  gap: 1.75rem;
}

.feed-column {
  flex: 1 1 0;
  min-width: 0; /* empêche une colonne de forcer un débordement flexbox */
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

@media (min-width: 1000px) {
  .photo-feed,
  .feed-column {
    gap: 2rem;
  }
}

.photo-block {
  position: relative;
  margin: 0; /* réinitialise la marge par défaut du navigateur sur <figure> (40px gauche/droite !) */
  width: 100%;
  max-width: 100%;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.photo-block.visible {
  opacity: 1;
  transform: translateY(0);
}

.photo-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  contain: paint; /* empêche tout effet visuel (filter/blur) de déborder de la page */
  border-radius: 4px;
  background: #f4f4f4; /* couleur de fond pendant le chargement */
}

.photo-wrapper img {
  width: 100%;
  height: auto; /* conserve les proportions natives, paysage ou portrait */
  display: block;
  /* Empêche la sélection/glisser-déposer de l'image */
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* le clic est géré par l'overlay au-dessus */
}

/* Effet flou pendant le chargement de la vraie image (blur-up) */
.photo-wrapper img.loading {
  filter: blur(16px);
  transform: scale(1.03);
}

.photo-wrapper img.loaded {
  filter: blur(0);
  transform: scale(1);
  transition: filter 0.5s ease, transform 0.5s ease;
}

/* Overlay cliquable par-dessus l'image : reçoit les clics/tap
   (permet d'ouvrir la lightbox) tout en bloquant le clic-droit natif) */
.click-overlay {
  position: absolute;
  inset: 0;
  cursor: zoom-in;
  background: transparent;
}

.photo-legende {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.lightbox-nav:hover {
  color: #ffffff;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

@media (max-width: 640px) {
  .lightbox-nav {
    font-size: 2.5rem;
    padding: 0.5rem 0.5rem;
  }
}

/* ============================================================
   PAGE CONTACT
   ============================================================ */
.contact-page {
  max-width: 560px;
  margin: 5rem auto;
  padding: 0 1.5rem;
}

.contact-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.contact-subtitle {
  color: var(--color-muted);
  margin: 0 0 2.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-field textarea {
  resize: vertical;
}

.submit-btn {
  align-self: flex-start;
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  font-size: 0.9rem;
  margin: 0;
}

.form-message.success {
  color: #1a7a3c;
}

.form-message.error {
  color: #b3261e;
}

/* ============================================================
   RESPECT DES PRÉFÉRENCES DE MOUVEMENT RÉDUIT
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .photo-block {
    transition: none;
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .header-nav {
    gap: 1rem;
  }
  .btn-text {
    display: none;
  }
  .btn-icon {
    display: block;
  }
  .contact-btn {
    padding: 0.4rem;
  }
}
