/**
 * Benefits tabs
 * Links on the left, stacked panels (text + image) on the right.
 */

/* ---------- Layout ---------- */

.benefits {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: 2rem;
  align-items: start;
}

/* ---------- Left: navigation ---------- */

.benefits__nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.benefits__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-radius: 8px;
  color: #7e61de;
  font-size: 18px;
  font-weight: 600;
  font-stretch: normal;
  font-style: normal;
  line-height: 1.33;
  letter-spacing: -0.5px;
}

.benefits__link:hover {
  text-decoration: none;
}

.benefits__link.is-active {
  background: #7e61de;
  color: #fff;
  border-color: #fff ;
}

.benefits__link:focus-visible {
  outline: 3px solid #7e61de;
  outline-offset: 2px;
}

.benefits__link span {
  border-bottom: 2px solid;
}

.benefits__nav li:nth-child(5n+1) .benefits__link span {
  border-color: #a4d0c4;
}

.benefits__nav li:nth-child(5n+2) .benefits__link span {
  border-color: #d1b27e;
}

.benefits__nav li:nth-child(5n+3) .benefits__link span {
  border-color: #6784ff;
}

.benefits__nav li:nth-child(5n+4) .benefits__link span {
  border-color: #5db1c9;
}

.benefits__nav li:nth-child(5n) .benefits__link span {
  border-color: #fbb263;
}

.benefits__link.is-active span {
  border-color: #fff !important;
}

/* ---------- Right: panels ---------- */

/* All panels share one grid cell, so the area is always as tall as the
   tallest panel and doesn't change height when switching. */
.benefits__panels {
  display: grid;
}

.benefits__panel {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 2fr 1fr; 
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  background: #fff;
  --panel-radius: clamp(32px, 5.2vw, 100px);
  border-radius: 0 var(--panel-radius) 0 var(--panel-radius);
}

.benefits__panel.is-active {
  visibility: visible;
  opacity: 1;
}

/* Text column */
.benefits__panel-text {
  padding: 3rem;
}

.benefits__panel-title {
  margin: 0 0 0.5rem;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

/* Title link covers the whole card (Bootstrap .stretched-link) */
.benefits__panel-link,
.benefits__panel-link:hover {
  color: inherit;
  text-decoration: none;
}

.benefits__panel:hover .benefits__panel-title {
  color: #7e61de;
}

/* Keyboard focus outlines the whole card, not just the title */
.benefits__panel-link:focus-visible {
  outline: none;
}

.benefits__panel:has(.benefits__panel-link:focus-visible) {
  outline: 3px solid #7e61de;
  outline-offset: 2px;
}

.benefits__panel-subtitle p {
  margin: 0 0 0.5rem;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.56;
  color: #242935;
}

.benefits__panel-subtitle p:last-child {
  margin-bottom: 0;
}

/* Image column */

/* Image column: stretches to the panel's full height. */
.benefits__panel-image {
  position: relative;
}

.benefits__panel-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 var(--panel-radius) 0 var(--panel-radius);
}

.benefits__panel-image::before {
  content: "";
  display: block;
  aspect-ratio: 384 / 416;
}

/* ---------- Optional: fixed panel height ----------
   Uncomment to lock every panel to an exact height instead of
   matching the tallest panel. */

/*
.benefits__panel {
  height: 360px;
}

.benefits__panel-image,
.benefits__panel-image img {
  height: 100%;
}

.benefits__panel-image img {
  width: auto;
  object-fit: contain;
}
*/

@media (max-width: 991.98px) {
  .benefits__link {
    font-size: 16px;
    padding: 16px;
  }

  .benefits__panel-text {
    padding: 32px;
  }

  .benefits__panel-title {
    font-size: 24px;
  }

  .benefits__panel-subtitle p {
    font-size: 16px;
  }
}

/* ---------- Small screens ---------- */

/* ---------- 768 and below: all panels shown as cards, no tab list ---------- */

@media (max-width: 768px) {
  .benefits {
    grid-template-columns: 1fr;
  }

  .benefits__nav {
    display: none;
  }

  /* Panels stack instead of sharing one cell */
  .benefits__panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .benefits__panel {
    grid-area: auto;
    visibility: visible;
    opacity: 1;
    grid-template-columns: 1fr clamp(96px, 20%, 160px);
  }

  .benefits__panel-text {
    padding: 24px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .benefits__link,
  .benefits__panel {
    transition: none;
  }
}