/* v1.1.0.25: mobile card menus, unified login canvas and compact category labels. */
@layer faster-ui {
  .faster-theme-toggle {
    appearance:none!important;display:inline-grid!important;place-items:center!important;
    width:44px!important;height:44px!important;min-width:44px!important;margin-inline:6px!important;
    padding:0!important;border:0!important;border-radius:12px!important;
    background:var(--ui-surface-2)!important;color:var(--ui-text)!important;box-shadow:none!important;
  }
  .faster-theme-toggle__sun,.faster-theme-toggle__moon {grid-area:1/1;width:20px;height:20px;background:currentColor}
  .faster-theme-toggle__sun {-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42'/%3E%3C/svg%3E") center/contain no-repeat}
  .faster-theme-toggle__moon {-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E") center/contain no-repeat}
  :root[data-faster-theme="dark"] .faster-theme-toggle__moon,
  :root[data-faster-theme="light"] .faster-theme-toggle__sun {display:none!important}

  /* Moodle's second header switch is Edit mode. Keep its function explicit for staff. */
  .navbar .editmode-switch-form {display:flex!important;align-items:center!important;gap:8px!important}
  .navbar .editmode-switch-form label {color:var(--ui-text-2)!important;font-size:.78rem!important;font-weight:700!important;white-space:nowrap!important}

  /* A surface owns the contrast of its content. This closes gaps left by plugin-specific hard-coded whites. */
  body:not(#page-local-fasterplatform-modules-pages-view) :is(.fp-card,.fp-task-card,.fp-module-card,.fp-status-card,.fp-list-item,.fp-reminder-card,.fp-health-card,.card,.generalbox,.box,.alert) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,strong,small) {color:inherit!important;text-shadow:none!important}
  body:not(#page-local-fasterplatform-modules-pages-view) :is(.fp-card,.fp-task-card,.fp-module-card,.fp-status-card,.fp-list-item,.fp-reminder-card,.fp-health-card) :is(.fp-meta,.fp-list-meta,.fp-module-desc,.fp-module-version,.text-muted) {color:var(--ui-text-2)!important}
  body:not(#page-local-fasterplatform-modules-pages-view) :is(.bg-white,.bg-light,.table-light,.card.bg-white,.alert-light) {background:var(--ui-surface)!important;color:var(--ui-text)!important}
  /* Legacy Moodle regions sometimes force white headings independently of their surface. */
  body:not(#page-local-fasterplatform-modules-pages-view) :is(#region-main,.main-inner,#page-content,.card,.block,.generalbox,.box,.modal-content,.drawer,.dropdown-menu) :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6) {color:var(--ui-text)!important;text-shadow:none!important}
  body:not(#page-local-fasterplatform-modules-pages-view) :is(#region-main,.main-inner,#page-content) :is(.bg-white,.bg-light,[class*="bg-white"],[class*="bg-light"]) {background:var(--ui-surface)!important;color:var(--ui-text)!important}

  /* Login must be readable in both appearances, including the formerly white form island. */
  body#page-login-index,
  body.pagelayout-login,
  body.pagelayout-login :is(.fast-login-shell,.fast-login-panel,.fast-login-panel__inner,#page,#page-wrapper,#page-content,#region-main,.main-inner,.login-wrapper,.login-container,.loginform) {background:var(--ui-bg)!important;color:var(--ui-text)!important}
  body#page-login-index :is(.login-container,.loginform,.login-form) {background:var(--ui-surface)!important;border:0!important;border-radius:18px!important;box-shadow:var(--ui-shadow-1)!important}
  body#page-login-index :is(.login-container,.loginform,.login-form) :is(h1,h2,h3,h4,p,label,.form-label,.login-heading) {color:var(--ui-text)!important;text-shadow:none!important}
  body#page-login-index :is(.login-container,.loginform,.login-form) :is(input.form-control,.input-group-text) {background:var(--ui-surface-2)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important}
  body#page-login-index :is(.login-container,.loginform,.login-form) input::placeholder {color:var(--ui-text-2)!important;opacity:1!important}

  /* Front page follows the active appearance rather than retaining white islands. */
  body#page-site-index :is(.fast-proof,.fast-featured-course,.fast-categories,.fast-instructors,.fast-founder,.fast-main,.fast-course-catalog) {background:var(--ui-bg)!important;color:var(--ui-text)!important}
  body#page-site-index :is(.fast-proof__card,.fast-visual-card,.fast-instructor-card,.fast-founder__content,.fast-section-heading) {background:var(--ui-surface)!important;color:var(--ui-text)!important;border:0!important;box-shadow:var(--ui-shadow-1)!important}
  body#page-site-index :is(.fast-section-heading,.fast-featured-course,.fast-founder,.fast-proof) :is(h1,h2,h3,h4,p,li,strong) {color:inherit!important;text-shadow:none!important}
  body#page-site-index :is(.fast-section-heading p,.fast-category-card__description,.fast-instructor-card__bio,.fast-founder__content p) {color:var(--ui-text-2)!important}

  /* Product-category cards: title above media, supporting copy below, whole-card interaction. */
  body#page-site-index .fast-category-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important}
  body#page-site-index .fast-category-card {position:relative!important;display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;padding-top:76px!important;overflow:hidden!important;border:0!important;border-radius:18px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:var(--ui-shadow-1)!important;text-decoration:none!important;isolation:isolate!important}
  body#page-site-index .fast-category-card__image {position:static!important;display:block!important;width:100%!important;height:auto!important;aspect-ratio:16/9!important;object-fit:cover!important;object-position:center!important;z-index:auto!important}
  body#page-site-index .fast-category-card__shade {display:none!important}
  body#page-site-index .fast-category-card__content {position:static!important;display:flex!important;flex:1!important;flex-direction:column!important;align-items:flex-start!important;width:100%!important;padding:18px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important}
  body#page-site-index .fast-category-card__code {position:absolute!important;top:12px!important;left:18px!important;display:inline-flex!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;padding:3px 6px!important;border:0!important;border-radius:6px!important;background:var(--ui-surface-2)!important;color:#d59600!important;font:800 .65rem/1 var(--ui-font)!important;letter-spacing:.07em!important;box-shadow:none!important}
  body#page-site-index .fast-category-card__title {position:absolute!important;top:42px!important;left:18px!important;right:18px!important;display:block!important;color:var(--ui-text)!important;font:750 clamp(1.08rem,2vw,1.35rem)/1.15 var(--ui-font)!important;letter-spacing:-.025em!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body#page-site-index .fast-category-card__description {display:block!important;margin:0!important;color:var(--ui-text-2)!important;font:500 .95rem/1.4 var(--ui-font)!important}
  body#page-site-index .fast-category-card__action {display:inline-flex!important;margin-top:auto!important;padding-top:14px!important;color:var(--ui-text)!important;font-weight:750!important}
  body#page-site-index a.fast-category-card {cursor:pointer!important}
  body#page-site-index a.fast-category-card:hover {transform:translateY(-2px)!important;box-shadow:var(--ui-shadow-2)!important}

  .fast-coming-soon-badge {position:absolute!important;top:14px!important;right:14px!important;z-index:5!important;display:inline-flex!important;align-items:center!important;min-height:34px!important;padding:8px 12px!important;border:0!important;border-radius:999px!important;background:#f3b41e!important;color:#17130a!important;font:800 .78rem/1 var(--ui-font)!important;letter-spacing:.045em!important;text-transform:uppercase!important;box-shadow:0 8px 24px rgba(0,0,0,.28)!important}
  .fast-category-card--coming-soon {filter:none!important;opacity:1!important}
  .fast-category-card--coming-soon .fast-category-card__image {filter:saturate(.55) brightness(.72)!important}

  /* Moodle's actual Explore Products tree uses banner rows rather than the front-page cards. */
  body#page-course-index-category .course_category_tree>.content {display:block!important;width:100%!important;max-width:none!important}
  body#page-course-index-category .fast-category-card-grid {display:grid!important;width:100%!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important}
  body#page-course-index-category .fast-category-banner-row {position:relative!important;display:flex!important;flex-direction:column!important;width:auto!important;max-width:100%!important;min-width:0!important;min-height:0!important;margin:0!important;padding-top:76px!important;overflow:hidden!important;box-sizing:border-box!important;border:0!important;border-radius:18px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:var(--ui-shadow-1)!important;isolation:isolate!important}
  body#page-course-index-category .fast-category-banner-row::before {content:""!important;display:block!important;width:100%!important;aspect-ratio:16/9!important;background-image:var(--fast-category-banner-image)!important;background-size:cover!important;background-position:center!important}
  body#page-course-index-category .fast-category-banner-row>.info {position:static!important;display:flex!important;flex:1!important;flex-direction:column!important;align-items:flex-start!important;width:100%!important;padding:18px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important}
  body#page-course-index-category .fast-category-banner-row :is(h3,h3 a,.fast-catalog-card__tagline,.fast-catalog-card__action) {color:var(--ui-text)!important;text-shadow:none!important}
  body#page-course-index-category .fast-category-banner-row h3 {position:absolute!important;top:38px!important;left:18px!important;right:18px!important;margin:0!important;font:750 clamp(1.08rem,2vw,1.35rem)/1.15 var(--ui-font)!important;letter-spacing:-.025em!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body#page-course-index-category .fast-category-banner-row h3 a {text-decoration:none!important}
  body#page-course-index-category .fast-category-banner-row h3 a::after {content:""!important;position:absolute!important;inset:0!important;z-index:8!important}
  body#page-course-index-category .fast-catalog-card__code {position:absolute!important;top:12px!important;left:18px!important;display:inline-flex!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;padding:3px 6px!important;border:0!important;border-radius:6px!important;background:var(--ui-surface-2)!important;color:#d59600!important;font:800 .65rem/1 var(--ui-font)!important;letter-spacing:.07em!important;box-shadow:none!important}
  body#page-course-index-category .fast-catalog-card__tagline {margin:0!important;color:var(--ui-text-2)!important;font:500 .95rem/1.4 var(--ui-font)!important}
  body#page-course-index-category .fast-catalog-card__action {display:inline-flex!important;margin-top:auto!important;padding-top:14px!important;color:var(--ui-text)!important;font-weight:750!important}
  body#page-course-index-category .fast-category-banner-row--coming-soon::after {content:none!important;display:none!important}
  body#page-course-index-category .fast-category-banner-row--coming-soon {filter:none!important;opacity:1!important}
  body#page-course-index-category .fast-category-banner-row:hover {transform:translateY(-2px)!important;box-shadow:var(--ui-shadow-2)!important}

  /* Moodle product cards: a clean title band, uninterrupted image, then metadata. */
  body#page-my-index .course-card {position:relative!important;display:flex!important;flex-direction:column!important;min-height:100%!important;padding-top:58px!important;overflow:visible!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-separator)!important;border-radius:16px!important;box-shadow:0 8px 24px rgba(0,0,0,.22)!important}
  body#page-my-index [data-region="card-deck"]>.col {position:relative!important;margin-bottom:24px!important;overflow:visible!important}
  body#page-my-index [data-region="card-deck"]>.col:has(.dropdown-menu.show) {z-index:100!important}
  body#page-my-index .course-card>a:first-child {display:block!important;order:1!important;width:100%!important}
  body#page-my-index .course-card .card-img-top {display:block!important;width:100%!important;height:auto!important;min-height:0!important;aspect-ratio:16/9!important;border-radius:0!important;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important}
  body#page-my-index .course-card .course-info-container {order:2!important;display:block!important;min-height:54px!important;padding:13px 16px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;pointer-events:none!important}
  body#page-my-index .course-card .coursename {position:absolute!important;top:0!important;left:0!important;right:0!important;display:flex!important;align-items:center!important;height:58px!important;margin:0!important;padding:0 16px!important;background:var(--ui-surface)!important;color:var(--ui-text)!important;font-size:1rem!important;font-weight:750!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;z-index:3!important}
  body#page-my-index .course-card .coursename .multiline {min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  body#page-my-index .course-card .course-info-container .text-muted,
  body#page-my-index .course-card .course-info-container .categoryname {color:var(--ui-text-2)!important;font-size:.88rem!important}
  body#page-my-index .course-card>.d-flex.align-items-start {order:3!important;background:var(--ui-surface)!important}
  body#page-my-index .course-card .card-footer {background:transparent!important;color:var(--ui-text)!important}
  body#page-my-index .course-card:has(.dropdown-menu.show) {z-index:110!important}
  body#page-my-index .course-card .dropdown-menu.show {z-index:120!important;overflow:visible!important}
  body#page-my-index .course-card :is(a,button,.dropdown-toggle) {pointer-events:auto!important}

  @media(max-width:991.98px){body#page-site-index .fast-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
  @media(max-width:760px){body#page-course-index-category .fast-category-card-grid{grid-template-columns:1fr!important}}
  @media(max-width:640px){body#page-site-index .fast-category-grid{grid-template-columns:1fr!important}.navbar .editmode-switch-form label{display:inline!important}}
}
