/* ============================================================
   Fotografía · Estilo minimalista blanco y negro
   ============================================================ */

/* ---- Variables de diseño ---- */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --overlay: rgba(0, 0, 0, 0.94);
  --max: 1400px;
  --gap: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset básico ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ---- Cabecera ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav a {
  transition: color 0.25s var(--ease);
}

.site-nav a:hover {
  color: var(--fg);
}

/* ---- Contenedor general ---- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Portada / hero ---- */
.hero {
  text-align: center;
  padding: 90px 32px 70px;
}

.hero h1 {
  font-size: clamp(38px, 8vw, 88px);
  font-weight: 200;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero p {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Título de sección ---- */
.section-title {
  text-align: center;
  margin: 10px 0 40px;
}

.section-title .eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.section-title h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 200;
  letter-spacing: 0.12em;
}

/* ---- Cuadrícula de colecciones (portada) ---- */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  padding-bottom: 80px;
}

.collection-card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f2f2f2;
  cursor: pointer;
}

.collection-card img {
  filter: grayscale(100%);
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
}

.collection-card:hover img {
  transform: scale(1.05);
}

.collection-card .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  opacity: 1;
  transition: background 0.5s var(--ease);
}

.collection-card:hover .overlay {
  background: rgba(0, 0, 0, 0.42);
}

.collection-card .overlay h3 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.collection-card .overlay span {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---- Cuadrícula de fotos (dentro de una colección) ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
  padding-bottom: 90px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f2f2;
  cursor: zoom-in;
}

.photo-item img {
  filter: grayscale(100%);
  transition: transform 0.9s var(--ease);
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* ---- Botón volver ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.back-link:hover {
  color: var(--fg);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 88vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  user-select: none;
}

.lightbox .caption {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  color: #d8d8d8;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.25s var(--ease);
  font-family: inherit;
}

.lightbox button:hover {
  opacity: 1;
}

.lb-close {
  top: 26px;
  right: 32px;
  font-size: 30px;
  font-weight: 200;
  line-height: 1;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 44px;
  font-weight: 100;
  padding: 20px;
}

.lb-prev {
  left: 12px;
}

.lb-next {
  right: 12px;
}

/* ---- Pie de página ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* ---- Aparición suave al cargar ---- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeIn 0.8s var(--ease) forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-header {
    padding: 18px 20px;
  }
  .wrap {
    padding: 0 20px;
  }
  .site-nav {
    gap: 18px;
  }
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .lb-prev,
  .lb-next {
    font-size: 32px;
    padding: 12px;
  }
}
