/*
 * TPSTA UI fixes — Moodle Boost theme shims.
 *
 * 2026-05-11: Course-edit activity action menus get clipped/covered by
 * sibling activity tiles, making it hard to click "Delete". Two root
 * causes: parents set overflow:hidden, and the open .dropdown-menu sits
 * at the same z-index as later activity tiles. Force overflow:visible on
 * the relevant ancestors and lift the open menu above the rest.
 */

.course-content,
.course-content > ul.section,
.course-content > ul.section > li.section,
.course-content > ul.section > li.section .content,
.course-content > ul.section > li.section .summary,
.course-content ul.section,
.course-content ul.section > li.activity,
.course-content ul.section > li.activity > div,
.course-content li.activity .actions {
    overflow: visible !important;
}

/* Lift the action-menu dropdown above every adjacent activity tile.
   1080 sits above .modal-backdrop's 1040 but below modals' 1050+. */
.action-menu .dropdown-menu,
.action-menu .dropdown-menu.show,
.course-content .action-menu .dropdown-menu,
.course-content .activity .action-menu .dropdown-menu,
.course-content .section .action-menu .dropdown-menu {
    z-index: 1080 !important;
}

/* Ensure the action-menu trigger itself can claim a stacking context so
   its dropdown isn't ambushed by hover targets in adjacent tiles. */
.course-content .activity .actions,
.course-content .activity .action-menu {
    position: relative;
    z-index: 1;
}

/* When the menu is open, raise the whole activity row so the dropdown
   doesn't fight pointer events with the next activity. */
.course-content .activity:has(.action-menu .dropdown-menu.show),
.course-content .activity.action-menu-shown {
    z-index: 100;
    position: relative;
}
