/* ================================
   ALEXANDRE FERREIRA — v11
   ================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'TorreFarfan';
  src: url('../TorreFarfan_v2.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfbfb;
  --black: #111111;
  --grey: #999999;
  --font: 'TorreFarfan', Georgia, serif;
  --nav-h: 52px;
  --ref-h: 73vh;
  --ref-w: calc(var(--ref-h) * 4 / 3);
  --section-h: 88vh;
}

html, body {
  width: 100%; font-family: var(--font);
  font-weight: normal; background: var(--bg); color: var(--black);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ================================ NAV ================================ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: transparent;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.25s ease;
}
nav.with-bg { background: var(--bg); }
nav.hidden { transform: translateY(-100%); opacity: 0; }

/* Nom centré dans la colonne du milieu */
.nav-name {
  grid-column: 2;
  font-size: 17px;
  font-weight: normal;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  white-space: nowrap;
}

/* Liens à droite */
.nav-links {
  grid-column: 3;
  display: flex; align-items: center;
  justify-content: flex-end;
  gap: 20px; list-style: none;
}
.nav-links a {
  font-size: 13px; font-weight: normal;
  letter-spacing: 0.03em; color: var(--grey);
  text-transform: lowercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--black); }

/* Burger caché sur desktop */
.nav-burger { display: none; }
.nav-mobile-menu { display: none; }

/* ================================ INDEX / EDITIONS ================================ */
.works-page, .editions-page { padding-top: var(--nav-h); }

.photo-section {
  position: relative;
  height: var(--section-h);
  display: flex; align-items: center; justify-content: center;
  padding: 0 156px;
  user-select: none; -webkit-user-select: none;
}
.photo-section:last-child { margin-bottom: calc(var(--section-h) * 0.3); }

.slide-wrapper {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.75s ease;
}
.slide-wrapper.visible { opacity: 1; }

/* Hit-zone */
.hit-zone {
  position: relative;
  width: var(--ref-w); max-width: 88vw;
  height: var(--ref-h);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  overflow: hidden; /* contient les compositions 2x2 / 2x3 */
}
.hit-zone.not-clickable { cursor: default; }

/* Slide libre (1×3) : déborde de la hit-zone en largeur */
.slide.free {
  overflow: visible;
  width: auto;
  min-width: 100%;
}
.hit-zone:has(.slide.free.active) {
  overflow: visible;
}

/* Slides index */
.slide { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; }
.slide.active { display: flex; }

.slide.solo img {
  max-height: var(--ref-h); max-width: 100%;
  width: auto; height: auto; display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 1×2 (duo) : gap large, images libres ---- */
.slide-grid.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  /* Pas de hauteur fixe : s'adapte à l'image */
  align-items: center; justify-items: center;
  width: auto;
}
.slide-grid.duo img {
  max-height: calc(var(--ref-h) * 0.85);
  max-width: calc((var(--ref-w) - 48px) / 2);
  width: auto; height: auto;
  display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 1×3 (sans classe) : libres, comme avant ---- */
.slide-grid:not(.duo):not(.rows-2) {
  display: grid;
  gap: 8px;
  align-items: center; justify-items: center;
  width: 100%; height: 100%;
}
.slide-grid:not(.duo):not(.rows-2) img {
  max-height: var(--ref-h);
  max-width: 100%;
  width: auto; height: auto;
  display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 2×2 et 2×3 (rows-2) : flex, gap uniforme sur 4 côtés ---- */
.slide-grid.rows-2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: var(--ref-h);
  max-height: var(--ref-h);
  width: auto;
  overflow: hidden;
  align-items: stretch;
}

.slide-grid.rows-2 .grid-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.slide-grid.rows-2 .grid-row img {
  display: block;
  height: 100%;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}/* ================================
   ALEXANDRE FERREIRA — v11
   ================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'TorreFarfan';
  src: url('../TorreFarfan_v2.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfbfb;
  --black: #111111;
  --grey: #999999;
  --font: 'TorreFarfan', Georgia, serif;
  --nav-h: 52px;
  --ref-h: 73vh;
  --ref-w: calc(var(--ref-h) * 4 / 3);
  --section-h: 88vh;
}

html, body {
  width: 100%; font-family: var(--font);
  font-weight: normal; background: var(--bg); color: var(--black);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ================================ NAV ================================ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: transparent;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.25s ease;
}
nav.with-bg { background: var(--bg); }
nav.hidden { transform: translateY(-100%); opacity: 0; }

/* Nom centré dans la colonne du milieu */
.nav-name {
  grid-column: 2;
  font-size: 17px;
  font-weight: normal;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  white-space: nowrap;
}

/* Liens à droite */
.nav-links {
  grid-column: 3;
  display: flex; align-items: center;
  justify-content: flex-end;
  gap: 20px; list-style: none;
}
.nav-links a {
  font-size: 13px; font-weight: normal;
  letter-spacing: 0.03em; color: var(--grey);
  text-transform: lowercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--black); }

