/* Contrato dos headers internos no mobile. Não alcança formulários públicos,
   conteúdo, menus suspensos ou modais inseridos dentro do cabeçalho. */
.course-module-edit-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  /* Header e subheader formam uma superfície contínua. Prevalece também
     sobre sombras utilitárias/de rolagem, sem afetar menus, cards ou desktop. */
  body #main .page-heading.fixed-top,
  body #main .home-page__mobile-header {
    box-shadow: none !important;
  }

  /* Ações de atualizar fora do header: preservam o contexto via aria-label e
     liberam a linha para os dados principais no mobile. */
  body .mobile-icon-only {
    align-items: center;
    display: inline-flex;
    flex: 0 0 38px;
    gap: 0;
    height: 38px;
    justify-content: center;
    min-width: 38px;
    padding-inline: 0;
    width: 38px;
  }

  body .mobile-icon-only .mobile-icon-only__label {
    display: none;
  }

  body .mobile-icon-only :is(i, .spinner-border) {
    margin: 0 !important;
  }

  /* Cabeçalhos com atualização: texto flexível e ação na mesma linha. */
  body .mobile-refresh-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  body .mobile-refresh-row > :first-child:not(.mobile-icon-only) {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body .mobile-refresh-row > .mobile-icon-only {
    align-self: flex-start;
    margin-left: auto;
  }

  /* Padrão de ações do header: só ícone; área de toque sem caixa visual.
     Contrato e adoção: docs/mobile-header-actions.md. */
  body #main .page-heading.fixed-top .mobile-header__icon-button {
    appearance: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--ictus-white);
    cursor: pointer;
    font: inherit;
  }

  body #main .page-heading.fixed-top .mobile-header__icon-button:is(:hover, :active, :focus) {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body #main .page-heading.fixed-top .mobile-header__icon-button:is(.is-active, :hover) {
    color: var(--ictus-cyan-light);
  }

  body #main .page-heading.fixed-top .mobile-header__icon-button i {
    color: inherit;
    font-size: 20px;
    margin: 0;
  }

  body #main .page-heading.fixed-top .mobile-header__icon-button:focus-visible {
    outline: 2px solid var(--ictus-cyan-light);
    outline-offset: 2px;
  }

  /* Seletores explícitos para todo o fluxo de Cursos, inclusive aulas. */
  body #main .course-module-heading h3,
  body #main .course-module-heading .burger-btn,
  body #main .course-module-heading .burger-btn i {
    color: var(--ictus-white);
  }

  body #main .course-module-heading .text-subtitle {
    display: none !important;
  }

  body #main .page-heading.fixed-top.course-module-heading .box-notification {
    align-items: center;
    display: flex;
    position: relative;
  }

  body #main .course-module-heading .course-module-edit-mobile {
    align-items: center;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    margin-right: 8px;
    padding: 0;
    width: 36px;
  }

  body #main .page-heading.fixed-top,
  body #main .home-page__mobile-header {
    background-color: var(--ictus-blue);
    background-image: none;
    color: var(--ictus-white);
  }

  body.theme-dark #main .page-heading.fixed-top,
  body.theme-dark #main .home-page__mobile-header {
    background-color: var(--ictus-midnight);
  }

  body #main .page-heading.fixed-top :is(h1, h2, h3, .h3):not(.modal *, dialog *, .dropdown-menu *, .offcanvas *) {
    color: var(--ictus-white);
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 0;
  }

  body #main .page-heading.fixed-top .text-subtitle:not(.modal *, dialog *, .dropdown-menu *, .offcanvas *) {
    display: none !important;
  }

  body #main .page-heading.fixed-top :is(.burger-btn, .header-menu-responsive .btn, .box-notification a, .project-heading-breadcrumb a, .project-heading-breadcrumb i) {
    color: var(--ictus-white);
  }

  body #main .page-heading.fixed-top :is(.burger-btn, .header-menu-responsive .btn, .box-notification a) i {
    color: inherit;
  }

  body #main .page-heading.fixed-top .btn:not(.mobile-header__icon-button, .modal *, dialog *, .dropdown-menu *, .offcanvas *) {
    background-color: rgba(var(--ictus-white-rgb), .12);
    border-color: rgba(var(--ictus-white-rgb), .45);
    color: var(--ictus-white);
  }

  body #main .page-heading.fixed-top .btn:not(.modal *, dialog *, .dropdown-menu *, .offcanvas *) :is(i, span):not(.badge) {
    color: inherit;
  }

  body #main .page-heading.fixed-top .btn:not(.mobile-header__icon-button, .modal *, dialog *, .dropdown-menu *, .offcanvas *):is(:hover, :focus-visible) {
    background-color: rgba(var(--ictus-white-rgb), .22);
  }
}
