/**
 * Home Box Manager — Front Office styles (Stage H6 universal grid).
 *
 * Module-scoped only (all selectors are prefixed with .hbm-). No global element or
 * theme selectors.
 *
 * @author    Anton Shevchenko
 * @copyright Copyright (c) Anton Shevchenko
 * @license   AFL-3.0
 */

.hbm-hook {
  margin: 2rem 0;
}

.hbm-hook--displayHome {
  margin-top: 0;
}

.hbm-section {
  width: 100%;
  margin-bottom: 2rem;
}

.hbm-section__inner {
  width: 100%;
}

.hbm-section__header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.hbm-section__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #232323;
  text-transform: uppercase;
}

.hbm-section__subtitle {
  max-width: 760px;
  margin: 0.75rem auto 0;
  color: #7a7a7a;
  font-size: 1rem;
  line-height: 1.5;
}

.hbm-section--has-bg {
  position: relative;
  background-image: var(--hbm-section-bg, none);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  padding: 2.5rem 1.5rem;
}

.hbm-section--has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hbm-section--has-bg .hbm-section__inner {
  position: relative;
  z-index: 1;
}

.hbm-section--has-bg .hbm-section__title,
.hbm-section--has-bg .hbm-section__subtitle {
  color: #fff;
}

.hbm-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(var(--hbm-grid-columns, 4), minmax(0, 1fr));
  gap: 1.5rem;
}

.hbm-grid--cols-2 {
  --hbm-grid-columns: 2;
}

.hbm-grid--cols-3 {
  --hbm-grid-columns: 3;
}

.hbm-grid--cols-4 {
  --hbm-grid-columns: 4;
}

.hbm-grid__item {
  min-width: 0;
}

.hbm-card {
  position: relative;
  display: flex;
  min-height: 220px;
  width: 100%;
  overflow: hidden;
  align-items: flex-end;
  padding: 1.25rem;
  color: #fff;
  text-decoration: none;
  background-color: #2f2f2f;
  background-image: var(--hbm-card-bg, none);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hbm-card:hover,
.hbm-card:focus {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

.hbm-card:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.hbm-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.68),
    rgba(0, 0, 0, 0.18)
  );
}

.hbm-card__content {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
}

.hbm-card__title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hbm-card__description {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  line-height: 1.35;
}

.hbm-card__icon {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.hbm-section--layout-cards .hbm-card {
  min-height: 260px;
}

.hbm-section--layout-banner .hbm-grid {
  grid-template-columns: 1fr;
}

.hbm-section--layout-banner .hbm-card {
  min-height: 320px;
}

.hbm-section--layout-custom-html,
.hbm-section--layout-compact {
  width: 100%;
}

.hbm-custom-html {
  width: 100%;
}

.hbm-custom-html__item {
  width: 100%;
  margin-bottom: 1.5rem;
}

.hbm-custom-html__item:last-child {
  margin-bottom: 0;
}

.hbm-custom-html__title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: inherit;
}

.hbm-custom-html__content {
  width: 100%;
}

.hbm-grid__item--raw-html {
  grid-column: 1 / -1;
}

@media (max-width: 991px) {
  .hbm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .hbm-section--layout-banner .hbm-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .hbm-hook {
    margin: 1.5rem 0;
  }

  .hbm-section {
    margin-bottom: 1.5rem;
  }

  .hbm-section__title {
    font-size: 1.45rem;
  }

  .hbm-section__subtitle {
    font-size: 0.95rem;
  }

  .hbm-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hbm-card {
    min-height: 180px;
  }
}
