/* ---------------------------------------------------------------------------
 * Material Kit Pro compatibility shim for the AppStrap theme.
 *
 * The shared web components in themes/_shared emit a handful of Material Kit
 * class names. Rather than fork those components per theme, this file maps the
 * ones that actually did something onto AppStrap. It should shrink to nothing
 * as the components are ported.
 *
 * Colours come from AppStrap's Bootstrap variables, not Material Kit's
 * hardcoded blues, so these follow whatever colour scheme the theme is built
 * with. background-color is declared first as the fallback for browsers
 * without color-mix().
 *
 * Deliberately NOT shimmed, because they are not defined anywhere in Material
 * Kit Pro either and are therefore already inert in the cantacumine theme:
 *   .blur-shadow-image, .blur-shadow-avatar, .btn-just-icon,
 *   .bg-gradient-default, .header-filter, .header-small
 *
 * Still outstanding: the .input-group-dynamic / .input-group-static
 * floating-label pattern that loader.js drives via .is-focused / .is-filled.
 * AppStrap uses Bootstrap floating labels instead, so those forms need porting
 * rather than shimming.
 * ------------------------------------------------------------------------- */

/* Gradient backgrounds ---------------------------------------------------- */
.bg-gradient-primary {
  background-color: var(--bs-primary);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-primary) 70%, #fff) 0%, var(--bs-primary) 100%);
}

.bg-gradient-secondary {
  background-color: var(--bs-secondary);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-secondary) 70%, #fff) 0%, var(--bs-secondary) 100%);
}

.bg-gradient-success {
  background-color: var(--bs-success);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-success) 70%, #fff) 0%, var(--bs-success) 100%);
}

.bg-gradient-info {
  background-color: var(--bs-info);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-info) 70%, #fff) 0%, var(--bs-info) 100%);
}

.bg-gradient-warning {
  background-color: var(--bs-warning);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-warning) 70%, #fff) 0%, var(--bs-warning) 100%);
}

.bg-gradient-danger {
  background-color: var(--bs-danger);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-danger) 70%, #fff) 0%, var(--bs-danger) 100%);
}

.bg-gradient-light {
  background-color: var(--bs-light);
  background-image: linear-gradient(195deg, #fff 0%, var(--bs-light) 100%);
}

.bg-gradient-dark {
  background-color: var(--bs-dark);
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-dark) 75%, #fff) 0%, var(--bs-dark) 100%);
}

/* Gradient text ----------------------------------------------------------- */
.text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.text-gradient.text-primary {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-primary) 70%, #fff), var(--bs-primary));
}

.text-gradient.text-info {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-info) 70%, #fff), var(--bs-info));
}

.text-gradient.text-success {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-success) 70%, #fff), var(--bs-success));
}

.text-gradient.text-warning {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-warning) 70%, #fff), var(--bs-warning));
}

.text-gradient.text-danger {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-danger) 70%, #fff), var(--bs-danger));
}

