body:has(.gallery) footer {
    display: none;
}

.gallery {
    min-height: 100vh;
    padding: clamp(1.7rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.2rem) 3rem;
}

.gallery-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    margin-bottom: clamp(2.8rem, 9vh, 5rem);
}

.gallery-header .title-primary {
    margin: 0;
    font-size: clamp(3.1rem, 5vw, 4.7rem);
}

.gallery-logo {
    width: clamp(4.2rem, 8vh, 5.8rem);
    height: auto;
}

.gallery-back {
    justify-self: end;
    align-self: center;
    min-height: 2.8rem;
    padding-inline: 1.2rem;
    font-size: 1rem;
}

.gallery-message {
    margin: 2rem auto;
    color: var(--color-ink);
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
}

.gallery-section-title {
    margin: 0 0 1.2rem;
    color: var(--color-ink);
    font-size: clamp(2rem, 3vw, 2.6rem);
    line-height: 1.1;
}

.gallery-themes {
    display: grid;
    gap: 2rem;
}

.gallery-featured {
    display: grid;
    grid-template-columns: 10rem repeat(4, minmax(8rem, 12rem));
    gap: clamp(1.7rem, 5vw, 5rem);
    align-items: center;
    padding-bottom: 1.9rem;
    border-bottom: 1px solid var(--color-blue-700);
}

.gallery-featured .gallery-section-title {
    margin: 0;
}

.gallery-featured-list {
    display: contents;
}

.gallery-theme {
    position: relative;
    display: grid;
    min-height: 10.2rem;
    place-items: center;
    color: var(--color-white);
    text-decoration: none;
    background: var(--color-black);
    border: 5px solid var(--color-white);
    box-shadow: var(--shadow-card);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-theme::before {
    position: absolute;
    top: -1.55rem;
    left: 50%;
    width: 2.1rem;
    height: 2.6rem;
    background-image: url("../assets/scotch_bleu.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    transform: translateX(-50%) rotate(-5deg);
}

.gallery-theme:nth-child(odd)::before {
    background-image: url("../assets/scotch_orange.png");
    transform: translateX(-50%) rotate(1deg);
}

.gallery-theme:nth-child(2n) {
    transform: rotate(-4deg);
}

.gallery-theme:nth-child(3n) {
    transform: rotate(0deg);
}

.gallery-theme:nth-child(4n) {
    transform: rotate(4deg);
}

.gallery-theme:hover,
.gallery-theme:focus-visible {
    transform: translateY(-0.25rem) rotate(0deg);
    box-shadow: var(--shadow-card-hover);
}

.gallery-theme h2 {
    margin: 0;
    color: var(--color-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    text-align: center;
}

.gallery-theme-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-theme-title {
    position: relative;
    z-index: 1;
    padding: 0.3rem 0.6rem;
    background: var(--color-black);
}

.gallery-collections {
    display: grid;
    grid-template-columns: repeat(2, minmax(18rem, 1fr));
    gap: 2.4rem 4rem;
    max-width: 66rem;
    margin: 1.6rem auto 0;
}

.gallery-collection {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 12rem);
    gap: 1.4rem;
    min-height: 12.4rem;
    align-items: center;
    padding: 2.2rem 2rem;
    color: var(--color-ink);
    text-decoration: none;
    background: var(--color-blue-100);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.gallery-collection h2 {
    margin: 0;
    color: var(--color-ink);
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    line-height: 1.15;
}

.gallery-collection-preview {
    display: grid;
    aspect-ratio: 1.08;
    place-items: center;
    color: var(--color-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    background: var(--color-black);
    border: 3px solid var(--color-ink);
}

.gallery-theme-view {
    max-width: 72rem;
    margin-inline: auto;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 2rem;
}

.gallery-image-frame {
    position: relative;
    padding: 0.4rem;
    background: var(--color-white);
    box-shadow: var(--shadow-card);
}

.gallery-image-frame::before {
    position: absolute;
    top: -1.15rem;
    left: 50%;
    width: 2rem;
    height: 2.4rem;
    background: url("../assets/scotch_bleu.png") center / contain no-repeat;
    content: "";
    transform: translateX(-50%) rotate(-4deg);
}

.gallery-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

@media (max-width: 980px) {
    .gallery-featured {
        grid-template-columns: repeat(2, minmax(8rem, 1fr));
    }

    .gallery-featured .gallery-section-title {
        grid-column: 1 / -1;
    }

    .gallery-featured-list {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(8rem, 1fr));
        gap: 2rem;
    }

    .gallery-collections {
        grid-template-columns: 1fr;
        max-width: 34rem;
    }
}

@media (max-width: 640px) {
    .gallery {
        padding: 1.25rem;
    }

    .gallery-header {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 1rem;
        margin-bottom: 2.2rem;
        text-align: center;
    }

    .gallery-header .title-primary {
        font-size: 3rem;
    }

    .gallery-back {
        justify-self: center;
    }

    .gallery-featured-list {
        grid-template-columns: 1fr;
    }

    .gallery-collection {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
