/* Feature block — built from Figma "marketplace" nodes 479:4754 / 4789 / 4824 / 4859
   Hover behaviour follows the reference video: a red panel grows from the card's
   left edge on hover and shrinks back to the left edge when the pointer leaves. */

:root {
  --fb-red: #e91c21;
  --fb-bg: #ffffff;
  --fb-line: #d9d9d9;
  --fb-title: rgba(0, 0, 0, 0.75);
  --fb-text: rgba(0, 0, 0, 0.65);
  --fb-on: #ffffff;
  --fb-speed: 0.45s;
  --fb-ease: cubic-bezier(0.65, 0, 0.35, 1);
}

.feature-block {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--fb-bg);
  border-bottom: 1px solid var(--fb-line);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 330px;
  padding: 126px 40px 48px 53px;
  border-left: 1px solid var(--fb-line);
  cursor: pointer;
  outline: none;
}
.feature:first-child { border-left: 0; }

/* the sliding red panel */
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fb-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--fb-speed) var(--fb-ease);
}

/* icon: two stacked images (inactive / active) that cross-fade */
.feature__icon {
  position: relative;
  height: 56px;
  margin-bottom: 16px;
}
.feature__icon img {
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity var(--fb-speed) var(--fb-ease);
}
.feature__icon .on { opacity: 0; }

.feature__arrow {
  position: absolute;
  top: 41px;
  right: 21px;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity var(--fb-speed) var(--fb-ease), transform var(--fb-speed) var(--fb-ease);
}

.feature__title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 500;
  line-height: normal;
  color: var(--fb-title);
  transition: color var(--fb-speed) var(--fb-ease);
}

.feature__text {
  margin: 0;
  max-width: 382px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--fb-text);
  transition: color var(--fb-speed) var(--fb-ease);
}

/* active state: hover, keyboard focus, or .is-active (tap on touch screens) */
.feature:hover::before,
.feature:focus-visible::before,
.feature.is-active::before { transform: scaleX(1); }

.feature:hover .feature__icon .on,
.feature:focus-visible .feature__icon .on,
.feature.is-active .feature__icon .on { opacity: 1; }

.feature:hover .feature__icon .off,
.feature:focus-visible .feature__icon .off,
.feature.is-active .feature__icon .off { opacity: 0; }

.feature:hover .feature__arrow,
.feature:focus-visible .feature__arrow,
.feature.is-active .feature__arrow { opacity: 1; transform: none; }

.feature:hover .feature__title,
.feature:hover .feature__text,
.feature:focus-visible .feature__title,
.feature:focus-visible .feature__text,
.feature.is-active .feature__title,
.feature.is-active .feature__text { color: var(--fb-on); }

/* responsive */
@media (max-width: 1280px) {
  .feature { padding: 110px 32px 40px 36px; min-height: 300px; }
  .feature__title { font-size: 22px; }
}
@media (max-width: 900px) {
  .feature-block { grid-template-columns: repeat(2, 1fr); }
  .feature:nth-child(3) { border-left: 0; }
  .feature:nth-child(-n + 2) { border-bottom: 1px solid var(--fb-line); }
}
@media (max-width: 560px) {
  .feature-block { grid-template-columns: 1fr; }
  .feature { border-left: 0; min-height: 0; padding: 80px 24px 32px; }
  .feature:not(:last-child) { border-bottom: 1px solid var(--fb-line); }
  .feature__arrow { top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .feature::before,
  .feature__icon img,
  .feature__arrow,
  .feature__title,
  .feature__text { transition: none; }
}
