/* ==========================================================================
   Advantages Grid — 6 карток переваг (блок 2А)
   ========================================================================== */

.advantages-grid-section {
  padding: var(--section-padding-desktop);
  margin-bottom: var(--section-spacing-desktop);
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Br прихований на desktop — показується тільки на мобайлі */
.mobile-br { display: none; }

/* Золотий акцент "20 000+" */
.highlight-gold { color: #f5c842; }

.advantages-grid-section .section-title {
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-white);
}

.advantages-grid-section__subtitle {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.75rem;
  font-size: 1.15rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.advantages-grid-section__subtitle strong {
  color: var(--color-white);
  font-weight: 700;
}

/* === GRID === */

/* flex-wrap + justify-content:center — центрує неповний останній ряд (5 карток) */
.advantages-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

/* === FEATURE CARD === */

.feature-card {
  flex: 0 1 calc(33.333% - 1rem);
  min-width: 260px;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform var(--transition-normal) ease,
              border-color var(--transition-normal) ease;
  box-sizing: border-box;
}

/* іконка + заголовок в рядок */
.feature-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.feature-card__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
}

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0;
  line-height: 1.3;
}

/* Текст на всю ширину картки — під заголовком і під іконкою */
.feature-card__text {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  width: 100%;
  margin: 0;
  line-height: 1.55;
}

/* === HOVER (desktop only) === */

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

/* === FOCUS === */

.feature-card:focus-visible {
  outline: 2px solid rgba(100, 149, 237, 0.8);
  outline-offset: 2px;
}

/* === TABLET === */

@media (width >= 768px) and (width < 1024px) {
  .advantages-grid-section {
    padding: var(--section-padding-desktop);
  }

  .advantages-grid-section .section-title {
    font-size: 2rem;
    margin-bottom: 0.6rem;
  }

  .advantages-grid-section__subtitle {
    font-size: 1.05rem;
    margin-bottom: 2rem;
  }

  .advantages-grid {
    gap: 1.25rem;
  }

  .feature-card {
    flex: 0 1 calc(50% - 0.625rem);
    min-width: 0;
  }
}

/* === MOBILE === */

@media (width < 768px) {
  .advantages-grid-section {
    padding: var(--section-padding-mobile);
    margin-bottom: var(--section-spacing-mobile);
    max-width: calc(100vw - 2rem);
  }

  /* Примусовий перенос рядка у заголовку — тільки на мобайлі */
  .mobile-br { display: block; }

  .advantages-grid-section .section-title {
    /* clamp: мін 1.2rem, росте з екраном, макс 1.55rem.
       При 320px: 6.5vw = 20.8px — рядок "Чому 20 000+ студентів" вміщується */
    font-size: clamp(1.2rem, 6.5vw, 1.55rem);
    margin-bottom: 0.5rem;
    white-space: nowrap;
  }

  .advantages-grid-section__subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
    white-space: normal;
  }

  /* На мобайлі — 1 колонка, картки йдуть вертикально одна за одною */
  .advantages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .feature-card {
    min-width: 0;
    padding: 0.875rem;
    border-radius: 10px;
  }

  .feature-card__header {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .feature-card__icon {
    font-size: 1.4rem;
  }

  .feature-card__title {
    font-size: 0.9rem;
  }

  .feature-card__text {
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

/* === VERY SMALL MOBILE === */

@media (width < 360px) {
  .advantages-grid {
    gap: 0.625rem;
  }

  .feature-card {
    padding: 0.75rem;
  }
}

/* === iOS Safari === */

@supports (-webkit-touch-callout: none) {
  .feature-card {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

/* === FALLBACK === */

@supports not (backdrop-filter: blur(8px)) {
  .feature-card {
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* === REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
  .feature-card {
    transition: none;
  }

  .feature-card:hover {
    transform: none;
  }
}