/* Burger caché sur desktop */
.nav-burger { display: none; }
.nav-mobile-menu { display: none; }

/* ================================ INDEX / EDITIONS ================================ */
.works-page, .editions-page { padding-top: var(--nav-h); }

.photo-section {
  position: relative;
  height: var(--section-h);
  display: flex; align-items: center; justify-content: center;
  padding: 0 156px;
  user-select: none; -webkit-user-select: none;
}
.photo-section:last-child { margin-bottom: calc(var(--section-h) * 0.3); }

.slide-wrapper {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.75s ease;
}
.slide-wrapper.visible { opacity: 1; }

/* Hit-zone */
.hit-zone {
  position: relative;
  width: var(--ref-w); max-width: 88vw;
  height: var(--ref-h);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  overflow: hidden; /* contient les compositions 2x2 / 2x3 */
}
.hit-zone.not-clickable { cursor: default; }

/* Slide libre (1×3) : déborde de la hit-zone en largeur */
.slide.free {
  overflow: visible;
  width: auto;
  min-width: 100%;
}
.hit-zone:has(.slide.free.active) {
  overflow: visible;
}

/* Slides index */
.slide { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; }
.slide.active { display: flex; }

.slide.solo img {
  max-height: var(--ref-h); max-width: 100%;
  width: auto; height: auto; display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 1×2 (duo) : gap large, images libres ---- */
.slide-grid.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  /* Pas de hauteur fixe : s'adapte à l'image */
  align-items: center; justify-items: center;
  width: auto;
}
.slide-grid.duo img {
  max-height: calc(var(--ref-h) * 0.85);
  max-width: calc((var(--ref-w) - 48px) / 2);
  width: auto; height: auto;
  display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 1×3 (sans classe) : libres, comme avant ---- */
.slide-grid:not(.duo):not(.rows-2) {
  display: grid;
  gap: 8px;
  align-items: center; justify-items: center;
  width: 100%; height: 100%;
}
.slide-grid:not(.duo):not(.rows-2) img {
  max-height: var(--ref-h);
  max-width: 100%;
  width: auto; height: auto;
  display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ---- Grilles 2×2 et 2×3 (rows-2) : gap uniforme sur les 4 côtés ---- */
/* Approche : conteneur flex colonne, 2 rangées flex, gap identique partout */
.slide-grid.rows-2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: var(--ref-h);
  max-height: var(--ref-h);
  width: auto;         /* largeur dictée par le contenu */
  overflow: hidden;
  align-items: center;
}

/* Chaque "rangée" dans la grille rows-2 est un groupe flex */
.slide-grid.rows-2 .grid-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex: 1;             /* chaque rangée prend la moitié de la hauteur */
  min-height: 0;
}

.slide-grid.rows-2 .grid-row img {
  display: block;
  height: 100%;
  width: auto;         /* largeur proportionnelle à la hauteur */
  object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}

/* ================================ CURSEUR CUSTOM ================================ */
#custom-cursor {
  position: fixed; pointer-events: none; z-index: 9999;
  display: none;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
}
#custom-cursor img { width: 100%; height: 100%; object-fit: contain; }

