/* Course 143 only. Native photographs, links, consultation sections and editor stay intact. */
body.course-143.format-tiles:not(.editing) #format_tiles_overlay {
    width: 100% !important;
}

body.course-143.format-tiles:not(.editing) #format-tiles-multi-section-page.study-teacher-gallery {
    width: 100%;
    max-width: 100% !important;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #section-zero-container > .row,
body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > .moveablesection > .pagesechead > .row {
    margin-inline: 0;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
    align-items: stretch;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > .spacer {
    display: none !important;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > .moveablesection {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    max-width: 100% !important;
    margin: 0;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile:not(.spacer) {
    display: flex;
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0;
    margin: 0 !important;
    padding: 0;
    border: 1px solid #dce0e5 !important;
    border-radius: 8px;
    background-color: #fff;
    background-size: 0 0 !important;
    box-shadow: 0 1px 3px #2021240d;
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile:hover,
body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile:focus-within {
    border-color: var(--study-brand, #7000c8) !important;
    box-shadow: 0 3px 10px #20212414;
    transform: none;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile > .tile-link {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative !important;
    inset: auto;
    width: 100%;
    height: auto !important;
    min-width: 0;
    min-height: 100%;
    color: #24262b;
    text-decoration: none;
    background-image: inherit;
    background-size: 0 0;
    border-radius: inherit;
}

/* Inherit the assigned photo URL; contain keeps the full portrait, including its edges. */
body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.phototile > .tile-link::before {
    content: "";
    display: block;
    flex: none;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 200px;
    background-image: inherit;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-color: #f2f3f5;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.phototile > .tile-link > [id^="tileText-"] {
    padding: 0;
    width: 100%;
    min-width: 0;
    flex: 1;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .photo-tile-text,
body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-text {
    position: static !important;
    width: 100%;
    height: auto;
    min-height: 5.5rem;
    margin: 0 !important;
    padding: .85rem 1rem !important;
    border-top: 1px solid #e6e8ec;
    background: #fff !important;
    color: #24262b !important;
    text-align: left;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles h3 {
    display: block;
    position: static;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: auto;
    color: #24262b !important;
    background: transparent !important;
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.45 !important;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .phototile .tile-text,
body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-bg {
    display: none;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-content {
    display: flex;
    flex-direction: column;
    position: static;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-top {
    display: grid;
    place-items: center;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 200px;
    margin: 0;
    background: #f2f3f5;
    flex: none;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tileiconcontainer {
    position: static;
    float: none;
    margin: 0;
    padding: 0;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile-textinner {
    position: static;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}

body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile-link:focus-visible {
    outline: 3px solid var(--study-brand, #7000c8);
    outline-offset: -3px;
    box-shadow: none;
}

body.course-143.format-tiles.format-tiles-high-contrast:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile:not(.spacer) {
    border-color: #24262b !important;
}

@media (max-width: 575px) {
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.phototile > .tile-link,
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-content {
        display: grid;
        grid-template-columns: minmax(80px, 30%) minmax(0, 1fr);
        align-items: stretch;
    }
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.phototile > .tile-link::before,
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-top {
        aspect-ratio: 3 / 4;
        min-height: 8.5rem;
        max-height: none;
        height: 100%;
    }
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.phototile > .tile-link > [id^="tileText-"] {
        display: flex;
        align-items: center;
        background: #fff;
    }
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .photo-tile-text,
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles .tile:not(.phototile) .tile-text {
        display: flex;
        align-items: center;
        min-height: 0;
        border-top: 0;
        padding: .75rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.course-143.format-tiles:not(.editing) .study-teacher-gallery #multi_section_tiles > li.tile:not(.spacer) {
        transition: none;
    }
}
