/*
  Leah Cortez Studio Art - Individual Work Page Stylesheet
  ---
  This file contains the specific styles for the individual artwork pages,
  featuring a split-screen layout for the image and its details.
*/

/* --------------------
   1. WORK PAGE CONTAINER
   -------------------- */

.work-page {
  /* Adds vertical padding to the main content area */
  padding: 4rem 0;
}

.work-container {
  /*
    Uses Flexbox to create the two-column (split-screen) layout.
  */
  display: flex;
  align-items: flex-start; /* Aligns columns to the top */
  gap: 3rem; /* The space between the image and the details */
  max-width: 1400px; /* A wider container for this layout */
  margin: 0 auto;
  padding: 0 2rem;
}

/* --------------------
   2. WORK COLUMNS (Image and Details)
   -------------------- */

.work-image-column {
  /*
    This column is for the artwork image. It will take up 55% of the
    container's width. We use flex-basis for this.
  */
  flex: 0 1 55%; /* flex-grow, flex-shrink, flex-basis */
  position: sticky; /* Makes the image column "stick" on the screen during scroll */
  top: 120px; /* The offset from the top, considering the nav bar */
}

.work-image-column img {
  /* Ensures the main image is responsive and fills its container */
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
  position: relative;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: optimizeQuality;
  backface-visibility: hidden;
  transform: translateZ(0);
  max-width: 100%;
  height: auto;
  /* Constrain height to fit viewport better */
  max-height: 70vh;
  object-fit: contain;
}

.image-zoom-container:hover .main-image img,
.image-zoom-container:hover #mainImage {
  transform: scale(1.015); /* Subtle zoom for main image only when magnifier is active */
  transition: transform 0.3s ease;
}

/* For images not in zoom containers, wrap border tightly */
.work-image-column > img {
  max-width: fit-content;
}

/* Magnifying Glass Effect */
.work-image-column img:hover {
  cursor: zoom-in;
}

.work-image-column .image-zoom-container {
  position: relative;
  overflow: visible;
  cursor: none;
  /* Ensure container doesn't cause pixelation */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Make container fit content without border */
  display: inline-block;
  line-height: 0;
}

