/* --- Variables de Colores (Alta Costura / Minimalista) --- */
:root {
  --black: #000000;            
  --accent-color: #dcd4cf;     /* Tu Neutro RGB(220, 212, 207) */
  --bg-light: #f6f5f4;         
  --bg-cards: #ffffff;         
  --text-dark: #000000;        
  --text-muted: #666666;       
  --white: #ffffff;
  
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.06); 
  --transition: all 0.4s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* --- ENCABEZADO PORTAFOLIO --- */
.portafolio-header {
  text-align: center;
  padding: 60px 20px 40px; 
  background-color: var(--bg-light); 
}

.portafolio-header h1 {
    font-size: 3.5rem;
    margin: 0;
    font-family: 'Playfair Display', serif; 
    font-weight: 400; /* Más fino para mayor elegancia */
    color: var(--black);
    letter-spacing: 2px;
}

.portafolio-header .subtitle {
    text-transform: uppercase;
    display: block;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* --- GRID MODERNO --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px; /* Mayor espacio para que las imágenes respiren */
  padding: 0 5% 80px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Tarjeta de cada trabajo */
.portfolio-item {
  position: relative;
  aspect-ratio: 1 / 1; 
  overflow: hidden;
  border-radius: 0; /* Bordes cuadrados, look más de revista. Si prefieres curvos, usa 16px */
  background: var(--accent-color); /* Fondo de carga sutil */
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
}

/* Efecto elegante al pasar el mouse (Ligero zoom) */
.portfolio-item:hover .gallery-img {
  transform: scale(1.05);
  filter: brightness(60%);
}

.img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  /* Degradado oscuro sutil para que el texto resalte */
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  color: var(--white);
  text-align: center;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

.portfolio-item:hover .img-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* --- MODAL (Premium y Pulido) --- */
.modal {
  display: none; 
  position: fixed;
  z-index: 99999; 
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95); /* Fondo casi negro */
  overflow: hidden; 
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px); /* Desenfoque del fondo */
}

.modal.active {
  display: flex !important;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 85%; 
  max-height: 80vh; 
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(220, 212, 207, 0.2); /* Borde súper sutil con tu color */
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#caption {
  color: var(--accent-color); /* Usamos tu color neutro para el texto */
  padding: 25px 20px 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  font-style: italic;
}

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--accent-color);
  font-size: 45px;
  font-weight: 200;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.close:hover {
  color: var(--white);
  transform: rotate(90deg) scale(1.1);
}

.empty-gallery {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
}