

.flex-container{
    display: flex;
    flex-wrap: wrap;
    margin-left: -.75rem;
    margin-right: -.75rem;
}
.flex-container > *{ padding-left: .75rem; padding-right: .75rem; }

.work-detail{
    padding: 7.5rem var(--pad) 1.5rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.work-detail .work-detail-info{ margin-bottom: 6rem; }

.work-detail .title,
.work-detail .subtitle{ width: calc(100% / 12 * 3); font-size: 1.2rem; }

.work-detail .subtitle-link{
    width: calc(100% / 12 * 3);
    text-decoration: underline;
}

.work-detail .text{ width: calc(100% / 12 * 6); font-size: 1.2rem; }
.work-detail .text p + p{ margin-top: 1.2rem; }

.work-detail a:hover{ text-decoration: underline; }

.work-detail .work-detail-image{ margin-bottom: 1.5rem; }
.work-detail .work-detail-image img{ width: 100%; height: auto; display: block; }

.work-detail-image-half{ margin-bottom: 1.5rem; width: 50%; }
.work-detail-image-grid-three{ margin-bottom: 1.5rem; width: 33.33%; }
.work-detail-image-grid-five{ margin-bottom: 1.5rem; width: 20%; }
.work-detail-image-gif{ width: 50%; }

.work-detail-videos-3{ width: calc(100% / 3); }
.work-detail-video{ width: 50%; }
.work-detail-video-full{ width: 100%; }

.work-detail-container{
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
}
.work-detail-container iframe{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 820px){
    .work-detail{ padding-top: 6rem; }
    .work-detail .title,
    .work-detail .subtitle,
    .work-detail .subtitle-link,
    .work-detail .text{ width: 100%; margin-top: 1.5rem; }
    .work-detail .work-detail-info{ margin-bottom: 3rem; }
    .work-detail-image-half,
    .work-detail-image-grid-three,
    .work-detail-image-grid-five,
    .work-detail-image-gif,
    .work-detail-videos-3,
    .work-detail-video{ width: 100%; }
}

/* extras for the existing project markup */
.work-detail + .work-detail{ padding-top: 1.5rem; }
.flex-container > .work-detail-image{ width: 100%; }
.work-detail video{ display: block; width: 100%; height: auto; margin-bottom: 1.5rem; }

/* project info: same 12-column grid as the header, text starts under "Work" */
.work-detail .work-detail-info .flex-container{
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    margin: 0;
}

.work-detail .work-detail-info .flex-container > *{
    width: auto;
    padding: 0 1.5rem 0 0;
}

.work-detail .work-detail-info .title{ grid-column: 1 / 5; }
.work-detail .work-detail-info .subtitle{ grid-column: 5 / 9; }
.work-detail .work-detail-info .text{ grid-column: 9 / 13; padding-right: 0; }

@media (max-width: 820px){
    .work-detail .work-detail-info .flex-container{ grid-template-columns: 1fr; }
    .work-detail .work-detail-info .title,
    .work-detail .work-detail-info .subtitle,
    .work-detail .work-detail-info .text{ grid-column: 1 / -1; padding-right: 0; }
}
