/**
 * Course preview for archives and search results
 **/

.course-preview {
    background-color: #fff;
    position: relative;
}

.course-preview .entry-header {
    margin-bottom: 0;
    margin-top: 0;
}

.course-preview .entry-title {
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.3;
}

.course-preview .entry-meta ul {
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.course-preview .course-confirmed {
    background-color: transparent;
    border: unset;
    display: flex;
    font-size: 0.95em;
    font-weight: 400;
    padding: 0;
}

.course-preview .course-confirmed:focus {
    border-bottom: 2px dotted var(--wp--preset--color--link-hover);
    color: var(--wp--preset--color--link-hover);
    outline: none;
}

.course-preview .course-place {
    display: flex;
    font-size: 0.95em;
    margin-bottom: 0;
}

.course-preview .course-confirmed .icon,
.course-preview .course-place .icon {
    color: var(--wp--preset--color--accent);
    margin-right: 0.25em;
    min-width: 1em;
    padding-top: 0.125em;
    text-align: center;
}

.course-preview .course-requirement .icon {
    margin-right: 0.4em;
}

.course-preview .course-confirmed svg,
.course-preview .course-place svg,
.course-preview .course-requirement svg {
    height: 0.9em;
}

/* Confirmed sessions table */

.confirmed-sessions > button {
    text-align: left;
}

.confirmed-sessions + .confirmed-sessions {
    margin-top: 0.4em;
}

.course-preview .confirmed-dates {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    width: 100%;
}

.course-preview .course-code {
    background-color: #ffffff60;
    display: block;
    font-size: 0.8em;
    position: absolute;
    bottom: 0;
    right: 0;
    line-height: 1;
    padding: 0.25em;
}

.course-preview .confirmed-dates.open {
    background-color: #00000040;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-preview .confirmed-dates.open .confirmed-dates_content {
    background-color: #fff;
    max-width: 38em;
    padding: 1em;
    position: relative;
    width: 100%;
}

.course-preview .open-dates {
    color: var(--wp--preset--color--link-hover);
    cursor: pointer;
    line-height: 1.2;
    text-decoration: underline dotted;
}

.course-preview .modal-toggle:hover .open-dates {
    text-decoration-style: solid;
}

.course-preview .modal-toggle:focus .open-dates {
    text-decoration: none;
}

.course-preview .close-dates {
    background-color: #fff;
    color: var(--wp--preset--color--link-hover);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    justify-content: flex-end;
    font-size: 1em;
    font-weight: 500;
    padding: 0.5em 0.75em;
    position: absolute;
    top: -2em;
    right: 0;
    text-transform: uppercase;
}

.confirmed-dates .course_name {
    color: var(--wp--preset--color--accent);
    font-size: 1.125em;
    display: block;
}

.confirmed-dates>p {
    font-size: 0.82rem;
    text-align: center;
    width: 100%;
}

.course-preview .confirmed-dates_list {
    border-collapse: collapse;
    margin-top: 0;
    margin-bottom: 0.25em;
}

.course-preview .confirmed-dates_list thead th {
    background-color: var(--wp--preset--color--link-hover);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25em;
    text-align: center;
    width: 100%;
}

.course-preview .confirmed-dates_list td {
    padding: 0.125em 0.25em 0.3em 0.5em;
}

.course-preview .confirmed-dates_list tr:nth-child(even) td {
    background-color: var(--wp--preset--color--light);
}

/* Table Navigation */

.paging-nav {
    margin: 0.25em 0 1em;
    text-align: center;
}

.paging-nav a {
    display: inline-block;
    margin-left: 0.375em;
    margin-right: 0.375em;
    text-decoration: none;
}

.paging-nav a:first-child {
    margin-left: 0;
    margin-right: 1.5em;
}

.paging-nav a:last-child {
    margin-left: 1.5em;
    margin-right: 0;
}

.hide-pagination .paging-nav {
    display: none;
}

.course-preview .confirmed-dates .buttons {
    text-align: center;
}

.course-preview .confirmed-dates ul {
    list-style: none;
    padding-left: 0;
}

.course-preview .locations-list a {
    text-decoration: none;
}

.course-preview .locations-list a:hover {
    text-decoration: underline;
}

.course-preview .post-thumbnail {
    overflow: hidden;
}

.course-preview .post-thumbnail .sash {
    font-size: 0.85em
}

.course-preview .entry-meta li {
    margin-bottom: 0.5em;
    padding-left: 26px;
    position: relative;
}

.course-preview .entry-meta li:last-child {
    margin-bottom: 0;
}

.course-preview .entry-meta li .svg-icon {
    color: var(--wp--preset--color--accent);
    position: absolute;
    left: 0;
}

.course-preview .share-course button {
    background-color: transparent;
    border: unset;
    color: var(--wp--preset--color--link);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2em;
    margin: 0;
    padding: 0;
    width: 2em;
}

.course-preview .share-course button:hover {
    background-color: var(--wp--preset--color--light);
    color: var(--wp--preset--color--link-hover);
}

/* Retreat variation */

.course-preview .retreat-note {
    background-color: var(--wp--preset--color--link-hover);
    color: var(--wp--preset--color--white);
    display: flex;
    justify-content: space-between;
    padding: 0.2em 0.4em;
}

@media (max-width: 500px) {
    .course-preview .confirmed-dates {
        overflow-y: auto;
    }
    .course-preview .confirmed-dates_list td {
        width: auto;
    }
    .course-preview .confirmed-dates_list td:first-child {
        width: auto;
    }
}

@media (max-width: 767px) {
    .course-preview {
        display: grid;
        gap: 1em;
        grid-template-columns: 2fr 1fr 120px;
        grid-template-rows: repeat(3, auto) 1fr;
        margin-bottom: 0;
        margin-left: calc(var(--regular-padding) * -1);
        padding: 1.5em var(--regular-padding);
        max-width: none;
        width: calc(100% + 2 * var(--regular-padding));
    }
    .course-preview:nth-child(even) {
        background-color: var(--wp--preset--color--light);
    }
    .course-preview .entry-header {
        align-self: center;
        grid-column: 1 / 4;
        grid-row: 1 / 2;
        margin-bottom: 0;
        margin-top: 0;
    }
    .course-preview .entry-title {
        font-size: 1.2em;
    }
    .course-preview .course-place {
        border-bottom: solid 1px var(--wp--preset--color--accent);
        font-size: 0.9em;
        grid-column: 1 / 4;
        grid-row: 2 / 3;
        margin-bottom: 0;
        margin-top: -0.6em;
        padding-bottom: 0.4em;
    }
    .course-preview .post-thumbnail {
        grid-column: 3 / 4;
        grid-row: 3 / 4;
        min-height: 100px;
    }
    .course-preview .post-thumbnail>.wp-post-image {
        height: 100%;
        object-fit: cover;
    }
    .course-preview .course-code {
        display: none;
    }
    .course-preview .entry-meta {
        font-size: 0.9em;
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        line-height: 1.35;
        width: 100%;
    }
    .course-preview .entry-meta ul {
        margin-bottom: 0;
        padding-left: 0;
    }
    .course-preview .entry-excerpt {
        display: none;
    }
    .course-preview > .confirmed-sessions,
    .course-preview .confirmed-sessions_wrapper {
        background-color: transparent;
        grid-column: 1 / 3;
        grid-row: 4 / 5;
        align-self: center;
    }
    .course-preview .share-course {
        grid-column: 3 / 4;
        grid-row: 4 / 5;
        justify-self: end;
    }
    .course-preview.retreat {
        padding-top: 0;
    }
    .course-preview.retreat .retreat-note {
        font-size: 0.8em;
        grid-column: 1 / 4;
        grid-row: 1 / 2;
    }
    .course-preview.retreat .entry-header {
        grid-row: 2 / 3;
    }
    .course-preview.retreat .course-place {
        grid-row: 3 / 4;
    }
    .course-preview.retreat .entry-meta {
        grid-row: 4 / 5;
    }
    .course-preview.retreat .post-thumbnail {
        grid-row: 4 / 5;
    }
    .course-preview.retreat > .confirmed-sessions,
    .course-preview.retreat .confirmed-sessions_wrapper {
        grid-row: 5 / 6;
    }
    .course-preview.retreat .share-course {
        grid-row: 5 / 6;
    }
}

@media (min-width: 768px) {
    .course-preview {
        border: 1px solid var(--wp--preset--color--dark-gray);
        display: grid;
        gap: 0.75em 2.5em;
        grid-template-columns: 220px 2.5fr 1fr;
        grid-template-rows: auto auto auto 1fr auto;
        max-width: none;
        padding: 2em 2.5em 2em 2em;
    }
    .course-preview .entry-header {
        grid-column: 2 / 4;
        grid-row: 1 / 2;
        padding: 0;
    }
    .course-preview .entry-header .entry-title {
        font-size: 1.3em;
    }
    .course-preview .entry-header a {
        text-decoration: none;
    }
    .course-preview .entry-header a:hover {
        text-decoration: underline solid;
    }
    .course-preview .course-place {
        font-size: 1em;
        grid-column: 2 / 4;
        grid-row: 2 / 3;
        padding: 0;
    }
    .course-preview .post-thumbnail {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
    }
    .course-preview .post-thumbnail .course-code {
        bottom: unset;
        left: 0;
        right: unset;
        top: 0;
    }
    .course-preview .entry-meta {
        font-size: 0.9em;
        grid-column: 1 / 2;
        grid-row: 4 / 6;
        padding: 0;
    }
    .course-preview .entry-excerpt {
        grid-column: 2 / 4;
        grid-row: 3 / 5;
        margin-top: 0;
        padding: 0;
    }
    .course-preview .course-confirmed {
        font-size: 1em;
    }
    .course-preview > .confirmed-sessions,
    .course-preview .confirmed-sessions_wrapper {
        grid-column: 2 / 3;
        grid-row: 5 / 6;
        align-self: center;
    }
    .course-preview .share-course {
        grid-column: 3 / 4;
        grid-row: 5 / 6;
        text-align: right;
    }
    .course-preview.retreat {
        padding-top: 0;
    }
    .course-preview.retreat .retreat-note {
        grid-column: 1 / 4;
        grid-row: 1 / 2;
        margin-left: -2em;
        padding-left: 2em;
        padding-right: 2em;
        width: calc(100% + 4.5em);
    }
    .course-preview.retreat .entry-header {
        grid-row: 2 / 3;
    }
    .course-preview.retreat .course-place {
        grid-row: 3 / 4;
    }
    .course-preview.retreat .post-thumbnail {
        grid-row: 2 / 5;
    }
    .course-preview.retreat .entry-meta {
        grid-row: 5 / 7;
    }
    .course-preview.retreat .entry-excerpt {
        grid-row: 4 / 6;
    }
    .course-preview.retreat > .confirmed-sessions,
    .course-preview.retreat .confirmed-sessions_wrapper {
        grid-row: 6 / 7;
    }
    .course-preview.retreat .share-course {
        grid-row: 6 / 7;
    }
}

@media (min-width: 1024px) {
    .course-preview .post-thumbnail {
        overflow: hidden;
    }
    .course-preview .post-thumbnail img:first-child {
        transition: transform 0.3s ease-in;
    }
    .course-preview .post-thumbnail:hover img:first-child {
        transform: scale(1.2)
    }
}
