/**
 * @file
 * Compatibility layer for class names stored in the database.
 *
 * Editor-authored HTML (CKEditor body fields, custom blocks) and some Views
 * settings (row/wrapper classes) still contain former Bootstrap utility class
 * names. Only the classes found in the content are reproduced here; theme
 * templates must not use them – components use BEM classes instead.
 *
 * Inventory (2026-10): mb-0/2/3/4/5, mt-4/5, pe-0, ps-3, px-3, py-3, p-4,
 * fw-bold, text-uppercase, text-center, text-white, text-light,
 * text-decoration-none, text-reset, small, h3/h4/h5, d-block, d-grid, gap-2,
 * h-100, img-fluid, shadow, shadow-sm, rounded-0, border-0, bg-dark,
 * bg-secondary, badge, btn/btn-sm/btn-success, row/col/col-lg-6, gx-5,
 * gy-4/gy-5, card/card-body, table, logo-variation, imtm-card-header/body,
 * publications-header, publications-no-results, table-formatted.
 */

/* Spacing. */
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.pe-0 { padding-right: 0 !important; }
.ps-3 { padding-left: 1rem !important; }
.px-3 { padding-right: 1rem !important; padding-left: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

/* Typography. */
.fw-bold { font-weight: 700 !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-center { text-align: center !important; }
.text-white { color: var(--imtm-color-white) !important; }
.text-light { color: var(--imtm-color-light) !important; }
.text-decoration-none { text-decoration: none !important; }
.text-reset { color: inherit !important; }
.small { font-size: 0.875em; }
.h3, .h4, .h5 { margin-top: 0; margin-bottom: 0.5rem; font-weight: 500; line-height: 1.2; }
.h3 { font-size: calc(1.3rem + 0.6vw); }
.h4 { font-size: calc(1.275rem + 0.3vw); }
.h5 { font-size: 1.25rem; }

@media (min-width: 1200px) {
  .h3 { font-size: 1.75rem; }
  .h4 { font-size: 1.5rem; }
}

/* Display, sizing, decoration. */
.d-block { display: block !important; }
.d-grid { display: grid !important; }
.gap-2 { gap: 0.5rem !important; }
.h-100 { height: 100% !important; }
.img-fluid { max-width: 100%; height: auto; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-sm { box-shadow: var(--imtm-shadow-sm) !important; }
.rounded-0 { border-radius: 0 !important; }
.border-0 { border: 0 !important; }
.bg-dark { background-color: var(--imtm-color-dark) !important; }
.bg-secondary { background-color: var(--imtm-color-secondary) !important; }

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: var(--imtm-color-white);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

.btn-success {
  color: var(--imtm-color-white);
  background-color: var(--imtm-color-success);
  border-color: var(--imtm-color-success);
}

.btn-success:hover {
  color: var(--imtm-color-white);
  background-color: #157347;
}

/* Grid used inside body fields. */
.row {
  --row-gutter-x: 1.5rem;
  --row-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--row-gutter-y));
  margin-right: calc(-0.5 * var(--row-gutter-x));
  margin-left: calc(-0.5 * var(--row-gutter-x));
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--row-gutter-x) * 0.5);
  padding-left: calc(var(--row-gutter-x) * 0.5);
  margin-top: var(--row-gutter-y);
}

.gx-5 { --row-gutter-x: 3rem; }
.gy-4 { --row-gutter-y: 1.5rem; }
.gy-5 { --row-gutter-y: 3rem; }
.col { flex: 1 0 0%; }

@media (min-width: 992px) {
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
}

/* Cards in body fields. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--imtm-color-white);
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

/* Former theme classes used inside body fields and Views settings. */
.logo-variation {
  width: 300px;
  height: auto !important;
}

.imtm-card-header,
.publications-header {
  padding: 1rem;
  background-color: var(--imtm-color-surface);
  border-bottom: 4px solid var(--imtm-color-border-strong);
}

.imtm-card-header h4,
.publications-header h4 {
  margin: 0;
  font-size: 1.25rem;
}

.imtm-card-body {
  padding: 1rem;
  margin-bottom: 2rem;
  background-color: var(--imtm-color-surface);
}

.imtm-card-body p:last-child {
  margin-bottom: 0;
}

.publications-no-results {
  padding: 1rem;
  background-color: var(--imtm-color-surface);
}

/* Views settings: publication rows are striped. */
.publication-row:nth-child(odd) {
  background-color: var(--imtm-color-surface);
}

.publications-view {
  margin-bottom: 3rem;
}

/* Views settings: striped rows (row classes set in the views). In the theme
   list layout the rows are the first children, so the first row is grey for
   both bg-gray-odd and bg-gray-even. */
.views-layout--list > .bg-gray-even:nth-child(odd) {
  background-color: var(--imtm-color-surface-alt);
}

.views-layout--list > .bg-gray-even:nth-child(even) {
  background-color: var(--imtm-color-surface-lighter);
}

.management:nth-child(odd),
.tender:nth-child(odd),
.bg-gray-odd:nth-child(odd),
.bg-gray-even:nth-child(even) {
  background-color: var(--imtm-color-surface-alt);
}

.management:nth-child(even) {
  background-color: #f9fafb;
}

.tender:nth-child(even),
.bg-gray-odd:nth-child(even),
.bg-gray-even:nth-child(odd) {
  background-color: var(--imtm-color-surface-lighter);
}

.clinical-trials .trial {
  padding: 1rem;
}

.clinical-trials .trial:nth-child(odd) {
  background: var(--imtm-color-blue-pale);
}

.clinical-trials .trial .views-field-title {
  margin-bottom: 1rem;
}

.clinical-trials .views-field-field-trial-number a {
  font-weight: 700;
  color: var(--imtm-color-darkblue);
}

.certificates h3 {
  margin: 1.75rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.instrument-category {
  max-width: 250px;
}

/* Views setting "laboratories": research groups list in the side column. */
.laboratories .views-row {
  margin-bottom: 1.125rem;
}

.laboratories .views-field-title a {
  font-size: 1.125rem;
  font-weight: 700;
}

.laboratories .views-field-field-group-type {
  color: #818181;
}
