/* --- BASE & RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
    : rgb(26, 26, 26);
  display: flex;
  line-height: 1.7;
  overflow-x: hidden;
  counter-reset: section; /* Para numeración automática */
}

/* --- SIDEBAR (Desktop) --- */
.sidebar {
  width: 300px;
  padding: 50px 50px;
  border-right: 1px solid #f0f0f0;
  position: fixed;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.name {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 60px;
  letter-spacing: 1px;
  line-height: 1;
}

.menu {
  flex-grow: 0.8;
}

.menu a, .extra a {
  display: block;
  margin: 15px 0;
  text-decoration: none;
  color: rgb(99,99,99);
  font-size: 14px;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 1px;
  transition: 0.4s;
}

.menu a:hover, .extra a:hover {
  color:rgb(136, 0, 21);
  padding-left: 8px;
}

.extra {
  flex-grow: 0.5;
  margin-top: 70px;
  padding-top: 3px;
  margin-bottom: 40px;
  line-height: 0.8;
  border-top: 1px solid rgb(238, 170, 180);
}

/* --- CONTENT AREA --- */
.content {
  margin-left: 300px;
  padding: 60px 10%;
  width: 100%;
}

/* --- SECTIONS --- */
.project {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 1s ease both;
}

.project.active {
  display: block;
}

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

/* Títulos estilo Catálogo */
.project-header {
  margin-bottom: 40px;
}

.project-number {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color:rgb(136, 0, 21);
  display: block;
  margin-bottom: 10px;
}

h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(25px, 5vw, 25px);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 10px;
}

.project-desc {
  max-width: 700px;
  font-weight: 300;
  color: #555;
  font-size: 15px;
  line-height: 1.8;
}

.project-video {
  max-width: 700px;
  font-weight: 300;
  color: #555;
  font-size: 15px;
  line-height: 1.8;
  margin-left: auto; /* Empuja a la derecha */
  margin-right: 0; /* Asegura el margen derecho 0 */
  text-align: right; /* Alinea el texto interno si es necesario */;
}

/* GALERÍA INTELIGENTE -- 3 Columna*/
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    align-items: center; /* Alinea al inicio para que las verticales no se estiren raro */
}

.gallery-item {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Mantiene la proporción real */
    transition: transform 0.6s ease;
}

/* Clase para imágenes verticales (Opcional, se puede aplicar con JS) */
.gallery img.vertical {
    max-width: 70%; /* Las verticales suelen verse gigantes si ocupan todo el ancho */
    margin: 0 auto;
}

/* Efecto hover elegante */
.gallery img:hover {
    /*transform: scale(1.03);*/
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gallery img.vertical {
        max-width: 100%; /* En móvil mejor que ocupen el ancho total */
    }
}

/* GALERÍA INTELIGENTE -- 2 columnas */
.ggallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    align-items: center; /* Alinea al inicio para que las verticales no se estiren raro */
}

.ggallery-item {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

.ggallery img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Mantiene la proporción real */
    transition: transform 0.6s ease;
}

/* Clase para imágenes verticales (Opcional, se puede aplicar con JS) */
.ggallery img.vertical {
    max-width: 70%; /* Las verticales suelen verse gigantes si ocupan todo el ancho */
    margin: 0 auto;
}

/* Efecto hover elegante */
.ggallery img:hover {
    /*transform: scale(1.03);*/
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .ggallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .ggallery img.vertical {
        max-width: 100%; /* En móvil mejor que ocupen el ancho total */
    }
}

/* GALERÍA INTELIGENTE -- 1 columnas */
.gggallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
    align-items: center; /* Alinea al inicio para que las verticales no se estiren raro */
}

.gggallery-item {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

.gggallery img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Mantiene la proporción real */
    transition: transform 0.6s ease;
    border: 1px solid #bbb;
}

/* Clase para imágenes verticales (Opcional, se puede aplicar con JS) */
.gggallery img.vertical {
    max-width: 70%; /* Las verticales suelen verse gigantes si ocupan todo el ancho */
    margin: 0 auto;
}

