﻿/* The New Downloads Page */
html {
    scroll-padding : 3rem;
}

.downloads-terms-container {
    padding : 0 1rem 2rem;
}

.download-terms {
    margin     : 0 auto;
    max-width  : var(--l-text);
    border     : 1px solid whitesmoke;
    box-shadow : 0 30px 60px -15px rgba(100,100,100,0.1),0 20px 35px -20px rgba(0,0,0,0.05),0 -15px 35px -10px rgba(0,0,0,0.025);
}

.download-terms-text {
    padding       : 1rem;
    border-bottom : 1px solid whitesmoke;
}

#terms {
    appearance   : none;
    aspect-ratio : 1;
    border       : 1px solid var(--c-gray);
    width        : 0.65rem;
    height       : 0.65rem;
    cursor       : pointer;
    transition   : background 200ms;

    &:hover {
        background : whitesmoke;
    }

    &:checked {
        background : #405935;
    }

}

.download-terms-label {
    padding     : 0.5rem 1rem;
    display     : flex;
    align-items : center;
    font-style  : italic;
    cursor      : pointer;
    gap         : 0.5rem;
    transition  : background 200ms, color 200ms;

    &:hover {
        background : var(--c-gray);
        color      : var(--c-white);
    }

    &:has(#terms:checked) {
        background : #e3f4db;
        color      : #405935;
    }

}


.downloads-sections {
    padding : 0 1rem;
}

/* The Section Title */
.downloads-section-title-container {
    max-width  : var(--l-text);
    margin     : 0 auto;
    padding    : 0.75rem 0;
    transition : color 300ms, border-bottom-color 300ms;
    position   : relative;
}

.downloads-section-title-container::before {
    content    : "";
    position   : absolute;
    inset      : 0 0 auto;
    height     : 1px;
    background : whitesmoke;
    transition : background 200ms;
}

.downloads-section-title-container::after {
    content    : "";
    position   : absolute;
    inset      : auto 0 -1px;
    height     : 1px;
    background : whitesmoke;
    transition : background 200ms;
}

.downloads-section-title-container:hover {
    color : var(--c-brand);
    border-bottom-color : var(--c-black);
}

/* The Title Text */
.downloads-section-title {
    font-size       : calc(var(--f-size) * var(--f-scale-m));
    font-style      : italic;
    display         : flex;
    justify-content : space-between;
    width           : 100%;
}

.downloads-section-title::after {
    content : "+";
}

.downloads-section-container[open] .downloads-section-title::after {
    content : "—";
}

.downloads-section-grid {
    display               : grid;
    grid-template-columns : repeat(auto-fit,8rem);
    gap                   : 0.5rem;
    justify-content       : center;
    padding-top           : 1rem;
    padding-bottom        : 1rem;
    @media (width < 600px) {
        grid-template-columns : 1fr 1fr;
    }
    @media (width < 400px) {
        grid-template-columns : 1fr;
    }
}


.download-section-item {
    border : 1px solid whitesmoke;
}

.download-section-item-preview {
    display       : flex;
    border-bottom : 1px solid whitesmoke;
    aspect-ratio  : 1;
    background    : whitesmoke;
}

.download-section-item-thumb {
    width      : 100%;
    height     : 100%;
    object-fit : contain;
    padding    : 0.75rem;
    cursor     : zoom-in;
}

.download-section-item-thumb.zoom {
    position   : fixed;
    inset      : 0;
    padding    : 5vmin;
    background : rgba(0,0,0,0.85);
    cursor     : zoom-out;
    z-index    : 9999;
}

.download-link {
    padding     : 0.5rem;
    font-size   : calc(var(--f-size) * var(--f-scale-s));
    line-height : .8rem;
    text-align  : center;
    transition  : color 300ms;
    display     : block;

    &.disabled {
        color : var(--c-gray);
        cursor : not-allowed;
    }
}

.download-link:hover {
    color : var(--c-brand);
}

.download-section-item-placeholder {
    display       : grid;
    width         : 100%;
    align-content : center;
    text-align    : center;
    padding       : 0.25rem;
}

.download-section-item-placeholder span {
    font-size   : calc(var(--f-size) * var(--f-scale-s));
    line-height : 1.15;
    word-break: break-all;
}

.download-section-item-placeholder span:last-child {
    font-style: italic;
    opacity : 0.5;
}