/**
 * Flexible Cards Block - Frontend Styles
 */

/* Full width wrapper - spans the entire viewport width */
.flexible-cards-wrapper-full {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  position: relative;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  box-sizing: border-box; /* Include padding in width calculation */
}

/* Standard wrapper */
.flexible-cards-wrapper {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Fix for horizontal scrolling */
body {
  overflow-x: hidden; /* Prevent horizontal scrolling on the body */
}

/* Main block container */
.wildapricot-flexible-cards-block {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Section header container */
.flexible-cards-header {
  text-align: center;
}

/* Section title */
.flexible-cards-title {
  font-family: 'Georama', sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Section content */
.flexible-cards-content {
  margin-bottom: 0;
}

.flexible-cards-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
}

/* Cards container */
.flexible-cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

/* Grid layout */
.layout-grid .flexible-cards-container {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  width: 100%;
  justify-content: center;
}

/* Masonry layout */
.layout-masonry .flexible-cards-container {
  column-count: 1 !important;
  column-gap: 2rem !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.layout-masonry .flexible-card {
  break-inside: avoid !important;
  margin-bottom: 2rem !important;
  display: inline-block !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Force 2 columns for masonry layout regardless of screen size */
.columns-2.layout-masonry .flexible-cards-container {
  column-count: 2 !important;
}

/* Responsive columns */
@media (min-width: 576px) {
  .columns-2.layout-grid .flexible-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .columns-3.layout-grid .flexible-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .columns-2.layout-masonry .flexible-cards-container {
    column-count: 2;
  }
  
  .columns-3.layout-masonry .flexible-cards-container {
    column-count: 2;
  }
}

@media (min-width: 992px) {
  .columns-3.layout-grid .flexible-cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .columns-3.layout-masonry .flexible-cards-container {
    column-count: 3;
  }
}

/* Individual card styles */
.flexible-card {
  background-color: #fff;
  border-radius: 39px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  height: auto;
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow-y: visible;
}

.flexible-card-media {
  width: 100%;
  overflow: hidden;
  padding: 15px;
}

.flexible-card-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
}

.flexible-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.flexible-card-title {
  font-family: 'Georama', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #411A50;
}

.flexible-card-description {
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Button styles */
.flexible-card .btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
}

.flexible-card .btn-link {
  color: #411A50;
  padding: 0;
  background: transparent;
  border: none;
}

.flexible-card .btn-link:hover,
.flexible-card .btn-link:focus {
  color: #FF7E0B;
  text-decoration: underline;
}

.flexible-card .btn-link::after {
  content: " >";
  display: inline-block;
  margin-left: 0.25rem;
}

.flexible-card .btn-cta {
  background-color: #411A50;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: none;
  text-align: center;
  font-family: 'Georama', sans-serif;
}

.flexible-card .btn-cta:hover,
.flexible-card .btn-cta:focus {
  background-color: #341540;
  color: white;
}

.flexible-card .btn-trial {
  background-color: #850989;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: none;
  text-align: center;
  font-family: 'Georama', sans-serif;
}

.flexible-card .btn-trial:hover,
.flexible-card .btn-trial:focus {
  background-color: #6b0770;
  color: white;
}

/* Ensure card content always has the correct text color regardless of parent background */
.flexible-card {
  color: #411a50;
}

.flexible-card h1, 
.flexible-card h2, 
.flexible-card h3, 
.flexible-card h4, 
.flexible-card h5, 
.flexible-card h6,
.flexible-card-title {
  color: #411a50 !important;
}

.flexible-card p, 
.flexible-card li {
  color: #333333 !important;
}

/* Override any inherited text colors for cards */
.bg-primary .flexible-card,
.bg-secondary .flexible-card,
.bg-success .flexible-card,
.bg-danger .flexible-card,
.bg-dark .flexible-card,
.bg-info .flexible-card,
.bg-warning .flexible-card,
.bg-light .flexible-card,
.bg-white .flexible-card,
.bg-transparent .flexible-card {
  color: #411a50;
}

.bg-primary .flexible-card h1, 
.bg-primary .flexible-card h2, 
.bg-primary .flexible-card h3, 
.bg-primary .flexible-card h4, 
.bg-primary .flexible-card h5, 
.bg-primary .flexible-card h6,
.bg-primary .flexible-card-title,
.bg-secondary .flexible-card h1, 
.bg-secondary .flexible-card h2, 
.bg-secondary .flexible-card h3, 
.bg-secondary .flexible-card h4, 
.bg-secondary .flexible-card h5, 
.bg-secondary .flexible-card h6,
.bg-secondary .flexible-card-title,
.bg-success .flexible-card h1, 
.bg-success .flexible-card h2, 
.bg-success .flexible-card h3, 
.bg-success .flexible-card h4, 
.bg-success .flexible-card h5, 
.bg-success .flexible-card h6,
.bg-success .flexible-card-title,
.bg-danger .flexible-card h1, 
.bg-danger .flexible-card h2, 
.bg-danger .flexible-card h3, 
.bg-danger .flexible-card h4, 
.bg-danger .flexible-card h5, 
.bg-danger .flexible-card h6,
.bg-danger .flexible-card-title,
.bg-dark .flexible-card h1, 
.bg-dark .flexible-card h2, 
.bg-dark .flexible-card h3, 
.bg-dark .flexible-card h4, 
.bg-dark .flexible-card h5, 
.bg-dark .flexible-card h6,
.bg-dark .flexible-card-title {
  color: #411a50 !important;
}

.bg-primary .flexible-card p, 
.bg-primary .flexible-card li,
.bg-secondary .flexible-card p, 
.bg-secondary .flexible-card li,
.bg-success .flexible-card p, 
.bg-success .flexible-card li,
.bg-danger .flexible-card p, 
.bg-danger .flexible-card li,
.bg-dark .flexible-card p, 
.bg-dark .flexible-card li {
  color: #333333 !important;
}

/* Clickable card link styles */
.flexible-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.flexible-card-link:hover,
.flexible-card-link:focus {
  text-decoration: none;
  color: inherit;
}

/* Ensure clickable images maintain their styling */
.flexible-card-media .flexible-card-link {
  display: block;
  transition: transform 0.2s ease;
}

.flexible-card-media .flexible-card-link:hover {
  transform: scale(1.02);
}

/* Ensure clickable titles maintain their styling */
.flexible-card-link .flexible-card-title {
  color: #411A50 !important;
  transition: color 0.2s ease;
}

.flexible-card-link:hover .flexible-card-title {
  color: #FF7E0B !important;
}
