/* Creacion de una Obra*/

.crearObra {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 74vh;
  background-color: #ab556a;
  padding: 2rem;
}

#crearObra {
  padding: 2rem;
  border-radius: 12px;
  width: 900px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
}

#crearObra h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.form-layout {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
}


#preview-img-obra {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ccc;
}


/* Campos en dos columnas */
.fields-2col {
  display: flex;
  gap: 1.5rem;
}

.fields-2col .col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 200px;
}

/* .fields-2col input{
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 1rem;
} */


/*--------------------------------------------------------------------*/


/* Despliegue de Obra*/


#imagenAmpliada {
  width: 690px;
  height: auto;
  border: none;
  border-radius: 8px;
}

.informacion {
  height: 100%;
  background-color: #424B5D;
  color: #ffffff;
  display: grid;
  justify-items: center;
  align-items: flex-start;
}

.informacion * {
  margin: 3px;
}

.opciones-obra {
  display: flex;
  gap: 10px;
}

#miniaturas img {
  width: 100px;
  height: 100px;       /* ahora fijo */
  object-fit: cover;   /* recorta para llenar el espacio sin deformar */
  margin: 0.3rem;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

#miniaturas img:hover {
  border-color: #d42233;
}

.selector {
  display: grid;
  width: 50%;
}

#visor {
  margin-bottom: 1rem;
  display: flex;
  justify-content: right;
  width: 50%;
  padding: 0%;
  margin: 0%;
}


/*--------------------------------------------------------------------*/




/* Modals */


.modal {
  display: none; /* oculto por defecto */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow: auto; /* habilita scroll si el modal es muy grande */
}

.modal-content {
  background: #ab556a;
  margin: 10% auto;
  padding: 20px;
  width: 60%;
  border-radius: 10px;
}

.modal-content > p {
  background-color: #030F27;
  color: #ffffff;
  border: #ffffff 1px solid;
  text-align: center;
}

.modal-content > p > b {
  color: #d42233;
}

.modal-content.editar form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
}

.modal-content.editar label {
  font-weight: bold;
  margin-bottom: 5px;
}

.modal-content.editar input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.modal-content.editar .acciones {
  grid-column: span 2; /* ocupa todo el ancho */
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.modal-content.editar button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.modal-content.editar h2 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
  text-align: center;
}


/*--------------------------------------------------------------------*/


@media (max-width:1000px){
  #div3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 74vh;
  }

  .selector { display: contents; } /* aplana */

  /* Miniaturas estilo carrusel */
  #miniaturas {
    order: 1;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 0.6rem;
    padding: 0.5rem;
    justify-content: center;
    scrollbar-width: thin;
  }

  #miniaturas img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
  }

  /* visor */
  #visor {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  #imagenAmpliada {
    width: 90%;
    max-width: 800px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 5%;
  }

  /* info */
  .informacion {
    order: 3;
    width: 95%;
    height: 30%;
    text-align: center;
    padding: 12px;
    margin-top: 10px;
  }
}