/* 05/11/2026: only presentation for learners and visitors. No rule hides a native action or a block. */

/* Attempt and summary: the Back row's -12px margin exceeded main-inner's 8px padding and widened the phone viewport by 4px. */
.apol-learner .tertiary-navigation > .row { margin-inline: 0; }
.apol-learner .tertiary-navigation > .row > .navitem { padding-inline: 0; }

/* overflow:hidden from an open drawer made #page shrink to the window, which lost the page position. */
.apol-learner #page-wrapper #page.drawers { flex-shrink: 0; }

/* Native block tree: 2rem of list padding per level left 18px for the links. Keeps every entry, including the course administration. */
.apol-native-chrome .drawer .block_tree,
.apol-native-chrome .drawer .block_tree ul { padding-left: 0; margin-left: 0; list-style: none; }
.apol-native-chrome .drawer .block_tree ul ul { padding-left: 12px; }
.apol-native-chrome .drawer .block_tree .tree_item.branch { margin-left: 0; }
.apol-native-chrome .drawer .block_tree .tree_item.branch:not(.hasicon) { padding-left: 0; }
.apol-native-chrome .drawer .block_tree .tree_item,
.apol-native-chrome .drawer .block_tree .tree_item a { min-width: 0; white-space: normal; overflow-wrap: break-word; }

/* The model answer instructions point to Feedback: show the native heading. */
.apol-quiz .que .outcome h4.accesshide {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 0 .5rem !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
}

/* Quiz summary: the quiz name is already the page title. */
#page-mod-quiz-summary.apol-learner [role="main"] > h2:first-of-type { display: none; }

/* Current section stays recognisable while the index starts collapsed. */
#theme_boost-drawers-courseindex .courseindex-section:has(.courseindex-item.pageitem) > .courseindex-section-title .courseindex-link { color: #34548a; }

@media (max-width: 990.98px) {
    /* Same limit as the native drawers: the question lands below the fixed 60px bar. */
    .apol-learner .que { scroll-margin-top: 70px; }
    /* The inline overflow:hidden of an open drawer took the sticky controls out of place and the page position with it. */
    body.apol-native-chrome #page.drawers { overflow: visible !important; }
}
@media (max-width: 767.98px) {
    /* Drawer controls stay reachable below the fixed 60px bar, in their own row. */
    .apol-learner .drawer-toggles {
        top: 60px;
        margin-inline: -8px;
        padding-inline: 8px;
    }
    .apol-learner .drawer-toggles .drawer-toggler { visibility: visible !important; }
    .apol-learner .drawer-toggles:not(:has(.drawer-toggler)) {
        position: static;
        min-height: 0;
        margin-block: 0;
    }
    .apol-learner .que { scroll-margin-top: 116px; }
    /* Same space with or without the footer, so showing it at the end never moves the page. */
    body.apol-learner:has(.stickyfooter) #page.drawers { margin-bottom: var(--sticky-footer-total-height, 4rem); }
}
@media (max-width: 575px) {
    .apol-learner .navbar > .container-fluid { padding-inline: 8px; }
    /* Toggle, brand, affiliation and avatar passed the width by 18px at 360. The brand gives way; every item stays. */
    body.apol-learner.apol-native-chrome .navbar > .container-fluid > .navbar-brand:not(:has(img)) {
        flex: 0 1 158px;
        width: auto;
        min-width: 88px;
        container-type: inline-size;
    }
    body.apol-learner.apol-native-chrome .navbar > .container-fluid > .navbar-brand:not(:has(img))::before { font-size: 14.5cqi; }
}

@media (max-width: 385px) {
    body.apol-learner.apol-native-chrome .navbar > .container-fluid > .navbar-brand:not(:has(img)) { margin-inline-end: 6px !important; }
}