.work-image-column .image-zoom-container img {
  border: none;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: optimizeQuality;
  backface-visibility: hidden;
  transform: translateZ(0);
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* Magnifying glass circle */
.magnifying-glass {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 3px solid #fff;
  border-radius: 50%;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  z-index: 100;
  transform: translate(-50%, -50%);
  background-size: cover;
  background-position: center;
  will-change: left, top, background-position;
}

.work-image-column .image-zoom-container:hover .magnifying-glass {
  opacity: 1;
}

/* Remove the old image gallery styles since we're simplifying */

.work-details-column {
  /*
    This column is for the artwork's text details. It will take up the
    remaining 45% of the container's width.
  */
  flex: 0 1 45%;
  margin-top: 120px;
}

/* --------------------
   3. IMAGE GALLERY (under main image)
   -------------------- */

.image-gallery {
  /*
    Uses flexbox to display the small gallery images in a row.
  */
  display: flex;
  /*
    Adds a gap between the gallery images.
  */
  gap: 10px;
  /*
    Adds some space above the gallery, separating it from the main image.
  */
  margin-top: 1rem;
}

.image-gallery img {
  /*
    Each image in the gallery will take up an equal amount of space.
  */
  flex: 1;
  /*
    Sets a maximum height to keep them uniform.
  */
  max-height: 150px;
  /*
    Ensures the images cover the area without distortion.
  */
  object-fit: cover;
  /*
    A subtle border for each small image.
  */
  border: 2px solid var(--color-secondary-accent);
  /*
    A transition for a hover effect.
  */
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.image-gallery img:hover {
  /*
    Reduces the opacity slightly on hover to indicate interactivity.
  */
  opacity: 0.8;
}


/* --------------------
   4. WORK DETAILS (Right Column)
   -------------------- */

.work-details-column h1 {
  /* Sets the font size for the artwork's title */
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.work-subtitle {
  margin-bottom: 1.5rem;
}

.work-subtitle h2 {
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--color-text);
  font-weight: 400;
  opacity: 0.9;
  margin: 0;
  line-height: 1.3;
}

.work-meta {
  /*
    This container holds the meta-data (Medium, Year, Dimensions).
    It uses flexbox to lay them out and allow wrapping on small screens.
  */
  display: flex;
  flex-wrap: wrap; /* Allows items to wrap to the next line */
  gap: 1rem; /* Space between meta items */
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  /* A bottom border to separate the meta data from the description */
  border-bottom: 1px solid var(--color-secondary-accent);
}

.meta-item {
  /* Sets the font to the accent font for a distinct look */
  font-family: var(--font-accent);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.work-description h2 {
  /* Sets the font size for the "About The Piece" heading */
  font-size: 2rem;
  color: var(--color-primary-accent);
  margin-bottom: 1.5rem;
}

.work-description h3 {
  font-size: 1.4rem;
  color: var(--color-primary-accent);
  margin: 2rem 0 1rem 0;
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.work-description h4 {
  font-size: 1.1rem;
  color: var(--color-primary-accent);
  margin: 1.5rem 0 0.75rem 0;
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.work-description p {
  /* Sets the font size for the description text */
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.work-description ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding: 0;
  list-style: decimal;
}

.work-description ol li {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.work-description ul {
  margin: 1rem 0 1.5rem 0;
  padding: 0;
  list-style: none;
}

.work-description ul li {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.work-description ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-primary-accent);
  font-weight: bold;
}

/* --------------------
   5. WORK NAVIGATION (Prev/Next)
   -------------------- */

.work-navigation {
  /*
    Uses flexbox to space out the navigation links evenly.
  */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  /* A top border to separate it from the description */
  border-top: 1px solid var(--color-secondary-accent);
}

.work-navigation a {
  /* Sets the font to the accent font */
  font-family: var(--font-accent);
  color: var(--color-primary-accent);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  background: rgba(248, 200, 208, 0.05);
  border: 1px solid rgba(248, 200, 208, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.work-navigation a:hover {
  color: var(--color-background);
  background: var(--color-primary-accent);
  border-color: var(--color-primary-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(126, 28, 46, 0.3);
}

.work-navigation .all-work {
  text-align: center;
  font-weight: 600;
  background: rgba(248, 200, 208, 0.1);
  border: 2px solid rgba(248, 200, 208, 0.2);
}

.work-navigation .all-work:hover {
  background: var(--color-primary-accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(126, 28, 46, 0.4);
}

/* --------------------
   6. THUMBNAIL GALLERY
   -------------------- */

.thumbnail-gallery {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.thumbnail-item {
  flex: 0 0 80px;
  height: 80px;
  border: 3px solid var(--color-secondary-accent);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  opacity: 0.7;
}

.thumbnail-item:hover,
.thumbnail-item.active {
  opacity: 1;
  border-color: var(--color-primary-accent);
  transform: scale(1.05);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: none;
}

.main-image {
  margin-bottom: 1rem;
}

/* --------------------
   7. MEDIA QUERIES
   -------------------- */

@media (max-width: 992px) {
  .work-container {
    /*
      On smaller screens (tablets), the layout stacks vertically.
    */
    flex-direction: column;
  }

  .work-image-column {
    /*
      The image column no longer needs to be sticky in a stacked layout.
    */
    position: static;
    top: auto;
  }

  .work-image-column,
  .work-details-column {
    /*
      Both columns now take up the full width of the container.
    */
    flex-basis: 100%;
  }

  .work-details-column h1 {
    font-size: 3rem; /* Slightly smaller title on tablets */
  }
}

@media (max-width: 768px) {
    .work-details-column h1 {
        font-size: 2.5rem; /* Even smaller on mobile */
    }

    .work-description h2 {
        font-size: 1.8rem;
    }
}