/* Efecto hover elegante */
.gggallery img:hover {
    /*transform: scale(1.03);*/
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .gggallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gggallery img.vertical {
        max-width: 100%; /* En móvil mejor que ocupen el ancho total */
    }
}

/* --- HOME --- */
.home-hero img {
  width: 100%;
  max-height: 75vh;
  object-fit: cover;
  margin-bottom: 20px;
}

.home-hero p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: #888;
  text-align: right;
}

/* --- MOBILE MENU BUTTON (Flotante) --- */
.menu-toggle {
  display: none;
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 2000;
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: 0.3s;
}

.menu-toggle:active { transform: scale(0.9); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .content { padding: 60px 40px; }
  .gallery { gap: 30px 20px; }
  .gallery img:nth-child(even) { margin-top: 40px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 100%;
    padding: 100px 40px;
    text-align: center;
  }
  
  .sidebar.open { transform: translateX(0); }

  .content { margin-left: 0; padding: 40px 20px; }
  
  .menu-toggle { display: block; }

  .gallery { grid-template-columns: 1fr; display: block; }
  .gallery img { 
    grid-column: span 1 !important; 
    margin-top: 0 !important; 
    margin-bottom: 30px; 
  }

  .name { font-size: 32px; margin-bottom: 40px; }
  .menu a { font-size: 16px; margin: 20px 0; }
}

/* LIGHTBOX CON NAVEGACIÓN */
.lightbox {
    display: none;
    position: fixed;
    z-index: 3000;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98);
    align-items: center;
    justify-content: center;
}

.lb-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: zoom-out;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    animation: fadeIn 0.4s ease;
}

/* Flechas de Navegación */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    font-weight: 200;
    color: #000;
    cursor: pointer;
    padding: 20px;
    z-index: 3100;
    user-select: none;
    transition: opacity 0.3s;
    opacity: 0.3;
}

.nav-arrow:hover { opacity: 1; }
.prev { left: 20px; }
.next { right: 20px; }

.close-lb {
    position: absolute;
    top: 30px; right: 40px;
    font-size: 30px;
    cursor: pointer;
    z-index: 3200;
}

.lb-titulo {
    margin-bottom: 15px;
    font-size: 11px;
    letter-spacing: 2px;
    color:rgb(136, 0, 21);
}

.lb-counter {
    margin-top: 15px;
    font-size: 11px;
    letter-spacing: 2px;
    color: #999;
    text-transform: uppercase;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive para flechas */
@media (max-width: 768px) {
    .nav-arrow { font-size: 40px; padding: 10px; opacity: 0.8; }
    .prev { left: 5px; }
    .next { right: 5px; }
}

/* ESTILOS PARA EL CABEZAL MÓVIL */
.mobile-header {
    display: none; /* Oculto en escritorio */
}

@media (max-width: 768px) {
    .mobile-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        text-align: center;
        z-index: 900; /* Por debajo del botón de menú y la sidebar */
        border-bottom: 1px solid #f2f2f2;
    }

    .mobile-name {
        font-family: 'Playfair Display', serif;
        font-size: 20px;
        font-weight: 600;
        letter-spacing: -0.5px;
        text-transform: none;
    }

    /* Ajustamos el margen superior del contenido en móvil 
       para que el nombre fijo no tape las fotos */
    .content {
        margin-top: 60px; 
        padding: 40px 20px;
    }
}

/* --- ESTILOS PROPIOS --- */
.cv {
  font-weight: 700;
  font-size: small;
  color:rgb(73, 73, 73);
}

.redes {
  background-color: white;
  font-size: 1em;
  color:black;
  cursor: pointer;
}

.copyrigth {
  display: flex;
  margin: 15px 0;
  padding-top: 5px;
  text-decoration: none;
  text-align: left;
  font-weight: 400;
  font-style: italic;
  font-size: small;
  color:rgb(47, 47, 47);
  border-top: thin solid rgb(238, 170, 180);
}