.text-gradient.text-dark {
  background-image: linear-gradient(195deg, color-mix(in srgb, var(--bs-dark) 75%, #fff), var(--bs-dark));
}

/* Frosted-glass panels ---------------------------------------------------- */
.blur {
  box-shadow: inset 0 0 2px rgba(254, 254, 254, 0.82);
  -webkit-backdrop-filter: saturate(100%) blur(16px);
  backdrop-filter: saturate(100%) blur(16px);
  background-color: rgba(255, 255, 255, 0.9) !important;
}

.blur.saturation-less {
  -webkit-backdrop-filter: saturate(20%) blur(16px);
  backdrop-filter: saturate(20%) blur(16px);
}

.blur.blur-rounded {
  border-radius: 40px;
}

.shadow-blur {
  box-shadow: inset 0 0 1px 1px rgba(254, 254, 254, 0.7), 0 3px 12px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Square icon tiles ------------------------------------------------------- */
.icon-shape {
  width: 48px;
  height: 48px;
  background-position: center;
  border-radius: 0.5rem;
}

.icon-shape i {
  color: #fff;
  opacity: 0.8;
  top: 11px;
  position: relative;
}

/* Full-bleed hero ---------------------------------------------------------
 * Material Kit used .page-header for this. AppStrap has its own .page-header
 * -- a light bordered bar, not a hero -- so the views use .hero-cover instead
 * and the two no longer collide. (.header-filter / .header-small, which the
 * original markup also carried, are not defined in Material Kit either.)
 * ------------------------------------------------------------------------- */
.hero-cover {
  position: relative;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero-cover > .container,
.hero-cover > .container-fluid {
  position: relative;
  z-index: 2;
}

/* Dimming layer inside a hero. Pairs with .bg-gradient-* and .opacity-* above. */
.mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  opacity: 0.8;
  z-index: 1;
}

/* Viewport-height steps. Bootstrap ships only .min-vh-100. */
.min-vh-25 { min-height: 25vh !important; }
.min-vh-35 { min-height: 35vh !important; }
.min-vh-55 { min-height: 55vh !important; }
.min-vh-65 { min-height: 65vh !important; }
.min-vh-75 { min-height: 75vh !important; }

/* Shared menu-sidebar component -------------------------------------------
 * _shared/assets/js/components/menu-sidebar.js wraps its list in
 * <div class="collapse navbar-collapse">. Material Kit kept that open by
 * putting .navbar-expand-xs on the sidebar container; AppStrap's .navbar-side
 * is an .offcanvas, not a .navbar, so nothing expands it and Bootstrap's
 * .collapse{display:none} would leave the sidebar visibly empty.
 * ------------------------------------------------------------------------- */
.navbar-side .navbar-collapse {
  display: block !important;
}

/* The component sets display:contents on itself, so its children - not the
 * element - are the flex items of .row, and Bootstrap's ".row > * {width:100%}"
 * lands on a box that is never generated. adm.css has the same rule scoped to
 * Material Kit's .sidenav; this is the AppStrap equivalent.
 */
.navbar-side .row > menu-sidebar > * {
  width: 100%;
}


/* ===========================================================================
 * Material Kit utility scale used by the shared components.
 *
 * Audit of themes/_shared: the components emit 401 distinct class names. 334
 * are plain Bootstrap or app CSS and need nothing. These are the ones Material
 * Kit defined and AppStrap does not, so without them the components render
 * with the wrong weight, spacing, opacity or z-order.
 *
 * Geometry is Material Kit's exact values; colours come from AppStrap's
 * Bootstrap variables so they follow its palette.
 * ======================================================================== */

/* Font weights. Material Kit's .font-weight-bold is 600, not Bootstrap's 700,
 * so mapping it to .fw-bold would visibly thicken the affected text. */
.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 600 !important; }
.font-weight-bolder { font-weight: 700 !important; }

/* Type scale. AppStrap has .text-xs and .text-sm already. */
.text-md { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }

/* Legacy content alignment utility, absent from AppStrap's Bootstrap 5 CSS. */
/* Justified only from md up: on a phone the short lines open wide gaps
   between words. */
@media (min-width: 768px) {
  .text-justify { text-align: justify !important; }
}

/* Paragraph class. Scoped to the class only -- Material Kit declared this as
 * "p, .p", and pulling the element selector in would override AppStrap's own
 * body typography. */
.p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Opacity in tenths. Bootstrap ships only 25/50/75/100. */
.opacity-0 { opacity: 0 !important; }
.opacity-1 { opacity: 0.1 !important; }
.opacity-2 { opacity: 0.2 !important; }
.opacity-3 { opacity: 0.3 !important; }
.opacity-4 { opacity: 0.4 !important; }
.opacity-5 { opacity: 0.5 !important; }
.opacity-6 { opacity: 0.6 !important; }
.opacity-7 { opacity: 0.7 !important; }
.opacity-8 { opacity: 0.8 !important; }
.opacity-9 { opacity: 0.9 !important; }
.opacity-10 { opacity: 1 !important; }

/* Corner radii. */
.border-radius-sm { border-radius: 0.25rem; }
.border-radius-md { border-radius: 0.375rem; }
.border-radius-lg { border-radius: 0.5rem; }
.border-radius-xl { border-radius: 0.75rem; }

/* Stacking. */
.z-index-0 { z-index: 0 !important; }
.z-index-1 { z-index: 1 !important; }
.z-index-2 { z-index: 2 !important; }
.z-index-3 { z-index: 3 !important; }

/* Misc. */
.cursor-pointer { cursor: pointer; }
.line-height-0 { line-height: 0; }

/* Coloured drop shadows. */
.shadow-primary {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-primary-rgb), 0.4) !important;
}
.shadow-secondary {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-secondary-rgb), 0.4) !important;
}
.shadow-success {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-success-rgb), 0.4) !important;
}
.shadow-info {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-info-rgb), 0.4) !important;
}
.shadow-warning {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-warning-rgb), 0.4) !important;
}
.shadow-danger {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(var(--bs-danger-rgb), 0.4) !important;
}

