/**
 * @file
 * Styles for EGR Text CTAs component.
 */

/* Container and layout */
.egr-text-ctas {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
}

/* Grid layouts based on count */
.egr-text-ctas--count-1 {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.egr-text-ctas--count-2 {
  grid-template-columns: repeat(2, 1fr);
}

.egr-text-ctas--count-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive grid */
@media (max-width: 992px) {
  .egr-text-ctas--count-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .egr-text-ctas--count-2 {
    grid-template-columns: 1fr;
  }
}

/* Card styles */
.egr-text-ctas__card {
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.egr-text-ctas__card:hover {
  transform: translateY(-5px);
}

/* Card style variations */
.egr-text-ctas__card--default {
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.egr-text-ctas__card--default:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.egr-text-ctas__card--bordered {
  background: #ffffff;
  border: 2px solid #e0e0e0;
}

.egr-text-ctas__card--bordered:hover {
  border-color: #18453B;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.egr-text-ctas__card--filled {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.egr-text-ctas__card--filled:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Icon styling */
.egr-text-ctas__icon {
  font-size: 3rem;
  color: #00c24e;
  margin-bottom: 1rem;
}

/* Title styling */
.egr-text-ctas__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* Title link styling */
.egr-text-ctas__title-link {
  color: #18453B;
  text-decoration: none;
  transition: color 0.3s ease;
}

.egr-text-ctas__title-link:hover {
  color: #00c24e;
  text-decoration: underline;
}

/* Text styling */
.egr-text-ctas__text {
  font-size: 1rem;
  color: #495057;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Link button styling */
.egr-text-ctas__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: auto;
  align-self: flex-start; /* Prevents stretching in flex containers */
}

/* Bootstrap button overrides for stronger appearance */
.egr-text-ctas__link.btn-primary {
  background-color: #18453B;
  border-color: #18453B;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.egr-text-ctas__link.btn-primary:hover {
  background-color: #00c24e;
  border-color: #00c24e;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  gap: 0.75rem;
}

.egr-text-ctas__link .bi {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.egr-text-ctas__link:hover .bi {
  transform: translateX(3px);
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .egr-text-ctas__card {
    transition: none;
  }
  
  .egr-text-ctas__card:hover {
    transform: none;
  }
  
  .egr-text-ctas__title-link {
    transition: none;
  }
  
  .egr-text-ctas__link {
    transition: none;
  }
  
  .egr-text-ctas__link:hover {
    transform: none;
  }
  
  .egr-text-ctas__link .bi {
    transition: none;
  }
  
  .egr-text-ctas__link:hover .bi {
    transform: none;
  }
}

/* Alignment variations */
.egr-text-ctas--align-center {
  text-align: center;
}

.egr-text-ctas--align-center .egr-text-ctas__icon {
  justify-content: center;
  display: flex;
}

.egr-text-ctas--align-center .egr-text-ctas__link {
  align-self: center;
}

.egr-text-ctas--align-right {
  text-align: right;
}

.egr-text-ctas--align-right .egr-text-ctas__icon {
  justify-content: flex-end;
  display: flex;
}

.egr-text-ctas--align-right .egr-text-ctas__link {
  align-self: flex-end;
}

/* Background wrapper */
.egr-text-ctas-bg-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
}

/* When background color is applied */
.egr-text-ctas-bg-wrapper[style*="background-color"] {
  padding: 4rem 0;
}

/* Edge to edge layout */
.egr-text-ctas-edge-to-edge {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  margin: 0;
}

/* Container-based layouts already have Bootstrap styling */
.container .egr-text-ctas,
.container-fluid .egr-text-ctas {
  margin: 3rem 0;
}

/* Dark background adjustments */
.egr-text-ctas-bg-wrapper[style*="background-color: #18453B"] .egr-text-ctas__card,
.egr-text-ctas-bg-wrapper[style*="background-color: #00c24e"] .egr-text-ctas__card {
  background: rgba(255, 255, 255, 0.95);
}

/* Hover state for cards on dark backgrounds */
.egr-text-ctas-bg-wrapper[style*="background-color: #18453B"] .egr-text-ctas__card:hover,
.egr-text-ctas-bg-wrapper[style*="background-color: #00c24e"] .egr-text-ctas__card:hover {
  background: #ffffff;
}