.root {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 60px;
    gap: 28px;
    max-width: var(--content-max-width);
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    width: 100%;
    padding-left: 8px;
}

.backButton {
    display: flex;
    justify-content: flex-start;
    z-index: 1;
}

.studies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(407px, 1fr));
    place-items: center;
    column-gap: 48px;
}

.studyCard {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.buttonContainer {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
}

/* put these under media to not override for every other screen width */
@media (width >= 1341px) {
    /* hide left dividers for 1, 4, 7, etc studies */
    .studyCard:nth-child(3n + 1) [data-line='left'] {
        display: none;
    }

    /* hide right dividers for 3, 6, 9, etc studies */
    .studyCard:nth-child(3n + 3) [data-line='right'] {
        display: none;
    }

    /* hide double horizontal dividers by moving -1px left all except 1, 4, 7, etc */
    .studyCard:not(:nth-child(3n + 1)) {
        margin-left: -1px;
    }

    /* hide double vertical dividers by moving -1px top all except 1, 2, 3 only */
    .studyCard:nth-child(n + 4) {
        margin-top: -1px;
    }
}

/* only 2 columns fit from this screen width */
@media (width <= 1340px) {
    /* hide left dividers for 1, 3, 5, etc studies */
    .studyCard:nth-child(2n + 1) [data-line='left'] {
        display: none;
    }

    /* hide right dividers for 2, 4, 6, etc studies */
    .studyCard:nth-child(2n + 2) [data-line='right'] {
        display: none;
    }

    /* hide double horizontal dividers by moving -1px left all except 1, 3, 5, etc */
    .studyCard:not(:nth-child(2n + 1)) {
        margin-left: -1px;
    }

    /* hide double vertical dividers by moving -1px top all except 1, 2 only */
    .studyCard:nth-child(n + 3) {
        margin-top: -1px;
    }
}

@media (width <= 981px) {
    .container {
        padding: 40px 20px 24px;
        gap: 16px;
    }

    .studies {
        display: grid;
        grid-template-columns: 1fr;
        place-items: center;
    }

    .studyCard:last-child::after {
        display: none;
    }

    .buttonContainer {
        margin-left: 0;
        margin-right: 0;
    }
}
