/* 
  Contains CSS for all Gallery Product sections (full, two-images, image-blank, and image-text) 
*/

/* Single Image, One Side Blank Layout */
.gallery-product-image-blank {
  & .gallery-product-image-blank__grid {
    display: flex;
    gap: 2rem;

    &[data-image-position="left"] {
      flex-direction: column;

      @media (min-width: 750px) {
        flex-direction: row;
      }
    }

    &[data-image-position="right"] {
      flex-direction: column-reverse;

      @media (min-width: 750px) {
        flex-direction: row-reverse;
      }
    }
  }

  & .gallery-product-image-blank__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    background-color: rgb(var(--color-background));

    @media (min-width: 750px) {
      flex-basis: 100%;
    }
  }

  & .gallery-product-image-blank__image-wrapper {
    position: relative;
    margin: 0 0 1.6rem 0;
    padding-top: 122%;
    width: 100%;
    height: 100%;
    overflow: hidden;

    @media (min-width: 750px) {
      margin: 0 0 2.4rem 0;
    }

    &[data-image-ratio="portrait"]  { 
      padding-top: 122%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="landscape"] { 
      padding-top: 70%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="square"]    { 
      padding-top: 100%;
      object-fit: cover; 
    }
    
    &[data-image-ratio="natural"]   { 
      padding-top: 0; 
      object-fit: contain;
    }

    & img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
  }

  & .gallery-product-image-blank__link-overlay {
    position: absolute;
    inset: 0;
  }

  & .gallery-product-image-blank__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;

    & a {
      flex-shrink: 0;
      border: 1px solid rgb(var(--color-foreground));
      padding: 0.875rem 1.875rem;
      text-align: center;
      text-transform: uppercase;
      text-decoration: none;
      color: rgb(var(--color-foreground));

      &:is(:active, :focus, :hover, :visited) {
        border-color: rgb(var(--color-foreground));
        text-transform: uppercase;
        text-decoration: none;
        color: rgb(var(--color-foreground));
      }
    }

    & .gallery-product-image-blank__text-wrapper {
      flex-grow: 1;
      max-width: 38.8rem;

      & p { margin: 0; }
    }
  }

  & .gallery-product-image-blank__card--blank {
    display: none;
    height: 100%;
    width: 100%;

    @media (min-width: 750px) {
      display: inline;
    }
  }
}

/* Single Image, One Side Text Layout */
.gallery-product-image-text {
  & .gallery-product-image-text__grid {
    display: flex;
    gap: 2rem;

    &[data-image-position="left"][data-mobile-position="top"] {
      flex-direction: column-reverse;

      @media (min-width: 750px) {
        flex-direction: row;
      }
    }

    &[data-image-position="right"][data-mobile-position="top"] {
      flex-direction: column-reverse;

      @media (min-width: 750px) {
        flex-direction: row-reverse;
      }
    }

    &[data-image-position="left"][data-mobile-position="bottom"] {
      flex-direction: column;

      @media (min-width: 750px) {
        flex-direction: row;
      }
    }

    &[data-image-position="right"][data-mobile-position="bottom"] {
      flex-direction: column;

      @media (min-width: 750px) {
        flex-direction: row-reverse;
      }
    }
  }

  & .gallery-product-image-text__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    background-color: rgb(var(--color-background));

    @media (min-width: 750px) {
      flex-basis: 100%;
    }
  }

  & .gallery-product-image-text__image-wrapper {
    position: relative;
    margin: 0 0 1.6rem 0;
    padding-top: 122%;
    width: 100%;
    height: 100%;
    overflow: hidden;

    @media (min-width: 750px) {
      margin: 0 0 2.4rem 0;
    }

    &[data-image-ratio="portrait"]  { 
      padding-top: 122%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="landscape"] { 
      padding-top: 70%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="square"]    { 
      padding-top: 100%;
      object-fit: cover; 
    }
    
    &[data-image-ratio="natural"]   { 
      padding-top: 0; 
      object-fit: contain;
    }

    & img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
  }

  & .gallery-product-image-text__link-overlay {
    position: absolute;
    inset: 0;
  }

  & .gallery-product-image-text__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;

    & a {
      flex-shrink: 0;
      border: 1px solid rgb(var(--color-foreground));
      padding: 0.875rem 1.875rem;
      text-align: center;
      text-transform: uppercase;
      text-decoration: none;
      color: rgb(var(--color-foreground));

      &:is(:active, :focus, :hover, :visited) {
        border-color: rgb(var(--color-foreground));
        text-transform: uppercase;
        text-decoration: none;
        color: rgb(var(--color-foreground));
      }
    }

    & .gallery-product-image-text__text-wrapper {
      flex-grow: 1;
      max-width: 38.8rem;

      & p { margin: 0; }
    }
  }
}

