/* =========================================================
   SUCCESS STORIES PAGE — photo-first gallery grid ("Real
   students. Real outcomes."), matching the card format of
   photo + badge pill + bold overlay headline. Includes an
   empty state for when no real testimonials exist yet.
   Depends on tokens defined in base.css.
   ========================================================= */

/* ---------- Hero ---------- */
.stories-hero {
  padding-block: var(--space-xl) var(--space-lg);
  background: linear-gradient(180deg, var(--color-gray-bg) 0%, var(--color-white) 100%);
}
.stories-hero-inner { max-width: 680px; }
.stories-hero-inner h1 { margin-top: 0.6rem; }
.stories-hero-inner .lead { margin-top: var(--space-sm); }

/* ---------- Gallery grid ---------- */
.stories-gallery {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
  .stories-gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .stories-gallery { grid-template-columns: repeat(5, 1fr); }
}

.story-card {
  position: relative;
  display: flex;
  min-height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-navy);
  background-size: cover;
  background-position: center;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition);
}
.story-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 21, 31, 0) 40%, rgba(22, 21, 31, 0.85) 100%);
  z-index: 0;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.story-card-tall { min-height: 340px; }
@media (min-width: 960px) {
  .story-card-tall { grid-row: span 2; min-height: 100%; }
}

/* Alternate brand-tinted backdrops for cards without a real photo yet,
   so the gallery still reads as intentional rather than "broken images". */
.story-card:not([style]) { background-color: var(--color-navy); }
.stories-gallery .story-card:nth-child(2n):not([style]) { background-color: var(--color-orange); }
.stories-gallery .story-card:nth-child(3n):not([style]) { background-color: var(--color-navy-dark); }

.story-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 1;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 17, 150, 0.85);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  max-width: calc(100% - 1.7rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-card-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 0.9rem;
}
.story-card-body h3 {
  color: var(--color-white);
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
}
.story-university {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

/* ---------- Empty state ---------- */
.stories-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  max-width: 480px;
  margin-inline: auto;
  padding: var(--space-2xl) var(--space-md);
}
.stories-empty-icon {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(37, 17, 150, 0.08);
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}
.stories-empty h2 { font-size: 1.4rem; }
.stories-empty .btn { margin-top: 0.5rem; }

/* ---------- Closing CTA ---------- */
.stories-cta-inner { text-align: center; max-width: 620px; margin-inline: auto; }
.stories-cta-inner .hero-actions { justify-content: center; margin-top: var(--space-md); }
.stories-outline-light { color: var(--color-white); border-color: rgba(255, 255, 255, 0.35); }
.stories-outline-light:hover { border-color: var(--color-white); }
