:root {
    --student-classroom-frame-width: 100%;
    --student-course-container-max: 1080px;
    --student-content-width: min(calc(100% - 30px), var(--student-classroom-frame-width), calc(var(--student-course-container-max) - 30px));
}

@media (min-width: 768px) { :root { --student-classroom-frame-width: 720px; } }
@media (min-width: 992px) { :root { --student-classroom-frame-width: 940px; } }
@media (min-width: 1200px) { :root { --student-classroom-frame-width: 1140px; } }

/* Share the profile band's outer edges across the student activity and preview shells. */
body.student-page-learn .profile > .container,
body.student-dashboard-skin .container.education-game-page-shell,
html body .container.staff-activity-preview-shell,
html body .public-exam-page > .container {
    box-sizing: border-box;
    width: var(--student-content-width);
    max-width: 100%;
    padding-inline: 0;
    margin-inline: auto;
}

html body .staff-activity-preview-shell .public-exam-page > .container {
    width: 100%;
}

body.student-page-learn .profile > .container > .row,
body .staff-activity-preview-shell > .row,
body :is(.student-page-learn .student-content-slot, .staff-activity-preview-shell .staff-main, .student-workshop-view, .student-workshop-view > .blog) > .row {
    margin-inline: 0;
}

body.student-page-learn .profile > .container > .row > .col-md-12,
body .staff-activity-preview-shell > .row > .staff-main {
    min-width: 0;
    padding-inline: 0;
}

body.student-page-learn .student-content-slot,
body .staff-activity-preview-shell,
body .education-game-play,
body .public-exam-page {
    overflow-wrap: anywhere;
}

:is(.student-page-learn .student-content-slot, .staff-activity-preview-shell, .public-exam-page)
    :is(img, video, iframe, canvas, input[type="file"]) {
    max-width: 100%;
}

.student-workshop-instructions > div { overflow-x: auto; }

.student-course-band {
    --student-band-gradient-direction: 90deg;
    --student-band-ink: #0c2b25;
    --student-band-divider: rgb(31 111 95 / 28%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px 20px;
    min-width: 0;
    margin: 0 0 16px;
    padding: 20px;
    border: 1px solid #8dbbab !important;
    border-radius: var(--student-band-radius, 8px) !important;
    background: linear-gradient(var(--student-band-gradient-direction), #1f6f5f 0%, #2fa084 8%, #6fcf97 21%, #eee 100%);
    color: var(--student-band-ink);
    font-family: var(--site-font-primary, "Noto Sans Thai Looped", Tahoma, sans-serif);
    text-align: start;
}

.student-course-band-avatar {
    display: block;
    width: clamp(72px, 8vw, 96px);
    border: 2px solid #fff;
    border-radius: 12px !important;
    background: #fff;
    overflow: hidden;
}

.student-course-band-avatar img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.student-course-band-avatar:focus-visible {
    outline: 2px solid #145b83;
    outline-offset: 3px;
}

.student-course-band-details { min-width: 0; }

.student-course-band-identity,
.student-course-band-identity > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    min-width: 0;
}

.student-course-band-identity {
    gap: 6px 18px;
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--student-band-divider);
}
.student-course-band-identity:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

.student-course-band-identity > div { gap: 4px 7px; }
.student-course-band-identity dt { font-weight: 400; }
.student-course-band-identity dd { margin: 0; }

.student-course-band :is(.student-course-band-title, dt, dd) {
    color: var(--student-band-ink) !important;
    font-family: inherit;
    font-size: var(--student-band-identity-size, 18px) !important;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.student-course-band .student-course-band-title {
    flex: 1 1 340px;
    min-width: 0;
    margin: 0;
    font-weight: 600;
}

.student-course-band-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.student-course-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-inline-start: auto;
    max-width: 100%;
}

.student-course-band-actions > .btn { white-space: nowrap; }

.student-dashboard-skin:has(.student-course-band-back) .student-course-back-fallback {
    display: none !important;
}

@media (min-width: 992px) {
    .student-course-band { column-gap: clamp(56px, 6.4vw, 90px); }
    .student-course-band-avatar { margin-inline-start: 22px; }
}

@media (min-width: 992px) and (min-height: 720px) {
    body.student-dashboard-skin:has(.student-course-band) {
        --student-pinned-band-space: 148px;
    }

    .student-dashboard-skin .student-course-band {
        position: sticky;
        top: var(--student-header-height, 82px);
        z-index: 990;
    }

    body.student-dashboard-skin:has(.student-course-band) :is(#student-learning-progress,
        .student-unit-page [id^="unit-"], #workshop-submission-receipt) {
        scroll-margin-top: calc(var(--student-header-height, 82px) + var(--student-pinned-band-space));
    }
}

body.student-page-learn:has(.student-course-band) :is(.breadcrumbs-v4, .student-profile-top-space,
    .student-content-top-space, .student-course-heading) {
    display: none !important;
}

body.student-page-learn:has(.student-course-band) .profile { padding-top: 24px; }

@media (max-width: 600px) {
    .student-course-band { padding: 16px 12px; }
    body.student-page-learn:has(.student-course-band) .profile { padding-top: 16px; }
}

@media (max-width: 520px) {
    .student-course-band {
        --student-band-gradient-direction: 145deg;
        gap: 10px 12px;
        align-items: start;
        --student-band-identity-size: 16px;
    }

    .student-course-band-details { display: contents; }

    .student-course-band-identity {
        gap: 4px 10px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .student-course-band-footer {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid var(--student-band-divider);
    }

    .student-course-band .student-course-band-title { flex-basis: 100%; }
}
