Rotating the first two pages of a 5 page pdf

Hi - I found this thread and was able to use the code. I have everything working except when I use this script in the context_print_styles.css it applies to all the print sections. Is there a way to use this so it only rotates the first two pages of the pdf and the rest is portrait? I linked the previous thread to this for reference.

.page_bleedbox:nth-child(1) img.ol_pdf_datamapper_input {
transform: translate(-50%, -50%) rotate(-90deg) !important;
}

Continuing the discussion from Rotate 2nd page of dynamic background:

Thank you

I haven’t tested it but I assume that you can change the CSS, as shared in this reply, to the following CSS in that case:

.page_bleedbox:nth-child(1) img.ol_pdf_datamapper_input,
.page_bleedbox:nth-child(2) img.ol_pdf_datamapper_input {
	transform: translate(-50%, -50%) rotate(-90deg) !important;
}

That is the same discussion I shared in my post. I was using that and it worked. Except my pdf is 5 pages. The first two need to rotate but with this the whole document rotates. I just figured out the answer to my question. I needed to go into the other print sections and deselect the css style sheet i was using because it was rotating the pdf’s on all my print sections. Thank you.