* {
    box-sizing: border-box;
}

.products-gallery-main {
    margin-top: var(--NavBarHeightDesktop);
    padding: 12px;
}

.products-gallery-parent {
    display: grid;
    grid-auto-rows: 1fr;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    grid-column-gap: 14px;
    grid-row-gap: 14px;
    aspect-ratio: 4 / 6; /* (columns / rows) ensures proper scaling */
    height: auto;
}

.products-gallery-parent > div {
    overflow: hidden;
}

.products-gallery-child01 { grid-area: 1 / 1 / 3 / 3;  }
.products-gallery-child02 { grid-area: 1 / 3 / 2 / 4; }
.products-gallery-child03 { grid-area: 1 / 4 / 2 / 5; }
.products-gallery-child04 { grid-area: 2 / 3 / 3 / 5; }
.products-gallery-child05 { grid-area: 3 / 1 / 4 / 2; }
.products-gallery-child06 { grid-area: 3 / 2 / 4 / 3; }
.products-gallery-child07 { grid-area: 3 / 3 / 4 / 4; }
.products-gallery-child08 { grid-area: 3 / 4 / 4 / 5; }
.products-gallery-child09 { grid-area: 4 / 1 / 5 / 3; }
.products-gallery-child10 { grid-area: 4 / 3 / 5 / 4; }
.products-gallery-child11 { grid-area: 4 / 4 / 5 / 5; }
.products-gallery-child12 { grid-area: 5 / 1 / 6 / 2; }
.products-gallery-child13 { grid-area: 5 / 2 / 6 / 3; }
.products-gallery-child14 { grid-area: 5 / 3 / 6 / 4; }
.products-gallery-child15 { grid-area: 5 / 4 / 6 / 5; }
.products-gallery-child16 { grid-area: 6 / 1 / 7 / 2; }
.products-gallery-child17 { grid-area: 6 / 2 / 7 / 3; }
.products-gallery-child18 { grid-area: 6 / 3 / 7 / 5; }

.products-gallery-content {
    background-color: var(--BackgroundColor);
    border: 2px solid var(--BackgroundColor);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.products-gallery-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(0, 0, 0, 0.7),
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1),
        rgba(0, 0, 0, 0.9));
    pointer-events: none; /* allows clicks to pass through */
    transition: background 0.9s ease; /* smooth transition */
}

.products-gallery-overlay:hover::after {
  background: linear-gradient(45deg,
      rgba(0, 0, 0, 0.4),
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0),
      rgba(0, 0, 0, 0.6));
}

.products-gallery-content img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

.products-gallery-content:hover img{
    transform: scale(1.05);
}

.products-gallery-content:hover p {
    opacity: 1.0;
}

.products-gallery-description {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px;
    width: 100%;
    height: 40%;
    background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1.0),  /* darker at top */
    rgba(0, 0, 0, 0)     /* fades out */
    );
    pointer-events: none;   /* lets clicks pass through to the image */
}

.products-gallery-description p {
    color: var(--ForegroundColor);
    font-size: 15px;
    margin: 2px 0px;
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.products-gallery-description p:first-child {
    opacity: 1.0;
    font-size: 20px;
}

.products-gallery-badge-container {
    display: flex;
    gap: 0.5em;
    position: absolute;
    bottom: 0.5em;
    left: 0.5em;
}

.products-gallery-badge {
    padding: 0.4em;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--ForegroundColor);
    background-color: var(--RedColor);
    border-radius: 0.3em;
    letter-spacing: 0.05em;
    pointer-events: none;   /* lets clicks pass through to the image */
}

@keyframes pulse {
    0%   { transform: scale(0.9); }
    50%  { transform: scale(1.0); }
    100% { transform: scale(0.9); }
}

.products-gallery-content-stack {
    background-color: var(--ForegroundColor);
    border: none;
    display: flex;
    flex-direction: column; /* stack items vertically */
}

.products-gallery-content-stack h1,
.products-gallery-content-stack p {
    color: var(--BackgroundColor);
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    opacity: 0.9;
    padding: 0px 12px;
    margin: 0px 2px;
}

