/**
 * SABO HUB — Horizontal feature/bento cards (vertical landing pages)
 * Image ~46% | text ~54% on desktop; stacked on mobile.
 */

.h-fcards,
.cgrid.h-fcards,
.cells.h-fcards,
.bg.h-fcards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Wider gaps when container expands (≥1280px) */
@media (min-width: 1280px) {
  .h-fcards,
  .cgrid.h-fcards,
  .cells.h-fcards,
  .bg.h-fcards {
    gap: 20px;
  }
}

/* 6-item grids (manufacturing, distribution): 3 columns on xl — skip when hero spans full row */
@media (min-width: 1440px) {
  .h-fcards:not(:has(.h-fcard--hero)),
  .cgrid.h-fcards:not(:has(.h-fcard--hero)),
  .cells.h-fcards:not(:has(.h-fcard--hero)),
  .bg.h-fcards:not(:has(.h-fcard--hero)) {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  /*
   * 3-col (manufacturing, distribution): stack image top — full cell width
   * shows larger illustrations than cramped horizontal split (~42% of ~430px).
   */
  .h-fcards:not(:has(.h-fcard--hero)) .h-fcard,
  .cgrid.h-fcards:not(:has(.h-fcard--hero)) .h-fcard,
  .cells.h-fcards:not(:has(.h-fcard--hero)) .h-fcard,
  .bg.h-fcards:not(:has(.h-fcard--hero)) .h-fcard {
    flex-direction: column;
    min-height: 0;
  }

  .h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media,
  .cgrid.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media,
  .cells.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media,
  .bg.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    min-height: 208px;
    padding: 22px 28px 14px;
  }

  .h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media .art,
  .cgrid.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media .art,
  .cells.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media .art,
  .bg.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__media .art {
    max-height: 248px;
    -webkit-mask-image: radial-gradient(
      ellipse 94% 88% at 50% 44%,
      #000 46%,
      transparent 100%
    );
    mask-image: radial-gradient(
      ellipse 94% 88% at 50% 44%,
      #000 46%,
      transparent 100%
    );
  }

  .h-fcards:not(:has(.h-fcard--hero)) .h-fcard__body,
  .cgrid.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__body,
  .cells.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__body,
  .bg.h-fcards:not(:has(.h-fcard--hero)) .h-fcard__body {
    padding: 6px 22px 24px;
  }
}

@media (max-width: 720px) {
  .h-fcards,
  .cgrid.h-fcards,
  .cells.h-fcards,
  .bg.h-fcards {
    grid-template-columns: 1fr;
  }
}

.h-fcard {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 200px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition:
    transform 0.4s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color 0.35s ease,
    box-shadow 0.4s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.h-fcard:hover {
  transform: translateY(-6px);
  border-color: var(--feat-accent, #14b8a6);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.h-fcard__media {
  flex: 0 0 46%;
  max-width: 46%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px 12px 14px;
  background: transparent;
  overflow: hidden;
}

.h-fcard__media .art {
  width: 100%;
  height: auto;
  max-height: 216px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.08));
  -webkit-mask-image: radial-gradient(
    ellipse 90% 90% at 50% 50%,
    #000 52%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 90% 90% at 50% 50%,
    #000 52%,
    transparent 100%
  );
}

.h-fcard__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px 20px 8px;
  text-align: left;
}

.h-fcard__body h3,
.h-fcard__body h4 {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin: 0 0 8px;
}

.h-fcard__body p {
  font-size: clamp(1rem, 1.05vw, 1.0625rem);
  color: #0f172a;
  line-height: 1.65;
  opacity: 0.88;
  margin: 0;
}

.h-fcard__checks {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.h-fcard__checks li {
  font-size: clamp(1rem, 1.05vw, 1.0625rem);
  color: #334155;
  line-height: 1.55;
  padding: 5px 0 5px 22px;
  position: relative;
}

.h-fcard__checks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--feat-accent, #14b8a6);
  font-weight: 700;
  font-size: 12px;
}

/* Featured / hero card — full grid width, stronger accent border */
.h-fcard--hero {
  grid-column: 1 / -1;
  min-height: 228px;
  border-color: color-mix(in srgb, var(--feat-accent, #db2777) 42%, var(--line, rgba(16, 24, 48, 0.1)));
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.06),
    inset 0 0 0 1px color-mix(in srgb, var(--feat-accent, #db2777) 12%, transparent);
}

.h-fcard--hero .h-fcard__media {
  flex: 0 0 48%;
  max-width: 48%;
  padding: 14px 12px 14px 18px;
}

.h-fcard--hero .h-fcard__media .art {
  max-height: 260px;
  -webkit-mask-image: radial-gradient(
    ellipse 92% 92% at 50% 50%,
    #000 58%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 92% 92% at 50% 50%,
    #000 58%,
    transparent 100%
  );
}

.h-fcard--hero:hover {
  border-color: var(--feat-accent, #db2777);
}

.h-fcard__body .n,
.h-fcard__body .ic {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--feat-label, var(--muted));
  margin-bottom: 6px;
}

.h-fcard__body .ic {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

@media (max-width: 640px) {
  .h-fcard {
    flex-direction: column;
    min-height: 0;
  }

  .h-fcard__media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    min-height: 168px;
    padding: 20px 24px 16px;
  }

  .h-fcard__media .art {
    max-height: 168px;
  }

  .h-fcard--hero .h-fcard__media .art {
    max-height: 200px;
  }

  .h-fcard__body {
    padding: 4px 20px 22px;
  }

  .h-fcard--hero .h-fcard__media {
    flex: 0 0 auto;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .h-fcard:hover {
    transform: none;
  }
}