/* Gradient rules. menu-sidebar.js emits <hr class="horizontal light"> and
 * app-footer.js <hr class="horizontal dark">; a plain <hr> is nearly invisible
 * on the dark sidebar. */
hr.horizontal {
  background-color: transparent;
  border: 0;
  height: 1px;
  opacity: 1;
}

hr.horizontal.light {
  background-image: linear-gradient(90deg, hsla(0, 0%, 100%, 0), #fff, hsla(0, 0%, 100%, 0));
}

hr.horizontal.dark {
  background-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.4), transparent);
}

/* Blurred copy of a card cover, sat behind it as a glow. songs-list.js assigns
 * the cover image to this element's background; unstyled it would render as a
 * second, full-size, unblurred copy on top of the card. */
.colored-shadow {
  position: absolute;
  top: 1.5%;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scale(0.92);
  filter: blur(12px);
  background-size: cover;
  z-index: -1;
}

.colored-shadow.rounded {
  border-radius: 50% !important;
}

/* ===========================================================================
 * Form fields: the .input-group-static pattern
 *
 * songs-list.js emits Material Kit's "static label above the field" group:
 *
 *   <div class="input-group input-group-static">
 *     <label class="form-label">…</label>
 *     <input class="form-control">
 *
 * Bootstrap's .input-group is a flex ROW meant for addon buttons, so without
 * this the label sits beside the input and both get the grouped square corners.
 * Reverting to normal block flow puts the label back above the field.
 *
 * loader.js toggles .is-focused / .is-filled on the group as the user types;
 * Material Kit used those to float the label and tint the underline. With a
 * static label only the tint is meaningful, so that is all this reproduces.
 * ======================================================================== */
.input-group.input-group-static,
.input-group.input-group-dynamic {
  display: block;
  position: relative;
  flex-wrap: nowrap;
}

.input-group.input-group-static > .form-label,
.input-group.input-group-dynamic > .form-label,
.input-group.input-group-static > label,
.input-group.input-group-dynamic > label {
  display: block;
  width: 100%;
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  transition: color 0.15s ease-in-out;
}

/* Undo the grouped-control geometry Bootstrap applies to .input-group children.
   The radius needs !important: Bootstrap squares the joined edges with
   .input-group:not(.has-validation) > :not(:last-child):not(...)..., at a
   specificity (0,6,0) these selectors cannot reach, so the fields drew square
   corners. A static-label group is one field, never a joined group. */
.input-group.input-group-static > .form-control,
.input-group.input-group-dynamic > .form-control,
.input-group.input-group-static > .form-select,
.input-group.input-group-dynamic > .form-select {
  width: 100%;
  border-radius: var(--bs-border-radius) !important;
  margin-left: 0 !important;
}

/* Focus tint, driven by loader.js. */
.input-group.is-focused > .form-label,
.input-group.is-focused > label {
  color: var(--bs-primary);
}

.input-group.is-focused.is-valid > .form-label,
.input-group.is-focused.is-valid > label {
  color: var(--bs-success);
}

.input-group.is-focused.is-invalid > .form-label,
.input-group.is-focused.is-invalid > label {
  color: var(--bs-danger);
}
