/* --- Base Container --- */
.cpro-module-wrapper {
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
}

/* Container - Increased max-width to give 4 columns room to breathe */
.cpro-container {
  max-width: 100%; 
  margin: 0 auto;
}

/* --- Filters Bar Base --- */
.cpro-filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  width: 100%;
  padding: 20px 0 30px 0;
  flex-wrap: wrap;
}

.cpro-filters-group {
  display: flex;
  flex: 1;
  gap: 15px;
  align-items: flex-end;
  justify-content: flex-start;
}

.cpro-filter-control {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Ensure both inputs and selects look identical */
.cpro-input, 
.cpro-select {
  height: 48px;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff;
  font-size: 14px;
  color: #1e293b;
  width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
  appearance: none;
  transition: border-color 0.2s ease;
}

/* Dropdown Arrow Fix */
.cpro-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Hover/Focus state to match HubSpot style */
.cpro-input:hover, .cpro-select:hover {
  border-color: #94a3b8 !important;
}

.cpro-input:focus, .cpro-select:focus {
  border-color: #0f145b !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 20, 91, 0.1);
}

/* Specific icon alignment */
.cpro-search-control form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  display: block !important;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
}

.js-search-input {
  padding-left: 40px !important; 
}

/* Label Styling */
.cpro-filter-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  display:none !important;
}

/* Reset Button */
.cpro-btn-reset {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid #d1d5db;
  background-color: #fff;
  color: #374151;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.cpro-btn-reset:hover {
  background-color: #f3f4f6;
}

.cpro-card-category-wrapper {
  display:none;
}

/* --- Desktop Layout (1200px and above) --- */
@media screen and (min-width: 1200px) {
  .cpro-filters-bar {
    flex-wrap: nowrap !important; 
    align-items: flex-end;
  }
  .cpro-filters-group {
    flex-wrap: nowrap !important;
  }
  .cpro-filter-control:not(.cpro-search-control) {
    width: 260px; 
    flex-shrink: 0;
  }
  .cpro-search-control {
    flex: 2; 
    min-width: 250px;
  }
  .cpro-filters-reset {
    margin-left: auto; 
    flex-shrink: 0;
  }
}

/* --- Mobile/Tablet Stacking (Under 1199px) --- */
@media screen and (max-width: 1199px) {
  .cpro-filters-bar {
    flex-direction: column;
    align-items: flex-start; /* Aligns Reset button to left */
    gap: 15px;
  }
  
  .cpro-filters-group {
    flex-direction: column;
    align-items: stretch; /* Forces dropdowns to 100% width */
    width: 100%;
  }
  
  .cpro-filter-control:not(.cpro-search-control),
  .cpro-search-control {
    width: 100% !important;
  }
}

/* --- Bulletproof Responsive Grid --- */
#ajax-main-wrapper .cpro-card-grid {
  display: grid !important;
  grid-template-columns: repeat(1, 1fr) !important;
  gap: 24px !important;
  align-items: stretch;
}

@media (min-width: 768px) {
  #ajax-main-wrapper .cpro-card-grid { 
    grid-template-columns: repeat(2, 1fr) !important; 
  }
}

@media (min-width: 1440px) {
  #ajax-main-wrapper .cpro-card-grid { 
    grid-template-columns: repeat(3, 1fr) !important; 
  }
}

@media (min-width: 1900px) {
  #ajax-main-wrapper .cpro-card-grid { 
    grid-template-columns: repeat(4, 1fr) !important; 
  }
}

/* --- Card Design --- */
#ajax-main-wrapper .cpro-card-overall-link {
  text-decoration: none;
  display: block;
  height: 100%; 
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

#ajax-main-wrapper .cpro-card-overall-link:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

#ajax-main-wrapper .cpro-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

/* Image styling */
.cpro-card-image-link {
  display: flex;
  width: 100%;
  height: 240px; 
  overflow: hidden;
  align-items: flex-start;
}

.cpro-card-image {
  width: 100%;
  height: 100%;
 /* object-fit: cover; /* Cover ensures it fills the 240px without warping */
}

.cpro-icon-wrapper svg {
  width: 16px; 
  height: 16px;
  display: block;
}

/* Content styling */
#ajax-main-wrapper .cpro-card-content {
  padding: 20px;
  flex-grow: 1; 
}

.cpro-card-category {
  display: inline-block;
  border: 1px solid #d1d5db;
  color: #E71802; 
  font-weight: 700;
  font-size: 11px;
  padding: 3px 6px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.cpro-card-title {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 12px 0;
  font-weight: 700;
  color: #0f145b;
}

.cpro-card-excerpt p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
}

/* Footer & Arrow Block */
.cpro-card-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #e5e7eb;
  padding: 0; 
}

.cpro-footer-info {
  padding: 20px;
  flex-grow: 1;
}

.cpro-footer-date {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.cpro-card-arrow-block {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #e5e7eb;
  padding: 20px; 
  transition: all 0.3s ease;
}

.cpro-card-arrow-svg {
  transition: stroke 0.3s ease;
}

/* Hover effects */
.cpro-card-overall-link:hover .cpro-card-arrow-block {
  background-color: #0f145b !important;
  border-color: #0f145b !important;
}

.cpro-card-overall-link:hover .cpro-card-arrow-svg {
  stroke: #ffffff !important;
}