@font-face {
  font-family: 'Epilogue';
  src: url('../Ressources/Font/Epilogue-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}

:root{
  --bg-dark:#000;
  --text:#fff;

  --glass: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.10);
  --shadow: 0 18px 40px rgba(0,0,0,0.45);

  --page-x: clamp(16px, 3vw, 56px);
  --max-width: 1200px;

  --grad: linear-gradient(135deg,
    rgba(70,72,255,0.95),
    rgba(255,114,98,0.85),
    rgba(255,174,165,0.65)
  );
}

*{ margin:0; padding:0; box-sizing:border-box; }

html, body{
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Epilogue', sans-serif;
  line-height: 1.6;
}

a{ color: inherit; text-decoration: none; }

/* Page wrapper (comme skills-page) */
.gallery-page{
  min-height: 100vh;
  position: relative;
  padding-inline: var(--page-x);
}

.gallery-page::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(70,72,255,0.18), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255,114,98,0.14), transparent 45%),
    radial-gradient(circle at 55% 85%, rgba(255,174,165,0.12), transparent 50%),
    linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,1));
}

.gallery-page > *{ position: relative; z-index: 1; }

.container{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 !important;
}

/* Hero */
.gallery-hero{
  padding: 3.5rem 0 1.25rem 0;
}

.gallery-hero h1{
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle{
  margin-top: 0.8rem;
  color: rgba(255,255,255,0.78);
  max-width: 70ch;
}

.hero-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.actions{
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Glass card */
.glass-card{
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Form */
.gallery-content{
  padding: 1.5rem 0 4rem 0;
}

.form-card{
  max-width: 560px;
}

.access-form{
  display: grid;
  gap: 0.75rem;
}

.access-form label{
  font-weight: 800;
  color: rgba(255,255,255,0.80);
}

.access-form input{
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
}

.access-form input:focus{
  outline: none;
  border-color: rgba(255,114,98,0.55);
  background: rgba(255,255,255,0.08);
}

.form-error{
  color: rgba(255,114,98,0.95);
  font-weight: 700;
}

.form-note{
  margin-top: 0.25rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.btn:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.09);
}

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

.btn-ghost{
  background: rgba(255,255,255,0.05);
}

.btn-glass-primary{
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(255,255,255,0.10), rgba(255,255,255,0.04)) padding-box,
    radial-gradient(circle at 20% 30%, rgba(70,72,255,0.28), transparent 58%) padding-box,
    radial-gradient(circle at 80% 45%, rgba(255,114,98,0.22), transparent 62%) padding-box,
    linear-gradient(135deg,
      rgba(70,72,255,0.95),
      rgba(255,114,98,0.80),
      rgba(255,174,165,0.60)
    ) border-box;
  background-origin: border-box;
  background-clip: padding-box, padding-box, padding-box, border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.btn-glass-primary:hover{
  transform: translateY(-2px);
}

/* =========================================================
   ✅ Pinterest / Masonry layout (multi-columns)
   - Fini le aspect-ratio fixe
   - Portrait/paysage -> hauteur naturelle
   ========================================================= */
.photos-grid{
  /* Pinterest feel */
  column-count: 3;
  column-gap: 1.25rem;
}

/* Chaque carte doit rester entière dans une colonne */
.photo-card{
  display: inline-block;       /* requis pour columns */
  width: 100%;
  margin: 0 0 1.25rem;         /* espace vertical */
  break-inside: avoid;         /* évite la coupe */
  -webkit-column-break-inside: avoid;

  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

/* Hover léger (sans casser l’alignement masonry) */
.photo-card:hover{
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.075);
  transform: translateY(-4px);
}

/* L’image garde son ratio naturel */
.photo-card img{
  width: 100%;
  height: auto;           /* IMPORTANT */
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.photo-card:hover img{
  transform: scale(1.03);
  filter: brightness(1.02);
}

/* Overlay en bas (effet premium) */
.photo-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.photo-card:hover .photo-overlay{ opacity: 1; }

.photo-index{
  font-weight: 800;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.lightbox.open{ display: flex; }

.lb-image{
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 22px 60px rgba(0,0,0,0.6);
}

.lb-btn{
  position: absolute;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.lb-btn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.09);
}

.lb-close{ top: 18px; right: 18px; }
.lb-prev{ left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next{ right: 18px; top: 50%; transform: translateY(-50%); }

.lb-footer{
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,0.85);
}

/* Responsive : on ajuste le nombre de colonnes */
@media (max-width: 1024px){
  .photos-grid{ column-count: 2; }
}

@media (max-width: 640px){
  .hero-row{ flex-direction: column; }
  .actions{ justify-content: flex-start; }
  .photos-grid{ column-count: 1; }
}

/* Perf / accessibilité */
@media (max-width: 640px){
  .photo-card{
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 12px 26px rgba(0,0,0,0.45);
  }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
  .photo-card:hover{ transform: none; }
  .photo-card:hover img{ transform: none; }
}