/* ================================ EDITIONS ================================ */
.edition-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.edition-slide.is-cover img {
  max-height: calc(var(--ref-h) * 0.667);
  max-width: calc(100% * 0.667);
}
.edition-slide img {
  max-height: var(--ref-h); max-width: 100%;
  width: auto; height: auto; display: block; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}
.edition-slide.pos-current { transform: translateX(0); }
.edition-slide.pos-right   { transform: translateX(110%); }
.edition-slide.pos-left    { transform: translateX(-110%); }
.edition-slide.no-transition { transition: none; }

.edition-info-wrapper {
  position: absolute;
  left: calc(50% + var(--ref-w) / 2 + 32px);
  bottom: calc(50% - var(--ref-h) / 2);
  font-size: 11px; font-weight: normal;
  letter-spacing: 0.06em; color: var(--grey);
  line-height: 2.2; white-space: nowrap;
  pointer-events: none; text-transform: lowercase;
}

/* ================================ ARCHIVE ================================ */
.archive-layout { display: flex; padding-top: var(--nav-h); min-height: 100vh; }

.archive-sidebar {
  position: fixed; top: var(--nav-h); left: 0;
  width: 160px; height: calc(100vh - var(--nav-h));
  padding: 40px 32px; display: flex; flex-direction: column;
  gap: 12px; overflow-y: auto; z-index: 50;
}
.filter-btn {
  background: none; border: none; font-family: var(--font);
  font-size: 12px; font-weight: normal; letter-spacing: 0.04em;
  color: var(--grey); text-align: left; cursor: pointer; padding: 0;
  transition: color 0.2s; white-space: nowrap; text-transform: lowercase;
}
.filter-btn:hover, .filter-btn.active { color: var(--black); }

.archive-main { margin-left: 160px; flex: 1; padding: 40px 60px 200px 20px; }
.archive-grid { position: relative; }

.archive-thumb {
  position: absolute; cursor: pointer;
  transition: left 0.5s cubic-bezier(0.4,0,0.2,1),
              top 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.35s ease, transform 0.35s ease;
}
.archive-thumb img { display: block; width: 100%; height: auto; }
.archive-thumb.filtered-out { opacity: 0; pointer-events: none; transform: scale(0.93); }

/* ================================ VISIONNEUSE ================================ */
.archive-viewer {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--bg); align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}
.archive-viewer.open { display: flex; }
.viewer-hit-zone {
  position: relative; width: var(--ref-w); max-width: 88vw;
  height: var(--ref-h); display: flex; align-items: center; justify-content: center;
  cursor: none;
}
.viewer-hit-zone img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; pointer-events: none; }

/* ================================ INFO (contact) ================================ */
.info-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 100px 40px;
  text-align: center;
}
.info-links { display: flex; flex-direction: column; gap: 40px; }
.info-link a {
  font-size: clamp(22px, 3.5vw, 48px);
  font-weight: normal; letter-spacing: 0.01em;
  color: var(--black); transition: color 0.2s;
  display: block;
}
.info-link a:hover { color: var(--grey); }

.info-footer {
  position: fixed; bottom: 28px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 60px;
  font-size: 10px; letter-spacing: 0.06em; color: var(--grey);
}

/* ================================ RESPONSIVE ================================ */
@media (max-width: 900px) {
  :root { --ref-h: 65vh; --section-h: 80vh; }
  .photo-section { padding: 0 60px; }
  nav { padding: 0 24px; }
  .archive-sidebar { width: 130px; padding: 32px 20px; }
  .archive-main { margin-left: 130px; padding: 32px 32px 160px 16px; }
  .edition-info-wrapper { font-size: 10px; }
}
@media (max-width: 600px) {
  nav { padding: 0 16px; }
  .photo-section { padding: 0 16px; height: 100svh; }
  :root { --ref-h: 55vw; --section-h: 75vh; }
  .archive-layout { flex-direction: column; }
  .archive-sidebar { position: static; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; padding: 16px 16px 0; gap: 8px 16px; }
  .archive-main { margin-left: 0; padding: 20px 16px 120px; }
  .edition-info-wrapper { display: none; }
  .info-footer { flex-direction: column; align-items: center; gap: 12px; bottom: 20px; }
}
