/* parent-gallery.css
   Minimal layout: hero on left, thumbs to the right */

/* Allow the *content area* to be wider on single artwork pages */
body.single-artwork main.is-layout-constrained,
body.single-artwork .wp-block-query.is-layout-constrained {
  max-width: none !important;
}
body.single-artwork .entry-content.wp-block-post-content {
  max-width: none !important;   /* remove theme's constraint */
  width: 100%;
}

.cc-artwork-parent-view {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.cc-artwork-parent-title {
  margin: 0 0 10 0;
}

.cc-artwork-hero {
  flex: 1 1 80%;
  /* If the layout jumps around
  * Adjust to taste
  * aspect-ratio: 4 / 3;
  */
}

.cc-artwork-hero__img {
  width: 100%;
  height: auto;
  display: block;
}

.cc-artwork-hero--empty {
  padding: 18px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
}

.cc-artwork-thumbs {
  display: flex;
  flex: 0 0 20%;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-artwork-thumb {
  width: calc(50% - 3px);        /* still 2 columns */
  aspect-ratio: 1 / 1;          /* force square */
  background-color: #f7eee2;    
  padding: 6px;                 /* space between image and tile edge */
  border: 3px solid #deb887;
  border-radius: 8px;
  cursor: pointer;
  display: flex;                /* center image */
  align-items: center;
  justify-content: center;
}


.cc-artwork-thumb.is-selected {
  background-color: #666bcc;
  border: 3px solid transparent;
}

.cc-artwork-thumb:hover {
    border: 3px solid #2e3389;
}

.cc-artwork-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;

  object-fit: contain;
  display: block;
}

.cc-artwork-thumb.is-selected {
  border-color: rgba(0,0,1,.5);
}

.cc-artwork-details {
  width: calc(100% - 6px); /* gap compensation */
  min-height: 100px;
  padding: 5px;
}

.cc-artwork-details td{
  vertical-align: top;
}

.cc-artwork-description {
  margin-top: 0.5rem;
  line-height: 1.4;
}

.cc-artwork-description p{
  margin: 0;
}

.cc-artwork-back-link{
  margin: 0;
}

.cc-artwork-back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;  
}

.cc-artwork-back-link a:hover {
  text-decoration: none;
}

.cc-back-icon {
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
  position: relative;
  top:-3.5px;
}

.cc-back-text {
  text-decoration: none;
}

.cc-artwork-back-link a:hover .cc-back-text {
  text-decoration: underline;
}

/* Responsive fallback 
* The hero will be above thumbs on narrow screens.
*/
@media (max-width: 768px) {
  .cc-artwork-parent-view {
    flex-direction: column;
  }

  .cc-artwork-thumbs {
    flex-direction: row;
  }

  .cc-artwork-thumb {
    width: calc(33.333% - 8px); /* 3 per row on mobile */
  }
}