/* ============================================================
   Galerie & transferts — identité visuelle AudiovisuelPro
   Navy + encre, tags monospace façon référence d'outil,
   titres bold en majuscules.
   ============================================================ */

:root {
  --navy: #1e3f74;
  --navy-2: #142c52;
  --accent-light: #6f93c9;
  --paper: #f2f2f4;
  --paper-dim: #e2e2e6;
  --ink: #16171f;
  --muted: #5c5d68;
  --line: rgba(22, 23, 31, 0.14);
  --danger: #b3432f;
  --shadow: 0 24px 60px -32px rgba(22, 23, 31, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

a { color: inherit; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Fond quadrillé (écho du hero LeFabricole) ---------- */

.grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* ---------- Porte d'entrée (mot de passe) ---------- */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.gate-card {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.gate-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.gate-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--navy);
}

.gate-title {
  font-size: clamp(2.3rem, 7vw, 3.2rem);
  line-height: 1.05;
  color: var(--navy);
}

.gate-date {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gate-form {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate-input {
  font-family: var(--font);
  font-size: 1rem;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.02em;
}

.gate-input:focus {
  outline: none;
  border-color: var(--navy);
}

.gate-submit {
  padding: 15px 18px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.gate-submit:hover { background: var(--navy-2); }

.gate-error {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--danger);
  min-height: 1.2em;
}

.gate-footer {
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Galerie ---------- */

.gallery-page { display: none; }
.gallery-page.is-visible { display: block; }

.gallery-header {
  padding: 64px 6vw 40px;
  border-bottom: 1px solid var(--line);
}

.gallery-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--navy);
}

.gallery-title {
  margin-top: 16px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: var(--navy);
  line-height: 1;
}

.gallery-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  border-radius: 3px;
}

.gallery-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  padding: 13px 22px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-ghost {
  border: 1.5px solid var(--navy);
  color: var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }

.zip-progress {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  align-self: center;
}

.grid {
  padding: 40px 6vw 100px;
  column-count: 1;
  column-gap: 18px;
}

@media (min-width: 620px)  { .grid { column-count: 2; } }
@media (min-width: 980px)  { .grid { column-count: 3; } }
@media (min-width: 1400px) { .grid { column-count: 4; } }

.tile {
  break-inside: avoid;
  margin-bottom: 18px;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper-dim);
  box-shadow: var(--shadow);
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.5s ease;
}

.tile:hover img { transform: scale(1.02); }

.tile-index {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  background: var(--ink);
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tile:hover .tile-index { opacity: 1; }

.tile-download {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 3px;
  background: rgba(22, 23, 31, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.tile:hover .tile-download { opacity: 1; }
.tile-download:hover { background: var(--navy); color: #fff; }

.gallery-footer {
  padding: 40px 6vw 70px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Visionneuse plein écran ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22, 23, 31, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 5vh 4vw;
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-download {
  position: absolute;
  color: var(--paper);
  opacity: 0.75;
  transition: opacity 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-download:hover { opacity: 1; color: var(--accent-light); }

.lightbox-close { top: 24px; right: 28px; font-size: 1.6rem; }
.lightbox-download { top: 26px; right: 76px; font-size: 1.2rem; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); font-size: 2rem; padding: 12px; }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); font-size: 2rem; padding: 12px; }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  color: var(--paper);
  opacity: 0.6;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { display: none; }
}
