/**
 * Testimonies Page Styles
 * Grid layout with dropdown filtering.
 * Page hero now uses global .page-hero from pages.css.
 */

/* ========================================
   PAGE WRAPPER — warm-white behind filter bar + grid
   The hero gradient blends into this, so the filter bar
   (transparent) seamlessly connects hero → grid.
   ======================================== */
.testimonies-page {
  background: var(--color-warm-white);
}

/* ========================================
   SPACING OVERRIDES
   Tighten the vertical rhythm: hero → filter → status → grid
   Hero uses the default gradient (cream → cream-dark) from pages.css.
   ======================================== */

.testimonies-page .elementor-content-area:empty {
  display: none;
}

/* ========================================
   FILTER BAR
   filter-controls, filter-select-wrapper, filter-select, lc-search-wrapper
   etc. come from learning-center.css (loaded before this file).
   Only the sticky wrapper needs a local override.
   ======================================== */
.testimonies-filters {
  background: transparent;
  border-bottom: none;
}

/* ========================================
   GRID SECTION
   ======================================== */
.testimonies-grid-section {
  background: var(--color-warm-white);
  padding-top: var(--space-lg);
}

.testimonies-status {
  text-align: center;
  margin-bottom: var(--space-md);
}

.testimonies-showing {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.testimonies-showing span {
  font-weight: 500;
  color: var(--color-sage);
}

/* ========================================
   TESTIMONIES GRID
   ======================================== */
.testimonies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  position: relative;
}

@media (max-width: 1024px) {
  .testimonies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .testimonies-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ========================================
   TESTIMONY CARD
   ======================================== */
.testimony-card {
  background: var(--color-cream);
  padding: var(--space-lg);
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 352px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Staggered animation on load */
.testimony-card.animate-on-scroll {
  animation-delay: calc(var(--stagger) * 0.05s);
}

/* Decorative quote mark */
.testimony-card::before {
  content: '"';
  position: absolute;
  top: var(--space-sm);
  left: var(--space-md);
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--color-coral);
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}

.testimony-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(44, 41, 37, 0.08);
}

/* Filter animation states */
.testimony-card.filtering-out {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

.testimony-card.hidden {
  display: none;
}

.testimony-card.filtering-in {
  animation: filterIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--filter-index, 0) * 0.03s);
}

@keyframes filterIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   CARD ELEMENTS
   ======================================== */
.testimony-card__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
  padding-top: var(--space-md);
}

.testimony-card__category {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sage);
  background: rgba(91, 138, 107, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.testimony-card__quote {
  font-family: var(--font-display);
  font-size: 1.225rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0;
  padding-top: var(--space-sm);
  flex: 1;
}

/* Clamp excerpt to 5 lines */
.testimony-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Expandable testimony text */
.testimony-card__full {
  display: none;
}

.testimony-card.expanded .testimony-card__excerpt {
  display: none;
}

.testimony-card.expanded .testimony-card__full {
  display: inline;
}

.testimony-card.expanded .testimony-card__quote {
  flex: none;
}

.testimony-card.expanded,
.siahus-testimonies .testimony-card.expanded {
  box-shadow: 0 25px 60px rgba(44, 41, 37, 0.22);
  overflow: hidden;
  height: auto;
  z-index: 200 !important;
}

.testimony-card__placeholder {
  border-radius: 12px;
  background: var(--color-cream-dark);
  opacity: 0.3;
}

/* Cards with a toggle are fully clickable */
.testimony-card:has(.testimony-card__toggle) {
  cursor: pointer;
}

.testimony-card__toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-xs);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-sage);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.testimony-card__toggle:hover {
  color: var(--color-sage-dark);
}

.testimony-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.testimony-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-sage-light), var(--color-sage));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: white;
  flex-shrink: 0;
}

.testimony-card__author {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.testimony-card__name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.testimony-card__name {
  font-style: normal;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text);
}

.testimony-card__date {
  font-size: 0.75rem;
  color: #666;
}

.testimony-card__location {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ========================================
   EMPTY / NO RESULTS STATES
   ======================================== */
.testimonies-empty,
.testimonies-no-results {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

.testimonies-no-results {
  display: none;
}

.testimonies-no-results.visible {
  display: block;
}

/* ========================================
   FOLIAGE Z-INDEX OVERRIDES
   Allow foliage to show over content
   ======================================== */
.siahus-testimonies .site-main {
  z-index: auto;
}

.siahus-testimonies .site-main > * {
  position: relative;
  z-index: auto;
}

/* Sections stay at z-index auto so foliage shows over them */
.siahus-testimonies .page-header--testimonies,
.siahus-testimonies .testimonies-grid-section {
  position: relative;
  z-index: auto;
}

/* Filter section needs higher z-index for dropdown to work */
.siahus-testimonies .testimonies-filters {
  position: sticky;
  z-index: 500;
}

/* Cards and interactive elements above foliage */
.siahus-testimonies .testimony-card {
  position: relative;
  z-index: 101;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */
.load-more-container {
  text-align: center;
  margin-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  position: relative;
  z-index: 101;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  border-color: var(--color-sage);
  background: var(--color-warm-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(44, 41, 37, 0.08);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn svg {
  transition: transform 0.3s ease;
}

.load-more-btn:hover svg {
  transform: translateY(2px);
}
