:root {
  --background: #f8f7f3;
  --text: #171717;
  --muted: #777;
  --line: rgba(0, 0, 0, 0.12);

  /*
    On laisse volontairement le site respirer sur les bords,
    mais on n'enferme plus la galerie dans une largeur trop faible.
  */
  --side-padding: clamp(14px, 2.4vw, 42px);
  --header-padding-top: clamp(22px, 3vw, 36px);
  --gallery-gap: clamp(10px, 1.2vw, 18px);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  /* font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif; */
  font-family: "Nova Cut", system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* HEADER */

.site-header {
  width: 100%;
  padding:
    var(--header-padding-top)
    var(--side-padding)
    clamp(18px, 2vw, 28px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

/* .site-title {
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.035em;
} */

.site-title,
.page-intro h1 {
  font-family: "Metal Mania", system-ui, sans-serif;
}

.site-title {
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.page-intro h1 {
  margin: 0;
  max-width: 1100px;
  font-size: clamp(3.4rem, 9vw, 9.5rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.9;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(14px, 1.6vw, 26px);
  font-size: clamp(0.9rem, 0.95vw, 1rem);
  letter-spacing: 0.03em;
}

.site-nav a {
  color: var(--muted);
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

/* MAIN */

main {
  width: 100%;
  padding: 0 var(--side-padding) 90px;
}

.page-intro {
  padding: clamp(28px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.page-intro h1 {
  margin: 0;
  max-width: 1100px;
  font-size: clamp(2.8rem, 8vw, 8.6rem);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.page-intro p {
  margin: clamp(12px, 1.5vw, 20px) 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.1vw, 1.18rem);
}

/* GALLERY JUSTIFIÉE PAR LIGNES */

.gallery {
  width: 100%;
}

.gallery-row {
  display: flex;
  width: 100%;
  gap: var(--gallery-gap);
  margin-bottom: var(--gallery-gap);
  align-items: flex-start;
}

.gallery-item {
  position: relative;
  display: block;
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;

  /*
    Pas de crop.
    L'image conserve son ratio.
    Comme le JS donne déjà une boîte au bon ratio,
    object-fit: contain évite toute mauvaise surprise.
  */
  object-fit: contain;

  background: rgba(0, 0, 0, 0.035);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

/* .gallery-item:hover img {
  opacity: 0.84;
} */

.gallery-caption {
  display: none;
}

/* Message vide / erreur */

.empty-gallery {
  color: var(--muted);
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 64px var(--side-padding) 32px;
  background: rgba(248, 247, 243, 0.96);
  display: grid;
  place-items: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

/* RESPONSIVE */

@media (max-width: 760px) {
  :root {
    --side-padding: 14px;
    --gallery-gap: 10px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .page-intro {
    padding-top: 26px;
  }
}