/* Same brand as the course pages on native screens. Below 576px these rules are for learners; the visitor's own rule is in delta 4. */
body.apol-learner.apol-native-chrome .navbar-brand:not(:has(img)) { position: relative; display: inline-flex !important; align-items: center; justify-content: center; width: 158px; min-width: 158px; height: 44px; margin-inline-end: 12px !important; background: #fc823d; font-size: 0; line-height: 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
body.apol-learner.apol-native-chrome .navbar-brand:not(:has(img))::before { content: "APOLOGÉTICA"; color: #fff; font: 700 23px/1 "Apologetica Oswald", sans-serif; letter-spacing: -.02em; }
body.apol-learner.apol-native-chrome .navbar-brand:not(:has(img))::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: #ffc5a3; clip-path: polygon(0 0, 100% 0, 0 100%); }
@media (min-width: 576px) {
    body.apol-native-chrome .navbar-brand:not(:has(img)) { position: relative; display: inline-flex !important; align-items: center; justify-content: center; width: 174px; min-width: 174px; height: 44px; margin-inline-end: 12px !important; background: #fc823d; font-size: 0; line-height: 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
    body.apol-native-chrome .navbar-brand:not(:has(img))::before { content: "APOLOGÉTICA"; color: #fff; font: 700 25px/1 "Apologetica Oswald", sans-serif; letter-spacing: -.02em; }
    body.apol-native-chrome .navbar-brand:not(:has(img))::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: #ffc5a3; clip-path: polygon(0 0, 100% 0, 0 100%); }
}
@media (min-width: 768px) {
    body.apol-native-chrome .navbar-brand:not(:has(img)) { width: 194px; min-width: 194px; }
    body.apol-native-chrome .navbar-brand:not(:has(img))::before { font-size: 28px; }
}

/* Home: the transparent full-width title rotated by -2deg passed the width by 0.6px on each side. 2px less fits the rotated box; the span stays centred and clear of the title's clip-path. */
@media (max-width: 767px) {
    body.apol-home .apol-craig-copy h2#apol-craig-title { width: calc(100% - 2px); margin-inline: auto; }
}

/* delta 4 start */
/* Own header (home, course, help): 18+184+12+47+12+85.6 passed the width below 359px. The wordmark gives way; menu and user stay. */
@media (max-width: 374.98px) {
    .apol-native-chrome .apol-header { padding-inline: 10px; gap: 8px; }
    .apol-native-chrome .apol-header .apol-brand { flex: 0 1 184px; min-width: 88px; }
    .apol-native-chrome .apol-header .apol-wordmark { width: 100%; flex-shrink: 1; min-width: 0; }
}

/* Public course information: the summary's min-content pushed the column past the page beside the image. */
body.apol-native-chrome#page-course-info .coursebox .content > .d-flex > .flex-grow-1 { min-width: 0; }
@media (max-width: 575px) {
    body.apol-native-chrome#page-course-info .coursebox .content > .d-flex { flex-direction: column; }
}

/* Visitor on native screens: the same brand, now that its room is measured. Protected layouts and policy, consent and sign-in screens stay out. */
@media (max-width: 575px) {
    body.apol-native-chrome.notloggedin:not(.apol-policy):not(.apol-policy-reading):not(.apol-onboarding):not(.apol-auth) .navbar > .container-fluid { padding-inline: 8px; }
    body.apol-native-chrome.notloggedin:not(.apol-policy):not(.apol-policy-reading):not(.apol-onboarding):not(.apol-auth) .navbar > .container-fluid > .navbar-brand:not(:has(img)) { position: relative; display: inline-flex !important; align-items: center; justify-content: center; flex: 0 1 158px; width: auto; min-width: 88px; height: 44px; margin-inline-end: 12px !important; background: #fc823d; font-size: 0; line-height: 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); container-type: inline-size; }
    body.apol-native-chrome.notloggedin:not(.apol-policy):not(.apol-policy-reading):not(.apol-onboarding):not(.apol-auth) .navbar > .container-fluid > .navbar-brand:not(:has(img))::before { content: "APOLOGÉTICA"; color: #fff; font: 700 23px/1 "Apologetica Oswald", sans-serif; font-size: 14.5cqi; letter-spacing: -.02em; }
    body.apol-native-chrome.notloggedin:not(.apol-policy):not(.apol-policy-reading):not(.apol-onboarding):not(.apol-auth) .navbar > .container-fluid > .navbar-brand:not(:has(img))::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: #ffc5a3; clip-path: polygon(0 0, 100% 0, 0 100%); }
}
@media (max-width: 385px) {
    body.apol-native-chrome.notloggedin:not(.apol-policy):not(.apol-policy-reading):not(.apol-onboarding):not(.apol-auth) .navbar > .container-fluid > .navbar-brand:not(:has(img)) { margin-inline-end: 6px !important; }
}
/* delta 4 end */

/* delta 5 start */
/* Visitor on the public course information: the fixed blocks button sat over the text. Own row below the fixed bar, as for learners; the drawer and its blocks stay. */
@media (max-width: 767.98px) {
    body.apol-native-chrome.notloggedin#page-course-info .drawer-toggles:has(.drawer-toggler) { display: flex; position: sticky; top: 60px; z-index: 98; min-height: 48px; justify-content: space-between; background: #fff; margin-inline: -8px; margin-bottom: 8px; padding-inline: 8px; }
    body.apol-native-chrome.notloggedin#page-course-info .drawer-toggles .drawer-toggler { position: static !important; transform: none !important; visibility: visible !important; margin: 0; }
    body.apol-native-chrome.notloggedin#page-course-info .drawer-toggles .drawer-toggler button { min-width: 44px; min-height: 44px; border-radius: 4px; }
}
/* delta 5 end */