.products-gallery-content-stack p {
    font-size: 22px;
    font-weight: 300;
    margin: 12px 0px;
}

.products-gallery-content-stack img {
    display: block;
    margin: 0px;
}

.products-gallery-content .products-gallery-content-stack img {
    transition: none;
}

.products-gallery-content.products-gallery-content-stack:hover img{
    transform: none;
}

.products-gallery-nav-content-social {
    display: flex;
    list-style: none;
    padding: 0px;
    gap: 20px;
}

.products-gallery-nav-content-social a {
    display: flex;
}

.products-gallery-content.products-gallery-content-stack.introAubeAppContainer a:hover,
.products-gallery-nav-content-social a:hover {
    opacity: 0.5;
}

.products-gallery-nav-content-social img {
    width: 54px;
    height: 54px;
}

.products-gallery-content.products-gallery-content-stack.introAubeAppContainer {
    margin: 0px;
    padding: 0px;
}

.products-gallery-content.products-gallery-content-stack.introAubeAppContainer a {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-underline-offset: 8px;
}

.products-gallery-content.products-gallery-content-stack.introAubeAppContainer img {
    width: 55%;
    height: auto;
}

@media (max-width: 900px) {
    .products-gallery-content-stack h1 {
        font-size: 18px;
    }
    
    .products-gallery-content-stack p {
        font-size: 16px;
    }
    
    .products-gallery-description p:not(:first-child) {
        display: none;
    }
}

@media (max-width: 700px) {
    .products-gallery-main {
        margin-top: var(--NavBarHeightMobile);
        padding: 6px;
    }
    
    .products-gallery-parent {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows:  0.9fr repeat(4, 1fr) repeat(6, 1fr); /* Different row size */
        aspect-ratio: 2 / 10.9; /* (columns / rows) ensures proper scaling */*/
        grid-column-gap: 4px;
        grid-row-gap: 4px;
    }
    
    /*
     grid-area: 4 / 1 / 5 / 3;
     - Row Start: 4 (starts at row line 4)
     - Column Start: 1 (starts at column line 1)
     - Row End: 5 (ends before row line 5, so spans rows 4-5)
     - Column End: 3 (ends before column line 3, so spans columns 1-2)
     */
    
    .products-gallery-child04 { grid-area: 1 / 1 / 2 / 3; }
    .products-gallery-child01 { grid-area: 2 / 1 / 3 / 3; }
    .products-gallery-child02 { grid-area: 3 / 1 / 4 / 2; }
    .products-gallery-child03 { grid-area: 3 / 2 / 4 / 3; }
    .products-gallery-child05 { grid-area: 4 / 1 / 5 / 2; }
    .products-gallery-child06 { grid-area: 4 / 2 / 5 / 3; }
    .products-gallery-child07 { grid-area: 5 / 1 / 6 / 2; }
    .products-gallery-child08 { grid-area: 5 / 2 / 6 / 3; }
    .products-gallery-child09 { grid-area: 6 / 1 / 7 / 3; }
    .products-gallery-child10 { grid-area: 7 / 1 / 8 / 2; }
    .products-gallery-child11 { grid-area: 7 / 2 / 8 / 3; }
    .products-gallery-child12 { grid-area: 8 / 1 / 9 / 2; }
    .products-gallery-child13 { grid-area: 8 / 2 / 9 / 3; }
    .products-gallery-child14 { grid-area: 9 / 1 / 10 / 2; }
    .products-gallery-child15 { grid-area: 9 / 2 / 10 / 3; }
    .products-gallery-child16 { grid-area: 10 / 1 / 11 / 2; }
    .products-gallery-child17 { grid-area: 10 / 2 / 11 / 3; }
    .products-gallery-child18 { grid-area: 11 / 1 / 12 / 3; }
    
    .products-gallery-nav-content-social img {
        width: 32px;
        height: 32px;
    }
    
    .products-gallery-content.products-gallery-content-stack.introAubeAppContainer a {
        font-size: 22px;
    }
}