/* Two Images Layout */
.gallery-product-two-images {
  & .gallery-product-two-images__grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;

    @media (min-width: 750px) {
      flex-direction: row;
    }
  }

  & .gallery-product-two-images__card {
    display: flex;
    flex-direction: column;
    height: auto;
    background-color: rgb(var(--color-background));

    @media (min-width: 750px) {
      flex-basis: 100%;
    }
  }

  & .gallery-product-two-images__image-wrapper {
    position: relative;
    margin: 0 0 1.6rem 0;
    width: 100%;
    overflow: hidden;

    @media (min-width: 750px) {
      margin: 0 0 2.4rem 0;
    }

    &[data-image-ratio="portrait"]  { 
      padding-top: 122%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="landscape"] { 
      padding-top: 70%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="square"]    { 
      padding-top: 100%;
      object-fit: cover; 
    }
    
    &[data-image-ratio="natural"]   { 
      padding-top: 0; 
      
      & img {
        object-fit:cover;
      }
    }

    & img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
  }

  & .gallery-product-two-images__link-overlay {
    position: absolute;
    inset: 0;
  }

  & .gallery-product-two-images__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;

    & a {
      flex-shrink: 0;
      border: 1px solid rgb(var(--color-foreground));
      padding: 0.875rem 1.875rem;
      text-align: center;
      text-transform: uppercase;
      text-decoration: none;
      color: rgb(var(--color-foreground));

      &:is(:active, :focus, :hover, :visited) {
        border-color: rgb(var(--color-foreground));
        text-transform: uppercase;
        text-decoration: none;
        color: rgb(var(--color-foreground));
      }
    }

    & .gallery-product-two-images__text-wrapper {
      flex-grow: 1;
      max-width: 38.8rem;

      & p {
        margin: 0;
      }
    }
  }
}

/* Full-Width Layout */
.gallery-product-full {
  & .gallery-product-full__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    background-color: rgb(var(--color-background));

    &.card__has-inset {
      @media (min-width: 750px) {
        padding-inline: 20%;
      }
    }
  }

  & .gallery-product-full__image-wrapper {
    position: relative;
    margin: 0 0 1.6rem 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    &[data-image-ratio="portrait"]  { 
      padding-top: 122%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="landscape"] { 
      padding-top: 70%; 
      object-fit: cover;
    }
    
    &[data-image-ratio="square"]    { 
      padding-top: 100%;
      object-fit: cover; 
    }
    
    &[data-image-ratio="natural"]   { 
      padding-top: 0; 
      object-fit: contain;
    }

    & img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
  }

  & .gallery-product-full__link-overlay {
    position: absolute;
    inset: 0;
  }

  & .gallery-product-full__info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;

    & a {
      flex-shrink: 0;
      border: 1px solid rgb(var(--color-foreground));
      padding: 0.875rem 1.875rem;
      text-align: center;
      text-transform: uppercase;
      text-decoration: none;
      color: rgb(var(--color-foreground));
      
      &:is(:active, :focus, :hover, :visited) {
        border-color: rgb(var(--color-foreground));
        text-transform: uppercase;
        text-decoration: none;
        color: rgb(var(--color-foreground));
      }
    }
  }

  & .gallery-product-full__text-wrapper {
    flex-grow: 1;
    max-width: 38.8rem;

    & p {
      margin-top: 0;
    }
  }
}
